diff options
author | Prashant Sharma <prashant.s@imaginea.com> | 2013-03-25 10:43:45 +0530 |
---|---|---|
committer | Prashant Sharma <prashant.s@imaginea.com> | 2013-03-25 10:43:45 +0530 |
commit | 5a080acdb86b57aa167e84475624d9a6546f2a84 (patch) | |
tree | 6abeb53e074586a6217c19ec2b30154654b39f74 /repl/src/test | |
parent | d9f34e505d88daa6e3665b40ab70dab41e277c9d (diff) | |
download | spark-5a080acdb86b57aa167e84475624d9a6546f2a84.tar.gz spark-5a080acdb86b57aa167e84475624d9a6546f2a84.tar.bz2 spark-5a080acdb86b57aa167e84475624d9a6546f2a84.zip |
Fixed broken tests by last commit for repl.
Diffstat (limited to 'repl/src/test')
-rw-r--r-- | repl/src/test/scala/spark/repl/ReplSuite.scala | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/repl/src/test/scala/spark/repl/ReplSuite.scala b/repl/src/test/scala/spark/repl/ReplSuite.scala index db78d06d4f..a3274c2737 100644 --- a/repl/src/test/scala/spark/repl/ReplSuite.scala +++ b/repl/src/test/scala/spark/repl/ReplSuite.scala @@ -27,24 +27,23 @@ class ReplSuite extends FunSuite { spark.repl.Main.interp = interp val separator = System.getProperty("path.separator") interp.process(Array("-classpath", paths.mkString(separator))) - spark.repl.Main.interp = null - if (interp.sparkContext != null) - interp.sparkContext.stop() + if (interp != null) + interp.closeInterpreter(); // To avoid Akka rebinding to the same port, since it doesn't unbind immediately on shutdown System.clearProperty("spark.master.port") return out.toString } - + def assertContains(message: String, output: String) { assert(output contains message, "Interpreter output did not contain '" + message + "':\n" + output) } - + def assertDoesNotContain(message: String, output: String) { assert(!(output contains message), "Interpreter output contained '" + message + "':\n" + output) } - + test ("simple foreach with accumulator") { val output = runInterpreter("local", """ val accum = sc.accumulator(0) @@ -55,7 +54,7 @@ class ReplSuite extends FunSuite { assertDoesNotContain("Exception", output) assertContains("res1: Int = 55", output) } - + test ("external vars") { val output = runInterpreter("local", """ var v = 7 @@ -104,7 +103,7 @@ class ReplSuite extends FunSuite { assertContains("res0: Int = 70", output) assertContains("res1: Int = 100", output) } - + test ("broadcast vars") { // Test that the value that a broadcast var had when it was created is used, // even if that variable is then modified in the driver program |