Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions core/src/main/scala/org/apache/spark/TestUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}