Skip to content

Commit

Permalink
Fix fileutility unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikram Agrawal committed Aug 28, 2019
1 parent c38bd6c commit fcf2a86
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions core/src/test/java/org/apache/spark/io/FileUtilitySuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.RandomUtils;
import org.apache.hadoop.fs.Path;
import org.apache.spark.util.Utils;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import sun.security.action.GetPropertyAction;

import java.io.File;
import java.io.IOException;
Expand All @@ -39,19 +38,14 @@ public class FileUtilitySuite {

@Before
public void setUp() throws IOException {
File tmpLocation = new File(
GetPropertyAction.privilegedGetProperty("java.io.tmpdir"));
Path sourceFolderPath = new Path(tmpLocation.toString(),
sourceFolder = Utils.createTempDir(System.getProperty("java.io.tmpdir"),
"FileUtilTest" + RandomUtils.nextLong());
sourceFolder = new File(sourceFolderPath.toString());
sourceFolder.mkdirs();
destTarLoc = File.createTempFile("dest-tar", ".tar");
destFile = File.createTempFile("dest-file", ".tmp");
}

@After
public void tearDown() {
sourceFolder.delete();
destTarLoc.delete();
destFile.delete();
}
Expand Down

0 comments on commit fcf2a86

Please sign in to comment.