Check if query plan for alias argument produces exception with expected error message in expectedErr argument. @param query @param alias @param expectedErr @throws IOException
(String query, String alias, String expectedErr)
| 638 | * @throws IOException |
| 639 | */ |
| 640 | static public void checkExceptionMessage(String query, String alias, String expectedErr) |
| 641 | throws IOException { |
| 642 | PigServer pig = new PigServer(ExecType.LOCAL); |
| 643 | |
| 644 | boolean foundEx = false; |
| 645 | try{ |
| 646 | Util.registerMultiLineQuery(pig, query); |
| 647 | pig.explain(alias, System.out); |
| 648 | }catch(FrontendException e){ |
| 649 | foundEx = true; |
| 650 | checkMessageInException(e, expectedErr); |
| 651 | } |
| 652 | |
| 653 | if(!foundEx) |
| 654 | fail("No exception thrown. Exception is expected."); |
| 655 | |
| 656 | } |
| 657 | |
| 658 | public static void checkMessageInException(FrontendException e, |
| 659 | String expectedErr) { |
no test coverage detected