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();
}
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();
}
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();
}
Aggregations