Search in sources :

Example 16 with Procedures

use of org.neo4j.kernel.impl.proc.Procedures in project neo4j by neo4j.

the class KernelTransactionFactory method kernelTransactionWithInternals.

static Instances kernelTransactionWithInternals(SecurityContext securityContext) {
    TransactionHeaderInformation headerInformation = new TransactionHeaderInformation(-1, -1, new byte[0]);
    TransactionHeaderInformationFactory headerInformationFactory = mock(TransactionHeaderInformationFactory.class);
    when(headerInformationFactory.create()).thenReturn(headerInformation);
    StorageEngine storageEngine = mock(StorageEngine.class);
    StoreReadLayer storeReadLayer = mock(StoreReadLayer.class);
    StorageStatement storageStatement = mock(StorageStatement.class);
    when(storeReadLayer.newStatement()).thenReturn(storageStatement);
    when(storageEngine.storeReadLayer()).thenReturn(storeReadLayer);
    KernelTransactionImplementation transaction = new KernelTransactionImplementation(mock(StatementOperationContainer.class), mock(SchemaWriteGuard.class), new TransactionHooks(), mock(ConstraintIndexCreator.class), new Procedures(), headerInformationFactory, mock(TransactionRepresentationCommitProcess.class), mock(TransactionMonitor.class), mock(Supplier.class), mock(Pool.class), Clocks.systemClock(), NULL, LockTracer.NONE, PageCursorTracerSupplier.NULL, storageEngine, new CanWrite());
    StatementLocks statementLocks = new SimpleStatementLocks(new NoOpClient());
    transaction.initialize(0, 0, statementLocks, KernelTransaction.Type.implicit, securityContext, 0L);
    return new Instances(transaction, storageEngine, storeReadLayer, storageStatement);
}
Also used : StorageStatement(org.neo4j.storageengine.api.StorageStatement) TransactionHeaderInformation(org.neo4j.kernel.impl.api.TransactionHeaderInformation) StoreReadLayer(org.neo4j.storageengine.api.StoreReadLayer) TransactionHooks(org.neo4j.kernel.impl.api.TransactionHooks) Procedures(org.neo4j.kernel.impl.proc.Procedures) TransactionHeaderInformationFactory(org.neo4j.kernel.impl.transaction.TransactionHeaderInformationFactory) StorageEngine(org.neo4j.storageengine.api.StorageEngine) StatementOperationContainer(org.neo4j.kernel.impl.api.StatementOperationContainer) CanWrite(org.neo4j.kernel.impl.factory.CanWrite) ConstraintIndexCreator(org.neo4j.kernel.impl.api.state.ConstraintIndexCreator) SchemaWriteGuard(org.neo4j.kernel.impl.api.SchemaWriteGuard) NoOpClient(org.neo4j.kernel.impl.locking.NoOpClient) KernelTransactionImplementation(org.neo4j.kernel.impl.api.KernelTransactionImplementation) TransactionRepresentationCommitProcess(org.neo4j.kernel.impl.api.TransactionRepresentationCommitProcess) SimpleStatementLocks(org.neo4j.kernel.impl.locking.SimpleStatementLocks) StatementLocks(org.neo4j.kernel.impl.locking.StatementLocks) PageCursorTracerSupplier(org.neo4j.io.pagecache.tracing.cursor.PageCursorTracerSupplier) Supplier(java.util.function.Supplier) Pool(org.neo4j.collection.pool.Pool) SimpleStatementLocks(org.neo4j.kernel.impl.locking.SimpleStatementLocks) TransactionMonitor(org.neo4j.kernel.impl.transaction.TransactionMonitor)

Aggregations

Procedures (org.neo4j.kernel.impl.proc.Procedures)16 Test (org.junit.Test)9 QualifiedName (org.neo4j.kernel.api.proc.QualifiedName)5 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)3 ProcedureSignature (org.neo4j.kernel.api.proc.ProcedureSignature)3 Config (org.neo4j.kernel.configuration.Config)3 CanWrite (org.neo4j.kernel.impl.factory.CanWrite)3 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)2 Result (org.neo4j.graphdb.Result)2 KernelException (org.neo4j.kernel.api.exceptions.KernelException)2 UserFunctionSignature (org.neo4j.kernel.api.proc.UserFunctionSignature)2 SchemaWriteGuard (org.neo4j.kernel.impl.api.SchemaWriteGuard)2 JobScheduler (org.neo4j.kernel.impl.util.JobScheduler)2 LifeSupport (org.neo4j.kernel.lifecycle.LifeSupport)2 LogProvider (org.neo4j.logging.LogProvider)2 StorageStatement (org.neo4j.storageengine.api.StorageStatement)2 File (java.io.File)1 Supplier (java.util.function.Supplier)1 Before (org.junit.Before)1 Pool (org.neo4j.collection.pool.Pool)1