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

Method testNegativeWithoutFetch

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

Verify that ASSERT operator works. Disable fetch for this testcase. @throws Exception

()

Source from the content-addressed store, hash-verified

132 * @throws Exception
133 */
134 @Test
135 public void testNegativeWithoutFetch() throws Exception {
136 PigServer pigServer = new PigServer(Util.getLocalTestMode());
137 Data data = resetData(pigServer);
138
139 data.set("foo",
140 tuple(1),
141 tuple(2),
142 tuple(3)
143 );
144
145 pigServer.registerQuery("A = LOAD 'foo' USING mock.Storage() AS (i:int);");
146 pigServer.registerQuery("ASSERT A BY i > 1 , 'i should be greater than 1';");
147
148 try {
149 pigServer.openIterator("A");
150 } catch (FrontendException fe) {
151 if (pigServer.getPigContext().getExecType().toString().startsWith("TEZ")
152 || pigServer.getPigContext().getExecType().toString().startsWith("SPARK")) {
153 Assert.assertTrue(fe.getCause().getMessage().contains(
154 "Assertion violated: i should be greater than 1"));
155 } else {
156 Assert.assertTrue(fe.getCause().getMessage().contains(
157 "Job terminated with anomalous status FAILED"));
158 }
159 }
160 }
161
162 /**
163 * Verify that alias is not assignable to the ASSERT operator

Callers

nothing calls this directly

Calls 12

getLocalTestModeMethod · 0.95
setMethod · 0.95
registerQueryMethod · 0.95
openIteratorMethod · 0.95
getPigContextMethod · 0.95
resetDataMethod · 0.80
tupleMethod · 0.45
toStringMethod · 0.45
getExecTypeMethod · 0.45
containsMethod · 0.45
getMessageMethod · 0.45
getCauseMethod · 0.45

Tested by

no test coverage detected