@Test public void testIgnoreNewRoLines() throws IOException { SplitJournalFile splitJournalFile = new SplitJournalFile(roFile, rwFile, Optional.of("line 3")); try (JournalFileReader reader = splitJournalFile.openJournalReader()) { for (int i = 6; i >= 1; i--) { assertEquals("line " + i, 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();  }