Search in sources :

Example 6 with StatementLocks

use of org.neo4j.kernel.impl.locking.StatementLocks in project neo4j by neo4j.

the class StatementLocksFactorySelectorTest method loadSimpleStatementLocksFactoryWhenNoServices.

@Test
public void loadSimpleStatementLocksFactoryWhenNoServices() {
    Locks locks = mock(Locks.class);
    Locks.Client locksClient = mock(Client.class);
    when(locks.newClient()).thenReturn(locksClient);
    StatementLocksFactorySelector loader = newLoader(locks);
    StatementLocksFactory factory = loader.select();
    StatementLocks statementLocks = factory.newInstance();
    assertThat(factory, instanceOf(SimpleStatementLocksFactory.class));
    assertThat(statementLocks, instanceOf(SimpleStatementLocks.class));
    assertSame(locksClient, statementLocks.optimistic());
    assertSame(locksClient, statementLocks.pessimistic());
}
Also used : SimpleStatementLocksFactory(org.neo4j.kernel.impl.locking.SimpleStatementLocksFactory) Client(org.neo4j.kernel.impl.locking.Locks.Client) SimpleStatementLocksFactory(org.neo4j.kernel.impl.locking.SimpleStatementLocksFactory) StatementLocksFactory(org.neo4j.kernel.impl.locking.StatementLocksFactory) SimpleStatementLocks(org.neo4j.kernel.impl.locking.SimpleStatementLocks) StatementLocks(org.neo4j.kernel.impl.locking.StatementLocks) SimpleStatementLocks(org.neo4j.kernel.impl.locking.SimpleStatementLocks) StatementLocks(org.neo4j.kernel.impl.locking.StatementLocks) Locks(org.neo4j.kernel.impl.locking.Locks) SimpleStatementLocks(org.neo4j.kernel.impl.locking.SimpleStatementLocks) Test(org.junit.Test)

Aggregations

StatementLocks (org.neo4j.kernel.impl.locking.StatementLocks)6 SimpleStatementLocks (org.neo4j.kernel.impl.locking.SimpleStatementLocks)3 KernelTransactionImplementation (org.neo4j.kernel.impl.api.KernelTransactionImplementation)2 CanWrite (org.neo4j.kernel.impl.factory.CanWrite)2 Locks (org.neo4j.kernel.impl.locking.Locks)2 StatementLocksFactory (org.neo4j.kernel.impl.locking.StatementLocksFactory)2 Supplier (java.util.function.Supplier)1 Test (org.junit.Test)1 Pool (org.neo4j.collection.pool.Pool)1 TransactionFailureException (org.neo4j.graphdb.TransactionFailureException)1 PageCursorTracerSupplier (org.neo4j.io.pagecache.tracing.cursor.PageCursorTracerSupplier)1 AvailabilityGuard (org.neo4j.kernel.AvailabilityGuard)1 NeoStoreDataSource (org.neo4j.kernel.NeoStoreDataSource)1 SecurityContext (org.neo4j.kernel.api.security.SecurityContext)1 SchemaWriteGuard (org.neo4j.kernel.impl.api.SchemaWriteGuard)1 StatementOperationContainer (org.neo4j.kernel.impl.api.StatementOperationContainer)1 TransactionHeaderInformation (org.neo4j.kernel.impl.api.TransactionHeaderInformation)1 TransactionHooks (org.neo4j.kernel.impl.api.TransactionHooks)1 TransactionRepresentationCommitProcess (org.neo4j.kernel.impl.api.TransactionRepresentationCommitProcess)1 LabelScanStoreProvider (org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider)1