sshmendez commented on code in PR #3705:
URL: https://github.com/apache/tinkerpop/pull/3705#discussion_r4280057069
##########
tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerTransactionGraphTest.java:
##########
@@ -1868,6 +1869,32 @@ private void verifyCommittedSingleEdge(final
TinkerTransactionGraph g, final Obj
}
}
+ @Test
+ public void shouldFindIndexedVertexAfterAddingEdgeToItInSameTransaction() {
Review Comment:
Added in f4c0b69:
`shouldFindIndexedEdgeAfterChangingAnotherPropertyInSameTransaction`
(https://github.com/sshmendez/tinkerpop/blob/f4c0b69f722789850c78827207ac9f1d6d704029/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerTransactionGraphTest.java#L1898-L1908).
It fails without the fix, so the edge index had the same bug.
##########
tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerTransactionGraphTest.java:
##########
@@ -1868,6 +1869,32 @@ private void verifyCommittedSingleEdge(final
TinkerTransactionGraph g, final Obj
}
}
+ @Test
+ public void shouldFindIndexedVertexAfterAddingEdgeToItInSameTransaction() {
+ final TinkerTransactionGraph g = TinkerTransactionGraph.open();
+ g.createIndex(PROPERTY_NAME, Vertex.class);
+ final GraphTraversalSource gtx = g.tx().begin();
+ gtx.addV().property(PROPERTY_NAME, "hub").iterate();
+ gtx.tx().commit();
+
+ gtx.addV().addE(EDGE_LABEL).to(__.V().has(PROPERTY_NAME,
"hub")).iterate();
+
+ assertEquals(1, (long) gtx.V().has(PROPERTY_NAME,
"hub").count().next());
+ }
+
+ @Test
+ public void shouldRollbackWithVertexIndexAndNoEdgeIndex() {
Review Comment:
Added in f4c0b69: `shouldRollbackWithEdgeIndexAndNoVertexIndex`
(https://github.com/sshmendez/tinkerpop/blob/f4c0b69f722789850c78827207ac9f1d6d704029/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerTransactionGraphTest.java#L1911-L1922).
It adds an indexed edge, rolls back, and checks that the indexed lookup
returns nothing. It fails without the fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]