Skip to content
Snippets Groups Projects
Commit d15db108 authored by Ankur Dave's avatar Ankur Dave
Browse files

Add a unit test for Graph.mapEdges

parent d429f015
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,19 @@ class GraphSuite extends FunSuite with LocalSparkContext {
}
}
test("mapEdges") {
withSpark(new SparkContext("local", "test")) { sc =>
val n = 3
val star = Graph(sc.parallelize((1 to n).map(x => (0: Vid, x: Vid))))
val starWithEdgeAttrs = star.mapEdges(e => e.dstId)
// map(_.copy()) is a workaround for https://github.com/amplab/graphx/issues/25
val edges = starWithEdgeAttrs.edges.map(_.copy()).collect()
assert(edges.size === n)
assert(edges.toSet === (1 to n).map(x => Edge(0, x, x)).toSet)
}
}
test("aggregateNeighbors") {
withSpark(new SparkContext("local", "test")) { sc =>
val n = 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment