Search in sources :

Example 1 with TestTransactionVersionContextSupplier

use of org.neo4j.snapshot.TestTransactionVersionContextSupplier in project neo4j by neo4j.

the class SnapshotQueryExecutionIT method setUp.

@Before
public void setUp() throws Exception {
    testContextSupplier = new TestTransactionVersionContextSupplier();
    var dependencies = new Dependencies();
    dependencies.satisfyDependencies(testContextSupplier);
    testWebContainer = serverOnRandomPorts().withProperty(GraphDatabaseInternalSettings.snapshot_query.name(), TRUE).withDependencies(dependencies).build();
    prepareCursorContext();
    createData(testWebContainer.getDefaultDatabase());
}
Also used : TestTransactionVersionContextSupplier(org.neo4j.snapshot.TestTransactionVersionContextSupplier) Dependencies(org.neo4j.collection.Dependencies) Before(org.junit.Before)

Example 2 with TestTransactionVersionContextSupplier

use of org.neo4j.snapshot.TestTransactionVersionContextSupplier in project neo4j by neo4j.

the class EagerResultIT method setUp.

@BeforeEach
void setUp() {
    storeDir = testDirectory.homePath();
    testContextSupplier = new TestTransactionVersionContextSupplier();
    database = startRestartableDatabase();
    prepareData();
    TransactionIdStore transactionIdStore = getTransactionIdStore();
    testContextSupplier.setTestVersionContextSupplier(() -> {
        var context = new TestVersionContext(transactionIdStore::getLastClosedTransactionId);
        context.setWrongLastClosedTxId(false);
        return context;
    });
}
Also used : TransactionIdStore(org.neo4j.storageengine.api.TransactionIdStore) TestTransactionVersionContextSupplier(org.neo4j.snapshot.TestTransactionVersionContextSupplier) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with TestTransactionVersionContextSupplier

use of org.neo4j.snapshot.TestTransactionVersionContextSupplier in project neo4j by neo4j.

the class QueryRestartIT method setUp.

@BeforeEach
void setUp() throws IOException {
    storeDir = testDirectory.homePath();
    testContextSupplier = new TestTransactionVersionContextSupplier();
    database = startSnapshotQueryDb();
    createData();
    // Checkpoint to make the counts store flush its changes map so that it will need to read on next query
    checkpoint();
    testContextSupplier.setTestVersionContextSupplier(() -> testCursorContext(managementService, DEFAULT_DATABASE_NAME));
}
Also used : TestTransactionVersionContextSupplier(org.neo4j.snapshot.TestTransactionVersionContextSupplier) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

TestTransactionVersionContextSupplier (org.neo4j.snapshot.TestTransactionVersionContextSupplier)3 BeforeEach (org.junit.jupiter.api.BeforeEach)2 Before (org.junit.Before)1 Dependencies (org.neo4j.collection.Dependencies)1 TransactionIdStore (org.neo4j.storageengine.api.TransactionIdStore)1