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

Method testNegativeWithAlias

test/org/apache/pig/test/TestAssert.java:166–184  ·  view source on GitHub ↗

Verify that alias is not assignable to the ASSERT operator @throws Exception

()

Source from the content-addressed store, hash-verified

164 * @throws Exception
165 */
166 @Test(expected=FrontendException.class)
167 public void testNegativeWithAlias() throws Exception {
168 PigServer pigServer = new PigServer(Util.getLocalTestMode());
169 Data data = resetData(pigServer);
170
171 data.set("foo",
172 tuple(1),
173 tuple(2),
174 tuple(3)
175 );
176 try {
177 pigServer.registerQuery("A = LOAD 'foo' USING mock.Storage() AS (i:int);");
178 pigServer.registerQuery("B = ASSERT A BY i > 1 , 'i should be greater than 1';");
179 }
180 catch (FrontendException fe) {
181 Util.checkMessageInException(fe, "Syntax error, unexpected symbol at or near 'B'");
182 throw fe;
183 }
184 }
185
186}

Callers

nothing calls this directly

Calls 6

getLocalTestModeMethod · 0.95
setMethod · 0.95
registerQueryMethod · 0.95
resetDataMethod · 0.80
tupleMethod · 0.45

Tested by

no test coverage detected