use of org.neo4j.kernel.impl.coreapi.InternalTransaction in project neo4j by neo4j.
the class MultipleOpenCursorsTest method multipleIteratorsNestedInterleavedRange.
@ParameterizedTest
@MethodSource(value = "params")
void multipleIteratorsNestedInterleavedRange(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);
NodeValueIndexCursor cursor2 = indexCoordinator.queryRange(ktx)) {
List<Long> actual1 = new ArrayList<>();
List<Long> actual2 = new ArrayList<>();
// Interleave
exhaustInterleaved(cursor1, actual1, cursor2, actual2);
// then
indexCoordinator.assertRangeResult(actual1);
indexCoordinator.assertRangeResult(actual2);
}
tx.commit();
}
}
use of org.neo4j.kernel.impl.coreapi.InternalTransaction 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.neo4j.kernel.impl.coreapi.InternalTransaction 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.neo4j.kernel.impl.coreapi.InternalTransaction 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.neo4j.kernel.impl.coreapi.InternalTransaction 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();
}
}
Aggregations