Skip to content

Commit

Permalink
Based on @srowen's comment, assert file existence.
Browse files Browse the repository at this point in the history
  • Loading branch information
advancedxy committed Apr 16, 2014
1 parent 6f95550 commit a2b97c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 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,14 +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)

// renameTo cannot handle in and out files in different filesystems
// use google's Files.move instead
Files.move(result, out)

if (!out.exists()) throw new Exception("Destination file not moved: " + out)
assert(out.exists(), "Destination file not moved: " + out.getAbsolutePath())
out
}
}

0 comments on commit a2b97c7

Please sign in to comment.