diff --git a/core/src/main/scala/org/apache/spark/TestUtils.scala b/core/src/main/scala/org/apache/spark/TestUtils.scala index 5bf8a282177d4..8ae02154823ee 100644 --- a/core/src/main/scala/org/apache/spark/TestUtils.scala +++ b/core/src/main/scala/org/apache/spark/TestUtils.scala @@ -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 } }