@Override public void close() throws IOException { nativeStores.close(); labelScanStore.shutdown(); } }
@After public void tearDownStoreAccess() { store.close(); }
@Test public void openingThroughStoreAccessShouldNotTriggerRecovery() throws Throwable { try ( EphemeralFileSystemAbstraction snapshot = produceUncleanStore() ) { assertTrue( "Store should be unclean", isUnclean( snapshot ) ); PageCache pageCache = pageCacheRule.getPageCache( snapshot ); new StoreAccess( snapshot, pageCache, testDirectory.databaseLayout(), Config.defaults() ).initialize().close(); assertTrue( "Store should be unclean", isUnclean( snapshot ) ); } }
@Test public void shouldReportRelationshipTypeInconsistencies() throws Exception { // given StoreAccess access = fixture.directStoreAccess().nativeStores(); RecordStore<RelationshipTypeTokenRecord> relTypeStore = access.getRelationshipTypeTokenStore(); RelationshipTypeTokenRecord record = relTypeStore.getRecord( (int) relTypeStore.nextId(), relTypeStore.newRecord(), FORCE ); record.setNameId( 20 ); record.setInUse( true ); relTypeStore.updateRecord( record ); // when ConsistencySummaryStatistics stats = check(); // then access.close(); on( stats ).verify( RecordType.RELATIONSHIP_TYPE, 1 ) .andThatsAllFolks(); }
@Override public void close() throws IOException { nativeStores.close(); labelScanStore.shutdown(); } }
@After public void tearDownStoreAccess() { store.close(); }
@Test public void shouldReportRelationshipTypeInconsistencies() throws Exception { // given StoreAccess access = fixture.directStoreAccess().nativeStores(); RecordStore<RelationshipTypeTokenRecord> relTypeStore = access.getRelationshipTypeTokenStore(); RelationshipTypeTokenRecord record = relTypeStore.forceGetRecord( (int) relTypeStore.nextId() ); record.setNameId( 20 ); record.setInUse( true ); relTypeStore.updateRecord( record ); // when ConsistencySummaryStatistics stats = check( fixture.directStoreAccess() ); // then access.close(); on( stats ).verify( RecordType.RELATIONSHIP_TYPE, 1 ) .andThatsAllFolks(); }