@Test
public void testCheckVersion() throws IOException {

  RollingLevelDBTimelineStore dbStore = (RollingLevelDBTimelineStore) store;
  // default version
  Version defaultVersion = dbStore.getCurrentVersion();
  Assert.assertEquals(defaultVersion, dbStore.loadVersion());
  // compatible version
  Version compatibleVersion =
      Version.newInstance(defaultVersion.getMajorVersion(),
        defaultVersion.getMinorVersion() + 2);
  dbStore.storeVersion(compatibleVersion);
  Assert.assertEquals(compatibleVersion, dbStore.loadVersion());
  restartTimelineStore();
  dbStore = (RollingLevelDBTimelineStore) store;
  // overwrite the compatible version
  Assert.assertEquals(defaultVersion, dbStore.loadVersion());
  // incompatible version
  Version incompatibleVersion =
      Version.newInstance(defaultVersion.getMajorVersion() + 1,
        defaultVersion.getMinorVersion());
  dbStore.storeVersion(incompatibleVersion);
  try {
    restartTimelineStore();
    Assert.fail("Incompatible version, should expect fail here.");
  } catch (ServiceStateException e) {
    Assert.assertTrue("Exception message mismatch",
        e.getMessage().contains("Incompatible version for timeline store"));
  }
}