File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
core/src/test/java/org/apache/spark/io Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 1818
1919import org .apache .commons .io .FileUtils ;
2020import org .apache .commons .lang3 .RandomUtils ;
21- import org .apache .hadoop . fs . Path ;
21+ import org .apache .spark . util . Utils ;
2222import org .junit .After ;
2323import org .junit .Assert ;
2424import org .junit .Before ;
2525import org .junit .Test ;
26- import sun .security .action .GetPropertyAction ;
2726
2827import java .io .File ;
2928import java .io .IOException ;
@@ -39,19 +38,14 @@ public class FileUtilitySuite {
3938
4039 @ Before
4140 public void setUp () throws IOException {
42- File tmpLocation = new File (
43- GetPropertyAction .privilegedGetProperty ("java.io.tmpdir" ));
44- Path sourceFolderPath = new Path (tmpLocation .toString (),
41+ sourceFolder = Utils .createTempDir (System .getProperty ("java.io.tmpdir" ),
4542 "FileUtilTest" + RandomUtils .nextLong ());
46- sourceFolder = new File (sourceFolderPath .toString ());
47- sourceFolder .mkdirs ();
4843 destTarLoc = File .createTempFile ("dest-tar" , ".tar" );
4944 destFile = File .createTempFile ("dest-file" , ".tmp" );
5045 }
5146
5247 @ After
5348 public void tearDown () {
54- sourceFolder .delete ();
5549 destTarLoc .delete ();
5650 destFile .delete ();
5751 }
You can’t perform that action at this time.
0 commit comments