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

Method testScriptFiles

test/org/apache/pig/test/TestPigContext.java:217–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

215
216 // See PIG-1824
217 @SuppressWarnings("deprecation")
218 @Test
219 public void testScriptFiles() throws Exception {
220 PigContext pc = new PigContext(Util.getLocalTestMode(), getProperties());
221 final int n = pc.scriptFiles.size();
222 pc.addScriptFile("test/path-1824");
223 assertEquals("test" + File.separator + "path-1824", pc.getScriptFiles().get("test/path-1824").toString());
224 assertEquals("script files should not be populated", n, pc.scriptFiles.size());
225
226 pc.addScriptFile("path-1824", "test/path-1824");
227 assertEquals("test" + File.separator + "path-1824", pc.getScriptFiles().get("path-1824").toString());
228 assertEquals("script files should not be populated", n, pc.scriptFiles.size());
229
230 // last add wins when using an alias
231 pc.addScriptFile("path-1824", "test/some/other/path-1824");
232 assertEquals("test" + File.separator + "some" + File.separator + "other"
233 + File.separator + "path-1824", pc.getScriptFiles().get("path-1824").toString());
234 assertEquals("script files should not be populated", n, pc.scriptFiles.size());
235
236 // clean up
237 pc.getScriptFiles().remove("path-1824");
238 pc.getScriptFiles().remove("test/path-1824");
239 }
240
241 private static Properties getProperties() {
242 Properties props = new Properties();

Callers

nothing calls this directly

Calls 9

getLocalTestModeMethod · 0.95
getPropertiesMethod · 0.95
addScriptFileMethod · 0.95
getScriptFilesMethod · 0.95
sizeMethod · 0.65
getMethod · 0.65
removeMethod · 0.65
assertEqualsMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected