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

Method testCleanupOnFailure

test/org/apache/pig/test/TestStoreBase.java:115–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113 }
114
115 @Test
116 public void testCleanupOnFailure() throws Exception {
117 String cleanupSuccessFile = outputFileName + "_cleanupOnFailure_succeeded";
118 String cleanupFailFile = outputFileName + "_cleanupOnFailure_failed";
119 String[] inputData = new String[]{"hello\tworld", "bye\tworld"};
120
121 String script = "a = load '"+ inputFileName + "';" +
122 "store a into '" + outputFileName + "' using " +
123 DUMMY_STORE_CLASS_NAME + "('true');";
124
125 Util.deleteFile(ps.getPigContext(), TESTDIR);
126 ps.setBatchOn();
127 Util.createInputFile(ps.getPigContext(),
128 inputFileName, inputData);
129 Util.registerMultiLineQuery(ps, script);
130 ps.executeBatch();
131 assertEquals(
132 "Checking if file indicating that cleanupOnFailure failed " +
133 " does not exists in " + mode + " mode", false,
134 Util.exists(ps.getPigContext(), cleanupFailFile));
135 assertEquals(
136 "Checking if file indicating that cleanupOnFailure was " +
137 "successfully called exists in " + mode + " mode", true,
138 Util.exists(ps.getPigContext(), cleanupSuccessFile));
139 }
140
141 @Test
142 public void testCleanupOnFailureMultiStore() throws Exception {

Callers

nothing calls this directly

Calls 8

deleteFileMethod · 0.95
createInputFileMethod · 0.95
existsMethod · 0.95
getPigContextMethod · 0.45
setBatchOnMethod · 0.45
executeBatchMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected