use of org.junit.jupiter.params.provider.MethodSource in project neo4j by neo4j.
the class MultipleOpenCursorsTest method multipleIteratorsNestedInnerNewExact.
@ParameterizedTest
@MethodSource(value = "params")
void multipleIteratorsNestedInnerNewExact(IndexCoordinator indexCoordinator) throws Exception {
indexCoordinator.init(db);
try (Transaction tx = db.beginTx()) {
// when
KernelTransaction ktx = ((InternalTransaction) tx).kernelTransaction();
try (NodeValueIndexCursor cursor1 = indexCoordinator.queryExact(ktx)) {
List<Long> actual1 = new ArrayList<>();
while (cursor1.next()) {
actual1.add(cursor1.nodeReference());
try (NodeValueIndexCursor cursor2 = indexCoordinator.queryExact(ktx)) {
List<Long> actual2 = asList(cursor2);
indexCoordinator.assertExactResult(actual2);
}
}
// then
indexCoordinator.assertExactResult(actual1);
}
tx.commit();
}
}
use of org.junit.jupiter.params.provider.MethodSource in project neo4j by neo4j.
the class MultipleOpenCursorsTest method multipleIteratorsNestedInnerNewRange.
@ParameterizedTest
@MethodSource(value = "params")
void multipleIteratorsNestedInnerNewRange(IndexCoordinator indexCoordinator) throws Exception {
assumeTrue(indexCoordinator.supportRangeQuery());
indexCoordinator.init(db);
try (Transaction tx = db.beginTx()) {
// when
KernelTransaction ktx = ((InternalTransaction) tx).kernelTransaction();
try (NodeValueIndexCursor cursor1 = indexCoordinator.queryRange(ktx)) {
List<Long> actual1 = new ArrayList<>();
while (cursor1.next()) {
actual1.add(cursor1.nodeReference());
try (NodeValueIndexCursor cursor2 = indexCoordinator.queryRange(ktx)) {
List<Long> actual2 = asList(cursor2);
indexCoordinator.assertRangeResult(actual2);
}
}
// then
indexCoordinator.assertRangeResult(actual1);
}
tx.commit();
}
}
use of org.junit.jupiter.params.provider.MethodSource in project neo4j by neo4j.
the class MultipleOpenCursorsTest method multipleCursorsNotNestedExists.
@ParameterizedTest
@MethodSource(value = "params")
void multipleCursorsNotNestedExists(IndexCoordinator indexCoordinator) throws Exception {
indexCoordinator.init(db);
try (Transaction tx = db.beginTx()) {
KernelTransaction ktx = ((InternalTransaction) tx).kernelTransaction();
// when
try (NodeValueIndexCursor cursor1 = indexCoordinator.queryExists(ktx);
NodeValueIndexCursor cursor2 = indexCoordinator.queryExists(ktx)) {
List<Long> actual1 = asList(cursor1);
List<Long> actual2 = asList(cursor2);
// then
indexCoordinator.assertExistsResult(actual1);
indexCoordinator.assertExistsResult(actual2);
}
tx.commit();
}
}
use of org.junit.jupiter.params.provider.MethodSource in project neo4j by neo4j.
the class MultipleOpenCursorsTest method multipleCursorsNotNestedExact.
@ParameterizedTest
@MethodSource(value = "params")
void multipleCursorsNotNestedExact(IndexCoordinator indexCoordinator) throws Exception {
indexCoordinator.init(db);
try (Transaction tx = db.beginTx()) {
// when
KernelTransaction ktx = ((InternalTransaction) tx).kernelTransaction();
try (NodeValueIndexCursor cursor1 = indexCoordinator.queryExact(ktx);
NodeValueIndexCursor cursor2 = indexCoordinator.queryExact(ktx)) {
List<Long> actual1 = asList(cursor1);
List<Long> actual2 = asList(cursor2);
// then
indexCoordinator.assertExactResult(actual1);
indexCoordinator.assertExactResult(actual2);
}
tx.commit();
}
}
use of org.junit.jupiter.params.provider.MethodSource in project neo4j by neo4j.
the class IndexTxStateLookupTest method lookupWithinTransactionWithCacheEviction.
@ParameterizedTest(name = "store=<{0}> lookup=<{1}>")
@MethodSource("argumentsProvider")
public void lookupWithinTransactionWithCacheEviction(Object store, Object lookup) {
init(store, lookup);
try (Transaction tx = db.beginTx()) {
// when
tx.createNode(label("Node")).setProperty("prop", this.store);
// then
assertEquals(1, count(tx.findNodes(label("Node"), "prop", this.lookup)));
// no need to actually commit this node
}
}
Aggregations