aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrashant Sharma <prashant.s@imaginea.com>2014-01-03 14:52:37 +0530
committerPrashant Sharma <prashant.s@imaginea.com>2014-01-03 14:52:37 +0530
commitbc311bb826b5548b9c4c55320711f3b18dc19397 (patch)
treee61f3ac29184d1eaadfb3149296a4d543436352c
parent94f2fffa23436ed66a24c705f88dabe59bf54037 (diff)
downloadspark-bc311bb826b5548b9c4c55320711f3b18dc19397.tar.gz
spark-bc311bb826b5548b9c4c55320711f3b18dc19397.tar.bz2
spark-bc311bb826b5548b9c4c55320711f3b18dc19397.zip
Restored the previously removed test
-rw-r--r--core/src/test/scala/org/apache/spark/FileServerSuite.scala13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/src/test/scala/org/apache/spark/FileServerSuite.scala b/core/src/test/scala/org/apache/spark/FileServerSuite.scala
index a15c3751c2..506f7484fb 100644
--- a/core/src/test/scala/org/apache/spark/FileServerSuite.scala
+++ b/core/src/test/scala/org/apache/spark/FileServerSuite.scala
@@ -55,7 +55,7 @@ class FileServerSuite extends FunSuite with LocalSparkContext {
in.close()
jar.close()
stream.close()
- testJarFile = tmpFile2.getAbsolutePath
+ testJarFile = tmpFile2.toURI.toURL.toString
}
override def beforeEach() {
@@ -142,4 +142,15 @@ class FileServerSuite extends FunSuite with LocalSparkContext {
}
}
+ test ("Dynamically adding JARS on a standalone cluster using local: URL") {
+ sc = new SparkContext("local-cluster[1,1,512]", "test")
+ sc.addJar(testJarFile.replace("file", "local"))
+ val testData = Array((1,1))
+ sc.parallelize(testData).foreach { (x) =>
+ if (Thread.currentThread.getContextClassLoader.getResource("FileServerSuite2.txt") == null) {
+ throw new SparkException("jar not added")
+ }
+ }
+ }
+
}