@Test public void testRemoveEdge() { Develops develops = createElement(); develops.fromId(marko.id()); develops.toId(vadas.id()); edgeGraph.removeEdge(develops); InOrder inOrder = inOrder(g, traversal); inOrder.verify(g, times(1)).V(); inOrder.verify(traversal, times(1)).hasId(marko.id()); inOrder.verify(traversal, times(1)).as("from"); inOrder.verify(traversal, times(1)).outE(develops.label()); inOrder.verify(traversal, times(1)).as("edge"); inOrder.verify(traversal, times(1)).inV(); inOrder.verify(traversal, times(1)).hasId(vadas.id()); inOrder.verify(traversal, times(1)).as("to"); inOrder.verify(traversal, times(2)).select("edge"); inOrder.verify(traversal, times(1)).toList(); }
public <E extends Edge> Edge removeEdge(E edge) { if (edge.fromId() == null || edge.toId() == null) { throw Element.Exceptions.removingDetachedElement(edge); } GraphTraversal traversal = find(edge, edge.fromId(), edge.toId()); log.info("Executing 'remove edge' traversal {}", traversal); traversal.select("edge").drop().toList(); if (edge.id() != null) { delegates.remove(edge); } observers.notifyAll(observer -> observer.edgeRemoved(edge)); return edge; }
EdgeGraph extends ElementGraph { public <E extends Edge> Edge removeEdge(E edge) { if (edge.fromId() == null || edge.toId() == null) { throw Element.Exceptions.removingDetachedElement(edge); } GraphTraversal traversal = find(edge, edge.fromId(), edge.toId()); log.info("Executing 'remove edge' traversal {}", traversal); traversal.select("edge").drop().toList(); if (edge.id() != null) { delegates.remove(edge); } observers.notifyAll(observer -> observer.edgeRemoved(edge)); return edge; } }
EdgeGraph extends ElementGraph { public <E extends Edge> Edge removeEdge(E edge) { if (edge.fromId() == null || edge.toId() == null) { throw Element.Exceptions.removingDetachedElement(edge); } GraphTraversal traversal = find(edge, edge.fromId(), edge.toId()); log.info("Executing 'remove edge' traversal {}", traversal); traversal.select("edge").drop().toList(); if (edge.id() != null) { delegates.remove(edge); } observers.notifyAll(observer -> observer.edgeRemoved(edge)); return edge; } EdgeGraph(Graph graph, Query query, GraphTraversalSource g); }
EdgeGraph extends ElementGraph { public <E extends Edge> Edge removeEdge(E edge) { if (edge.fromId() == null || edge.toId() == null) { throw Element.Exceptions.removingDetachedElement(edge); } GraphTraversal traversal = find(edge, edge.fromId(), edge.toId()); log.info("Executing 'remove edge' traversal {}", traversal); traversal.select("edge").drop().toList(); if (edge.id() != null) { delegates.remove(edge); } observers.notifyAll(observer -> observer.edgeRemoved(edge)); return edge; } EdgeGraph(Graph graph, Query query, GraphTraversalSource g); org.apache.tinkerpop.gremlin.structure.Edge delegate(Edge edge); Edge addEdge(E edge, org.apache.tinkerpop.gremlin.structure.Vertex from,
      AnyTraversal anyTraversal); Edge addEdge(E edge, org.apache.tinkerpop.gremlin.structure.Vertex from,
      SubTraversal... subTraversals); Edge removeEdge(E edge); void reset(); }
EdgeGraph extends ElementGraph { public <E extends Edge> Edge removeEdge(E edge) { if (edge.fromId() == null || edge.toId() == null) { throw Element.Exceptions.removingDetachedElement(edge); } GraphTraversal traversal = find(edge, edge.fromId(), edge.toId()); log.info("Executing 'remove edge' traversal {}", traversal); traversal.select("edge").drop().toList(); if (edge.id() != null) { delegates.remove(edge); } observers.notifyAll(observer -> observer.edgeRemoved(edge)); return edge; } EdgeGraph(Graph graph, Query query, GraphTraversalSource g); org.apache.tinkerpop.gremlin.structure.Edge delegate(Edge edge); Edge addEdge(E edge, org.apache.tinkerpop.gremlin.structure.Vertex from,
      AnyTraversal anyTraversal); Edge addEdge(E edge, org.apache.tinkerpop.gremlin.structure.Vertex from,
      SubTraversal... subTraversals); Edge removeEdge(E edge); void reset();  }