()
| 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 { |
nothing calls this directly
no test coverage detected