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