use of com.baidu.hugegraph.testutil.FakeObjects.FakeEdge in project incubator-hugegraph by apache.
the class EdgeCoreTest method testRemoveEdge.
@Test
public void testRemoveEdge() {
HugeGraph graph = graph();
Vertex james = graph.addVertex(T.label, "author", "id", 1, "name", "James Gosling", "age", 62, "lived", "Canadian");
Vertex java = graph.addVertex(T.label, "language", "name", "java");
Vertex java1 = graph.addVertex(T.label, "book", "name", "java-1");
Vertex java2 = graph.addVertex(T.label, "book", "name", "java-2");
Vertex java3 = graph.addVertex(T.label, "book", "name", "java-3");
james.addEdge("created", java);
Edge authored1 = james.addEdge("authored", java1);
james.addEdge("authored", java2);
james.addEdge("authored", java3);
List<Edge> edges = graph.traversal().E().toList();
Assert.assertEquals(4, edges.size());
authored1.remove();
edges = graph.traversal().E().toList();
Assert.assertEquals(3, edges.size());
Assert.assertFalse(Utils.contains(edges, new FakeEdge("authored", james, java1)));
}
Aggregations