MCPcopy Create free account
hub / github.com/apache/pig / simpleNegativeTest

Method simpleNegativeTest

test/org/apache/pig/test/TestPigRunner.java:560–576  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

runMethod · 0.95
getReturnCodeMethod · 0.95
closeMethod · 0.65

Tested by

no test coverage detected