@Test public void empty() throws ConnectionException { final MvccLogEntrySerializationStrategy logEntrySerializationStrategy = mock( MvccLogEntrySerializationStrategy.class ); final ApplicationScope scope = new ApplicationScopeImpl( new SimpleId( "application" )); final Id entityId = new SimpleId( "entity" ); final int pageSize = 100; UUID start = UUIDGenerator.newTimeUUID(); when( logEntrySerializationStrategy.load( same( scope ), same( entityId ), same( start ), same( pageSize ) ) ) .thenReturn( new ArrayList<MvccLogEntry>() ); MinMaxLogEntryIterator itr = new MinMaxLogEntryIterator( logEntrySerializationStrategy, scope, entityId, pageSize ); assertFalse( itr.hasNext() ); }
@Override public boolean hasNext() { if ( elementItr == null || !elementItr.hasNext() && nextStart != null ) { try { advance(); } catch ( ConnectionException e ) { throw new RuntimeException( "Unable to query cassandra", e ); } } return elementItr.hasNext(); }
MinMaxLogEntryIterator implements Iterator<MvccLogEntry> { @Override public boolean hasNext() { if ( elementItr == null || !elementItr.hasNext() && nextStart != null ) { try { advance(); } catch ( ConnectionException e ) { throw new RuntimeException( "Unable to query cassandra", e ); } } return elementItr.hasNext(); } }
MinMaxLogEntryIterator implements Iterator<MvccLogEntry> { @Override public boolean hasNext() { if ( elementItr == null || !elementItr.hasNext() && nextStart != null ) { try { advance(); } catch ( ConnectionException e ) { throw new RuntimeException( "Unable to query cassandra", e ); } } return elementItr.hasNext(); } MinMaxLogEntryIterator( final MvccLogEntrySerializationStrategy logEntrySerializationStrategy,
                                   final ApplicationScope scope, final Id entityId, final int pageSize ); }
MinMaxLogEntryIterator implements Iterator<MvccLogEntry> { @Override public boolean hasNext() { if ( elementItr == null || !elementItr.hasNext() && nextStart != null ) { try { advance(); } catch ( ConnectionException e ) { throw new RuntimeException( "Unable to query cassandra", e ); } } return elementItr.hasNext(); } MinMaxLogEntryIterator( final MvccLogEntrySerializationStrategy logEntrySerializationStrategy,
                                   final ApplicationScope scope, final Id entityId, final int pageSize ); @Override boolean hasNext(); @Override MvccLogEntry next(); @Override void remove(); void advance(); }
MinMaxLogEntryIterator implements Iterator<MvccLogEntry> { @Override public boolean hasNext() { if ( elementItr == null || !elementItr.hasNext() && nextStart != null ) { try { advance(); } catch ( ConnectionException e ) { throw new RuntimeException( "Unable to query cassandra", e ); } } return elementItr.hasNext(); } MinMaxLogEntryIterator( final MvccLogEntrySerializationStrategy logEntrySerializationStrategy,
                                   final ApplicationScope scope, final Id entityId, final int pageSize ); @Override boolean hasNext(); @Override MvccLogEntry next(); @Override void remove(); void advance();  }