DurablePositionTracker implements PositionTracker { @Override public synchronized long getPosition() { return metaCache.getOffset(); } DurablePositionTracker(File trackerFile, String target); static DurablePositionTracker getInstance(File trackerFile,
      String target); @Override synchronized void storePosition(long position); @Override synchronized long getPosition(); @Override String getTarget(); @Override void close();  }
@Test public void testGoodTrackerFile() throws IOException, URISyntaxException { String fileName = "/TestResettableFileInputStream_1.avro"; File trackerFile = new File(getClass().getResource(fileName).toURI()); Assert.assertTrue(trackerFile.exists()); PositionTracker tracker; tracker = new DurablePositionTracker(trackerFile, "foo"); Assert.assertEquals(62, tracker.getPosition()); }
@Test public void testPartialTrackerFile() throws IOException, URISyntaxException { String fileName = "/TestResettableFileInputStream_1.truncated.avro"; File trackerFile = new File(getClass().getResource(fileName).toURI()); Assert.assertTrue(trackerFile.exists()); PositionTracker tracker; tracker = new DurablePositionTracker(trackerFile, "foo"); Assert.assertEquals(25, tracker.getPosition()); }