diff options
author | Marcelo Vanzin <vanzin@cloudera.com> | 2015-03-06 09:43:24 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-03-06 09:43:24 +0000 |
commit | cd7594ca6acf1226bf91f8a783606bf5c116f7df (patch) | |
tree | 4841c7a7ed97db56813e574770f7fe87fddcbcea /core | |
parent | d8b3da9ddfe44a2886f3841ceef4ebf9fc318640 (diff) | |
download | spark-cd7594ca6acf1226bf91f8a783606bf5c116f7df.tar.gz spark-cd7594ca6acf1226bf91f8a783606bf5c116f7df.tar.bz2 spark-cd7594ca6acf1226bf91f8a783606bf5c116f7df.zip |
[core] [minor] Don't pollute source directory when running UtilsSuite.
Author: Marcelo Vanzin <vanzin@cloudera.com>
Closes #4921 from vanzin/utils-suite and squashes the following commits:
7795dd4 [Marcelo Vanzin] [core] [minor] Don't pollute source directory when running UtilsSuite.
Diffstat (limited to 'core')
-rw-r--r-- | core/src/test/scala/org/apache/spark/util/UtilsSuite.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala index fd77753c0d..b91428efad 100644 --- a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala @@ -386,10 +386,11 @@ class UtilsSuite extends FunSuite with ResetSystemProperties { } test("fetch hcfs dir") { - val sourceDir = Utils.createTempDir() + val tempDir = Utils.createTempDir() + val sourceDir = new File(tempDir, "source-dir") val innerSourceDir = Utils.createTempDir(root=sourceDir.getPath) val sourceFile = File.createTempFile("someprefix", "somesuffix", innerSourceDir) - val targetDir = new File(Utils.createTempDir(), "target-dir") + val targetDir = new File(tempDir, "target-dir") Files.write("some text", sourceFile, UTF_8) val path = new Path("file://" + sourceDir.getAbsolutePath) @@ -413,7 +414,7 @@ class UtilsSuite extends FunSuite with ResetSystemProperties { assert(destInnerFile.isFile()) val filePath = new Path("file://" + sourceFile.getAbsolutePath) - val testFileDir = new File("test-filename") + val testFileDir = new File(tempDir, "test-filename") val testFileName = "testFName" val testFilefs = Utils.getHadoopFileSystem(filePath.toString, conf) Utils.fetchHcfsFile(filePath, testFileDir, testFilefs, new SparkConf(), |