use of org.neo4j.kernel.ha.transaction.OnDiskLastTxIdGetter in project neo4j by neo4j.
the class OnDiskLastTxIdGetterTest method lastTransactionIdIsBaseTxIdWhileNeoStoresAreStopped.
@Test
public void lastTransactionIdIsBaseTxIdWhileNeoStoresAreStopped() {
final StoreFactory storeFactory = new StoreFactory(new File("store"), pageCacheRule.getPageCache(fs.get()), fs.get(), NullLogProvider.getInstance());
final NeoStores neoStores = storeFactory.openAllNeoStores(true);
neoStores.close();
LongSupplier supplier = () -> neoStores.getMetaDataStore().getLastCommittedTransactionId();
OnDiskLastTxIdGetter diskLastTxIdGetter = new OnDiskLastTxIdGetter(supplier);
assertEquals(TransactionIdStore.BASE_TX_ID, diskLastTxIdGetter.getLastTxId());
}
use of org.neo4j.kernel.ha.transaction.OnDiskLastTxIdGetter in project neo4j by neo4j.
the class OnDiskLastTxIdGetterTest method testGetLastTxIdNoFilePresent.
@Test
public void testGetLastTxIdNoFilePresent() throws Exception {
// This is a sign that we have some bad coupling on our hands.
// We currently have to do this because of our lifecycle and construction ordering.
OnDiskLastTxIdGetter getter = new OnDiskLastTxIdGetter(() -> 13L);
assertEquals(13L, getter.getLastTxId());
}
Aggregations