aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/scala/org/apache
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/scala/org/apache')
-rw-r--r--core/src/test/scala/org/apache/spark/broadcast/BroadcastSuite.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/src/test/scala/org/apache/spark/broadcast/BroadcastSuite.scala b/core/src/test/scala/org/apache/spark/broadcast/BroadcastSuite.scala
index f97cfbba32..6657104823 100644
--- a/core/src/test/scala/org/apache/spark/broadcast/BroadcastSuite.scala
+++ b/core/src/test/scala/org/apache/spark/broadcast/BroadcastSuite.scala
@@ -130,6 +130,13 @@ class BroadcastSuite extends SparkFunSuite with LocalSparkContext {
assert(thrown.getMessage.toLowerCase.contains("stopped"))
}
+ test("Forbid broadcasting RDD directly") {
+ sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local"))
+ val rdd = sc.parallelize(1 to 4)
+ intercept[IllegalArgumentException] { sc.broadcast(rdd) }
+ sc.stop()
+ }
+
/**
* Verify the persistence of state associated with an TorrentBroadcast in a local-cluster.
*