Search in sources :

Example 1 with Step

use of org.neo4j.unsafe.impl.batchimport.staging.Step in project neo4j by neo4j.

the class PropertyEncoderStepTest method shouldGrowPropertyBlocksArrayProperly.

@SuppressWarnings("unchecked")
@Test
public void shouldGrowPropertyBlocksArrayProperly() throws Exception {
    // GIVEN
    StageControl control = mock(StageControl.class);
    BatchingPropertyKeyTokenRepository tokens = new BatchingPropertyKeyTokenRepository(neoStores.getPropertyKeyTokenStore());
    Step<Batch<InputNode, NodeRecord>> step = new PropertyEncoderStep<>(control, DEFAULT, tokens, neoStores.getPropertyStore());
    @SuppressWarnings("rawtypes") Step downstream = mock(Step.class);
    step.setDownstream(downstream);
    // WHEN
    step.start(0);
    step.receive(0, smallbatch());
    step.endOfUpstream();
    awaitCompleted(step, control);
    // THEN
    verify(downstream).receive(anyLong(), any());
    verifyNoMoreInteractions(control);
    step.close();
}
Also used : StageControl(org.neo4j.unsafe.impl.batchimport.staging.StageControl) BatchingPropertyKeyTokenRepository(org.neo4j.unsafe.impl.batchimport.store.BatchingTokenRepository.BatchingPropertyKeyTokenRepository) Step(org.neo4j.unsafe.impl.batchimport.staging.Step) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 StageControl (org.neo4j.unsafe.impl.batchimport.staging.StageControl)1 Step (org.neo4j.unsafe.impl.batchimport.staging.Step)1 BatchingPropertyKeyTokenRepository (org.neo4j.unsafe.impl.batchimport.store.BatchingTokenRepository.BatchingPropertyKeyTokenRepository)1