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

Method testUniquePigTempDir

test/org/apache/pig/test/TestPigServer.java:758–781  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

756 }
757
758 @Test
759 public void testUniquePigTempDir() throws Throwable {
760 Properties properties = PropertiesUtil.loadDefaultProperties();
761 File pigTempDir = new File(tempDir, FILE_SEPARATOR + "tmp" + FILE_SEPARATOR + "test");
762 properties.put("pig.temp.dir", pigTempDir.getPath());
763 PigContext pigContext = new PigContext(ExecType.LOCAL, properties);
764 pigContext.connect();
765 FileLocalizer.setInitialized(false);
766
767 Random r = new Random(5);
768 FileLocalizer.setR(r);
769 String tempPath1 = FileLocalizer.getTemporaryPath(pigContext).toString();
770
771 FileLocalizer.setInitialized(false);
772 r = new Random(5);
773 FileLocalizer.setR(r);
774 String tempPath2 = FileLocalizer.getTemporaryPath(pigContext).toString();
775
776 assertFalse(tempPath1.toString().equals(tempPath2.toString()));
777
778 // cleanup
779 pigTempDir.delete();
780 FileLocalizer.setInitialized(false);
781 }
782
783 @Test
784 public void testDescribeForEachFlatten() throws Throwable {

Callers

nothing calls this directly

Calls 10

loadDefaultPropertiesMethod · 0.95
connectMethod · 0.95
setInitializedMethod · 0.95
setRMethod · 0.95
getTemporaryPathMethod · 0.95
deleteMethod · 0.65
putMethod · 0.45
getPathMethod · 0.45
toStringMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected