aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/scala/org/apache/spark/TestUtils.scala9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/TestUtils.scala b/core/src/main/scala/org/apache/spark/TestUtils.scala
index f3f59e47c3..8ae0215482 100644
--- a/core/src/main/scala/org/apache/spark/TestUtils.scala
+++ b/core/src/main/scala/org/apache/spark/TestUtils.scala
@@ -100,9 +100,14 @@ private[spark] object TestUtils {
val fileName = className + ".class"
val result = new File(fileName)
- if (!result.exists()) throw new Exception("Compiled file not found: " + fileName)
+ assert(result.exists(), "Compiled file not found: " + result.getAbsolutePath())
val out = new File(destDir, fileName)
- result.renameTo(out)
+
+ // renameTo cannot handle in and out files in different filesystems
+ // use google's Files.move instead
+ Files.move(result, out)
+
+ assert(out.exists(), "Destination file not moved: " + out.getAbsolutePath())
out
}
}