flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] flink pull request #6399: [FLINK-5860] [tests] Replace java.io.tmpdir with J...
Date Tue, 24 Jul 2018 11:49:50 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6399#discussion_r204722139
  
    --- Diff: flink-core/src/test/java/org/apache/flink/api/common/io/EnumerateNestedFilesTest.java
---
    @@ -240,36 +205,19 @@ public void testOnlyLevel2NestedDirectories() {
     	 */
     	@Test
     	public void testTwoNestedDirectoriesWithFilteredFilesTrue() {
    -
    -		String sep = System.getProperty("file.separator");
    -
     		try {
     			String firstLevelDir = TestFileUtils.randomFileName();
     			String secondLevelDir = TestFileUtils.randomFileName();
     			String thirdLevelDir = TestFileUtils.randomFileName();
     			String secondLevelFilterDir = "_"+TestFileUtils.randomFileName();
     			String thirdLevelFilterDir = "_"+TestFileUtils.randomFileName();
     
    -			File nestedDir = new File(tempPath + sep + firstLevelDir);
    -			nestedDir.mkdirs();
    -			nestedDir.deleteOnExit();
    -
    -			File insideNestedDir = new File(tempPath + sep + firstLevelDir + sep + secondLevelDir);
    -			insideNestedDir.mkdirs();
    -			insideNestedDir.deleteOnExit();
    -			File insideNestedDirFiltered = new File(tempPath + sep + firstLevelDir + sep + secondLevelFilterDir);
    -			insideNestedDirFiltered.mkdirs();
    -			insideNestedDirFiltered.deleteOnExit();
    -			File filteredFile = new File(tempPath + sep + firstLevelDir + sep + "_IWillBeFiltered");
    -			filteredFile.createNewFile();
    -			filteredFile.deleteOnExit();
    -
    -			File nestedNestedDir = new File(tempPath + sep + firstLevelDir + sep + secondLevelDir
+ sep + thirdLevelDir);
    -			nestedNestedDir.mkdirs();
    -			nestedNestedDir.deleteOnExit();
    -			File nestedNestedDirFiltered = new File(tempPath + sep + firstLevelDir + sep + secondLevelDir
+ sep + thirdLevelFilterDir);
    -			nestedNestedDirFiltered.mkdirs();
    -			nestedNestedDirFiltered.deleteOnExit();
    +			File nestedNestedDirFiltered = tempFolder.newFolder(firstLevelDir, secondLevelDir,
thirdLevelDir, thirdLevelFilterDir);
    +			File nestedNestedDir = nestedNestedDirFiltered.getParentFile();
    +			File insideNestedDir = nestedNestedDir.getParentFile();
    +			File nestedDir = insideNestedDir.getParentFile();
    +			File insideNestedDirFiltered = tempFolder.newFolder(firstLevelDir, secondLevelFilterDir);
    +			new File(nestedDir, "_IWillBeFiltered");
    --- End diff --
    
    This file isn't explicitly created anymore.


---

Mime
View raw message