@Test public void notifiesTheNavigatorOnceForEveryEntryWritten() throws Exception { context.checking(new Expectations() {{ ignoring(codec); ignoring(persistence); exactly(5).of(navigator).notifyLogging(with(any(Long.class)), with(any(Long.class))); }}); log.append(nConsecutiveEntries(5)); }
@Override public void append(List<E> entries) throws IOException { for (E entry : entries) { persistenceNavigator.notifyLogging(entry.getSeqNum(), persistence.size()); persistence.append(codec.encode(entry)); } }
EncodedSequentialLog implements SequentialLog<E> { @Override public void append(List<E> entries) throws IOException { for (E entry : entries) { persistenceNavigator.notifyLogging(entry.getSeqNum(), persistence.size()); persistence.append(codec.encode(entry)); } } }
EncodedSequentialLog implements SequentialLog<E> { @Override public void append(List<E> entries) throws IOException { for (E entry : entries) { persistenceNavigator.notifyLogging(entry.getSeqNum(), persistence.size()); persistence.append(codec.encode(entry)); } } EncodedSequentialLog(BytePersistence persistence,
                              SequentialEntryCodec<E> codec,
                              PersistenceNavigator persistenceNavigator); }
EncodedSequentialLog implements SequentialLog<E> { @Override public void append(List<E> entries) throws IOException { for (E entry : entries) { persistenceNavigator.notifyLogging(entry.getSeqNum(), persistence.size()); persistence.append(codec.encode(entry)); } } EncodedSequentialLog(BytePersistence persistence,
                              SequentialEntryCodec<E> codec,
                              PersistenceNavigator persistenceNavigator); @Override void append(List<E> entries); @Override List<E> subSequence(long start, long end); @Override boolean isEmpty(); @Override E getLastEntry(); @Override SequentialEntryIterator<E> iterator(); @Override void truncate(long seqNum); @Override void sync(); @Override void close(); }
EncodedSequentialLog implements SequentialLog<E> { @Override public void append(List<E> entries) throws IOException { for (E entry : entries) { persistenceNavigator.notifyLogging(entry.getSeqNum(), persistence.size()); persistence.append(codec.encode(entry)); } } EncodedSequentialLog(BytePersistence persistence,
                              SequentialEntryCodec<E> codec,
                              PersistenceNavigator persistenceNavigator); @Override void append(List<E> entries); @Override List<E> subSequence(long start, long end); @Override boolean isEmpty(); @Override E getLastEntry(); @Override SequentialEntryIterator<E> iterator(); @Override void truncate(long seqNum); @Override void sync(); @Override void close();  }