aboutsummaryrefslogtreecommitdiff
path: root/graphx
diff options
context:
space:
mode:
authorWilliam Benton <willb@redhat.com>2014-04-15 10:38:42 -0700
committerReynold Xin <rxin@apache.org>2014-04-15 10:38:42 -0700
commit2580a3b1a06188fa97d9440d793c8835ef7384b0 (patch)
treed2b45665ad83c10a9fd91e22c84eb8823a336b94 /graphx
parentdf360917990ad95dde3c8e016ec42507d1566355 (diff)
downloadspark-2580a3b1a06188fa97d9440d793c8835ef7384b0.tar.gz
spark-2580a3b1a06188fa97d9440d793c8835ef7384b0.tar.bz2
spark-2580a3b1a06188fa97d9440d793c8835ef7384b0.zip
SPARK-1501: Ensure assertions in Graph.apply are asserted.
The Graph.apply test in GraphSuite had some assertions in a closure in a graph transformation. As a consequence, these assertions never actually executed. Furthermore, these closures had a reference to (non-serializable) test harness classes because they called assert(), which could be a problem if we proactively check closure serializability in the future. This commit simply changes the Graph.apply test to collect the graph triplets so it can assert about each triplet from a map method. Author: William Benton <willb@redhat.com> Closes #415 from willb/graphsuite-nop-fix and squashes the following commits: 0b63658 [William Benton] Ensure assertions in Graph.apply are asserted.
Diffstat (limited to 'graphx')
-rw-r--r--graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala b/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala
index 28d34dd9a1..c65e36636f 100644
--- a/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala
+++ b/graphx/src/test/scala/org/apache/spark/graphx/GraphSuite.scala
@@ -62,7 +62,7 @@ class GraphSuite extends FunSuite with LocalSparkContext {
assert( graph.edges.count() === rawEdges.size )
// Vertices not explicitly provided but referenced by edges should be created automatically
assert( graph.vertices.count() === 100)
- graph.triplets.map { et =>
+ graph.triplets.collect.map { et =>
assert((et.srcId < 10 && et.srcAttr) || (et.srcId >= 10 && !et.srcAttr))
assert((et.dstId < 10 && et.dstAttr) || (et.dstId >= 10 && !et.dstAttr))
}