@Test public void testIgnoreWholeRoJournal() throws IOException { SplitJournalFile splitJournalFile = new SplitJournalFile(roFile, rwFile, Optional.empty()); try (JournalFileReader reader = splitJournalFile.openJournalReader()) { assertEquals("line 6", reader.readLine()); assertEquals("line 5", reader.readLine()); assertEquals("line 4", reader.readLine()); assertNull(reader.readLine()); assertNull(reader.readLine()); } }
@Override public JournalFileReader openJournalReader() throws IOException { return new SplitJournalFileReader(roJournalFile.openJournalReader(), rwJournalFile.openJournalReader(), lastRoJournalEntry); }
SplitJournalFile implements JournalFile { @Override public JournalFileReader openJournalReader() throws IOException { return new SplitJournalFileReader(roJournalFile.openJournalReader(), rwJournalFile.openJournalReader(), lastRoJournalEntry); } }
SplitJournalFile implements JournalFile { @Override public JournalFileReader openJournalReader() throws IOException { return new SplitJournalFileReader(roJournalFile.openJournalReader(), rwJournalFile.openJournalReader(), lastRoJournalEntry); } SplitJournalFile(JournalFile roJournalFile, JournalFile rwJournalFile, Optional<String> lastRoJournalEntry); }
SplitJournalFile implements JournalFile { @Override public JournalFileReader openJournalReader() throws IOException { return new SplitJournalFileReader(roJournalFile.openJournalReader(), rwJournalFile.openJournalReader(), lastRoJournalEntry); } SplitJournalFile(JournalFile roJournalFile, JournalFile rwJournalFile, Optional<String> lastRoJournalEntry); @Override JournalFileReader openJournalReader(); @Override JournalFileWriter openJournalWriter(); @Override String getName(); @Override boolean exists(); }
SplitJournalFile implements JournalFile { @Override public JournalFileReader openJournalReader() throws IOException { return new SplitJournalFileReader(roJournalFile.openJournalReader(), rwJournalFile.openJournalReader(), lastRoJournalEntry); } SplitJournalFile(JournalFile roJournalFile, JournalFile rwJournalFile, Optional<String> lastRoJournalEntry); @Override JournalFileReader openJournalReader(); @Override JournalFileWriter openJournalWriter(); @Override String getName(); @Override boolean exists();  }