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

Method testNagative7

test/org/apache/pig/parser/TestQueryParser.java:88–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86 }
87
88 @Test // test error message with file name
89 public void testNagative7() throws IOException {
90 File f1 = new File("myscript.pig");
91 f1.deleteOnExit();
92
93 FileWriter fw1 = new FileWriter(f1);
94 fw1.append("A = loadd '1.txt';");
95 fw1.close();
96
97 String[] args = { "-x", "local", "-c", "myscript.pig" };
98 PigStats stats = PigRunner.run(args, null);
99
100 Assert.assertFalse(stats.isSuccessful());
101
102 String expected = "<file myscript.pig, line 1, column 0>";
103 String msg = stats.getErrorMessage();
104
105 Assert.assertFalse(msg == null);
106 Assert.assertTrue(msg.startsWith(expected));
107 }
108
109 // See PIG-2238
110 @Test

Callers

nothing calls this directly

Calls 5

runMethod · 0.95
isSuccessfulMethod · 0.95
getErrorMessageMethod · 0.95
appendMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected