()
| 558 | } |
| 559 | |
| 560 | @Test |
| 561 | public void simpleNegativeTest() throws Exception { |
| 562 | PrintWriter w = new PrintWriter(new FileWriter(PIG_FILE)); |
| 563 | w.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);"); |
| 564 | w.println("B = group A by a;"); |
| 565 | w.println("C = foreach B generate group, COUNT(A);"); |
| 566 | w.println("store C into '" + OUTPUT_FILE + "';"); |
| 567 | w.close(); |
| 568 | String[] args = { "-x", execType, "-c", PIG_FILE }; |
| 569 | PigStats stats = PigRunner.run(args, null); |
| 570 | assertTrue(stats.getReturnCode() == ReturnCode.PIG_EXCEPTION); |
| 571 | // TODO: error message has changed. Need to catch the new message generated from the |
| 572 | // new parser. |
| 573 | // assertTrue(stats.getErrorCode() == 1000); |
| 574 | // assertEquals("Error during parsing. Invalid alias: a in {a0: int,a1: int,a2: int}", |
| 575 | // stats.getErrorMessage()); |
| 576 | } |
| 577 | |
| 578 | @Test |
| 579 | public void simpleNegativeTest2() throws Exception { |
nothing calls this directly
no test coverage detected