aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/scala
diff options
context:
space:
mode:
authorReynold Xin <rxin@cs.berkeley.edu>2012-10-02 11:52:12 -0700
committerReynold Xin <rxin@cs.berkeley.edu>2012-10-02 11:52:12 -0700
commitb8cd6811697f10cd969cfe750f7fd815e0545177 (patch)
tree529ec8ab3e6275d9cbda78a72ea29bb9d3253e2b /core/src/test/scala
parent42e0a68082327c78dbd0fd313145124d9b8a9d98 (diff)
downloadspark-b8cd6811697f10cd969cfe750f7fd815e0545177.tar.gz
spark-b8cd6811697f10cd969cfe750f7fd815e0545177.tar.bz2
spark-b8cd6811697f10cd969cfe750f7fd815e0545177.zip
Allow whitespaces in cluster URL configuration for local cluster.
Diffstat (limited to 'core/src/test/scala')
-rw-r--r--core/src/test/scala/spark/DistributedSuite.scala22
1 files changed, 19 insertions, 3 deletions
diff --git a/core/src/test/scala/spark/DistributedSuite.scala b/core/src/test/scala/spark/DistributedSuite.scala
index fce1deaa5c..48c0a830e0 100644
--- a/core/src/test/scala/spark/DistributedSuite.scala
+++ b/core/src/test/scala/spark/DistributedSuite.scala
@@ -18,9 +18,9 @@ import storage.StorageLevel
class DistributedSuite extends FunSuite with ShouldMatchers with BeforeAndAfter {
val clusterUrl = "local-cluster[2,1,512]"
-
+
@transient var sc: SparkContext = _
-
+
after {
if (sc != null) {
sc.stop()
@@ -28,6 +28,22 @@ class DistributedSuite extends FunSuite with ShouldMatchers with BeforeAndAfter
}
}
+ test("local-cluster format") {
+ sc = new SparkContext("local-cluster[2,1,512]", "test")
+ assert(sc.parallelize(1 to 2, 2).count == 2)
+ sc.stop()
+ sc = new SparkContext("local-cluster[2 , 1 , 512]", "test")
+ assert(sc.parallelize(1 to 2, 2).count == 2)
+ sc.stop()
+ sc = new SparkContext("local-cluster[2, 1, 512]", "test")
+ assert(sc.parallelize(1 to 2, 2).count == 2)
+ sc.stop()
+ sc = new SparkContext("local-cluster[ 2, 1, 512 ]", "test")
+ assert(sc.parallelize(1 to 2, 2).count == 2)
+ sc.stop()
+ sc = null
+ }
+
test("simple groupByKey") {
sc = new SparkContext(clusterUrl, "test")
val pairs = sc.parallelize(Array((1, 1), (1, 2), (1, 3), (2, 1)), 5)
@@ -38,7 +54,7 @@ class DistributedSuite extends FunSuite with ShouldMatchers with BeforeAndAfter
val valuesFor2 = groups.find(_._1 == 2).get._2
assert(valuesFor2.toList.sorted === List(1))
}
-
+
test("accumulators") {
sc = new SparkContext(clusterUrl, "test")
val accum = sc.accumulator(0)