use of org.neo4j.internal.id.ScanOnOpenOverwritingIdGeneratorFactory in project neo4j by neo4j.
the class StoreUpgraderTest method verifyStoreUpgradedWithin.
private void verifyStoreUpgradedWithin(long duration, TimeUnit unit) {
StoreFactory factory = new StoreFactory(databaseLayout, allowMigrateConfig, new ScanOnOpenOverwritingIdGeneratorFactory(fileSystem, databaseLayout.getDatabaseName()), pageCache, fileSystem, NullLogProvider.getInstance(), NULL, writable());
try (NeoStores neoStores = factory.openAllNeoStores()) {
assertThat(neoStores.getMetaDataStore().getUpgradeTransaction()).isEqualTo(neoStores.getMetaDataStore().getLastCommittedTransaction());
assertThat(neoStores.getMetaDataStore().getUpgradeTime()).isPositive();
long minuteAgo = System.currentTimeMillis() - unit.toMillis(duration);
assertThat(neoStores.getMetaDataStore().getUpgradeTime()).isGreaterThan(minuteAgo);
}
}
Aggregations