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

Method testPigTempDir

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

Source from the content-addressed store, hash-verified

734 }
735
736 @Test
737 public void testPigTempDir() throws Throwable {
738 Properties properties = PropertiesUtil.loadDefaultProperties();
739 File pigTempDir = new File(tempDir, FILE_SEPARATOR + "tmp" + FILE_SEPARATOR + "test");
740 properties.put("pig.temp.dir", pigTempDir.getPath());
741 PigContext pigContext=new PigContext(ExecType.LOCAL, properties);
742 pigContext.connect();
743 FileLocalizer.setInitialized(false);
744
745 String tempPath= FileLocalizer.getTemporaryPath(pigContext).toString();
746 Path path = new Path(tempPath);
747 assertTrue(tempPath.startsWith(pigTempDir.toURI().toString()));
748
749 FileSystem fs = FileSystem.get(path.toUri(),
750 ConfigurationUtil.toConfiguration(pigContext.getProperties()));
751 FileStatus status = fs.getFileStatus(path.getParent());
752 // Temporary root dir should have 700 as permission
753 assertEquals("rwx------", status.getPermission().toString());
754 pigTempDir.delete();
755 FileLocalizer.setInitialized(false);
756 }
757
758 @Test
759 public void testUniquePigTempDir() throws Throwable {

Callers

nothing calls this directly

Calls 13

loadDefaultPropertiesMethod · 0.95
connectMethod · 0.95
setInitializedMethod · 0.95
getTemporaryPathMethod · 0.95
toConfigurationMethod · 0.95
getPropertiesMethod · 0.95
toURIMethod · 0.80
getMethod · 0.65
deleteMethod · 0.65
putMethod · 0.45
getPathMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected