Search in sources :

Example 1 with InternalAutoIndexing

use of org.neo4j.kernel.impl.api.legacyindex.InternalAutoIndexing in project neo4j by neo4j.

the class IndexQueryTransactionStateTest method before.

@Before
public void before() throws Exception {
    TransactionState txState = new TxState();
    state = StatementOperationsTestHelper.mockedState(txState);
    store = mock(StoreReadLayer.class);
    when(store.indexGetState(newIndexDescriptor)).thenReturn(InternalIndexState.ONLINE);
    when(store.indexesGetForLabel(labelId)).then(answerAsIteratorFrom(indexes));
    when(store.indexesGetAll()).then(answerAsIteratorFrom(indexes));
    when(store.constraintsGetForLabel(labelId)).thenReturn(Collections.emptyIterator());
    when(store.indexGetForLabelAndPropertyKey(newIndexDescriptor.schema())).thenReturn(newIndexDescriptor);
    statement = mock(StoreStatement.class);
    when(state.getStoreStatement()).thenReturn(statement);
    indexReader = mock(IndexReader.class);
    when(statement.getIndexReader(newIndexDescriptor)).thenReturn(indexReader);
    when(statement.getFreshIndexReader(newIndexDescriptor)).thenReturn(indexReader);
    StateHandlingStatementOperations stateHandlingOperations = new StateHandlingStatementOperations(store, new InternalAutoIndexing(Config.empty(), null), mock(ConstraintIndexCreator.class), mock(LegacyIndexStore.class));
    txContext = new ConstraintEnforcingEntityOperations(new StandardConstraintSemantics(), stateHandlingOperations, stateHandlingOperations, stateHandlingOperations, stateHandlingOperations);
}
Also used : TransactionState(org.neo4j.kernel.api.txstate.TransactionState) StoreReadLayer(org.neo4j.storageengine.api.StoreReadLayer) LegacyIndexStore(org.neo4j.kernel.impl.index.LegacyIndexStore) StoreStatement(org.neo4j.kernel.impl.api.store.StoreStatement) InternalAutoIndexing(org.neo4j.kernel.impl.api.legacyindex.InternalAutoIndexing) IndexReader(org.neo4j.storageengine.api.schema.IndexReader) StateHandlingStatementOperations(org.neo4j.kernel.impl.api.StateHandlingStatementOperations) ConstraintEnforcingEntityOperations(org.neo4j.kernel.impl.api.ConstraintEnforcingEntityOperations) StandardConstraintSemantics(org.neo4j.kernel.impl.constraints.StandardConstraintSemantics) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 TransactionState (org.neo4j.kernel.api.txstate.TransactionState)1 ConstraintEnforcingEntityOperations (org.neo4j.kernel.impl.api.ConstraintEnforcingEntityOperations)1 StateHandlingStatementOperations (org.neo4j.kernel.impl.api.StateHandlingStatementOperations)1 InternalAutoIndexing (org.neo4j.kernel.impl.api.legacyindex.InternalAutoIndexing)1 StoreStatement (org.neo4j.kernel.impl.api.store.StoreStatement)1 StandardConstraintSemantics (org.neo4j.kernel.impl.constraints.StandardConstraintSemantics)1 LegacyIndexStore (org.neo4j.kernel.impl.index.LegacyIndexStore)1 StoreReadLayer (org.neo4j.storageengine.api.StoreReadLayer)1 IndexReader (org.neo4j.storageengine.api.schema.IndexReader)1