Search in sources :

Example 1 with DirectRecordAccessSet

use of org.neo4j.unsafe.batchinsert.DirectRecordAccessSet in project neo4j by neo4j.

the class BatchedFlushStrategyTest method testResetBatchCounterOnForce.

@Test
public void testResetBatchCounterOnForce() {
    DirectRecordAccessSet recordAccessSet = Mockito.mock(DirectRecordAccessSet.class);
    BatchInserterImpl.BatchedFlushStrategy flushStrategy = createFlushStrategy(recordAccessSet, 3);
    flushStrategy.flush();
    flushStrategy.flush();
    Mockito.verifyZeroInteractions(recordAccessSet);
    flushStrategy.forceFlush();
    Mockito.verify(recordAccessSet).commit();
    Mockito.verifyNoMoreInteractions(recordAccessSet);
    flushStrategy.flush();
    flushStrategy.flush();
}
Also used : DirectRecordAccessSet(org.neo4j.unsafe.batchinsert.DirectRecordAccessSet) Test(org.junit.Test)

Example 2 with DirectRecordAccessSet

use of org.neo4j.unsafe.batchinsert.DirectRecordAccessSet in project neo4j by neo4j.

the class BatchedFlushStrategyTest method testFlush.

@Test
public void testFlush() throws Exception {
    DirectRecordAccessSet recordAccessSet = Mockito.mock(DirectRecordAccessSet.class);
    BatchInserterImpl.BatchedFlushStrategy flushStrategy = createFlushStrategy(recordAccessSet, 2);
    flushStrategy.flush();
    Mockito.verifyZeroInteractions(recordAccessSet);
    flushStrategy.flush();
    Mockito.verify(recordAccessSet).commit();
    Mockito.reset(recordAccessSet);
    flushStrategy.flush();
    flushStrategy.flush();
    flushStrategy.flush();
    flushStrategy.flush();
    flushStrategy.flush();
    flushStrategy.flush();
    flushStrategy.flush();
    Mockito.verify(recordAccessSet, Mockito.times(3)).commit();
}
Also used : DirectRecordAccessSet(org.neo4j.unsafe.batchinsert.DirectRecordAccessSet) Test(org.junit.Test)

Example 3 with DirectRecordAccessSet

use of org.neo4j.unsafe.batchinsert.DirectRecordAccessSet in project neo4j by neo4j.

the class BatchedFlushStrategyTest method testForceFlush.

@Test
public void testForceFlush() throws Exception {
    DirectRecordAccessSet recordAccessSet = Mockito.mock(DirectRecordAccessSet.class);
    BatchInserterImpl.BatchedFlushStrategy flushStrategy = createFlushStrategy(recordAccessSet, 2);
    flushStrategy.forceFlush();
    flushStrategy.forceFlush();
    Mockito.verify(recordAccessSet, Mockito.times(2)).commit();
    flushStrategy.flush();
    flushStrategy.forceFlush();
    Mockito.verify(recordAccessSet, Mockito.times(3)).commit();
}
Also used : DirectRecordAccessSet(org.neo4j.unsafe.batchinsert.DirectRecordAccessSet) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 DirectRecordAccessSet (org.neo4j.unsafe.batchinsert.DirectRecordAccessSet)3