@After public void after() { db.shutdown(); }
@After public void tearDown() { db.shutdown(); }
@After public void stop() { db.shutdown(); }
private void restart( File newStore ) { db.shutdown(); db = (GraphDatabaseAPI) newDb(); }
@After public void after() { db.shutdown(); }
@AfterClass public static void destroyExtensionManager() { manager = null; if ( graphDb != null ) { graphDb.shutdown(); } graphDb = null; }
private void killDb() throws Exception { if ( db != null ) { fs.snapshot( () -> { db.shutdown(); db = null; } ); } }
@After public void after() { db.shutdown(); }
@After public void after() { db.shutdown(); }
@After public void doAfter() { db.shutdown(); }
@After public void after() { if ( db != null ) { db.shutdown(); } }
@AfterClass public static void closeDb() { db.shutdown(); }
@After public void cleanup() throws Exception { db.shutdown(); fs.close(); }
public GraphDatabaseAPI restartDatabase( RestartAction action, String... configChanges ) throws IOException { FileSystemAbstraction fs = resolveDependency( FileSystemAbstraction.class ); database.shutdown(); action.run( fs, databaseLayout ); database = null; // This DatabaseBuilder has already been configured with the global settings as well as any test-specific settings, // so just apply these additional settings. databaseBuilder.setConfig( stringMap( configChanges ) ); return getGraphDatabaseAPI(); }
private int figureOutSampleTransactionSizeBytes() throws IOException { db = newDb( "true", 5 ); doTransaction(); db.shutdown(); return (int) fs.getFileSize( files.getLogFileForVersion( 0 ) ); }
@Test public void shouldCreateAnEmptyCountsStoreFromAnEmptyDatabase() { @SuppressWarnings( "deprecation" ) final GraphDatabaseAPI db = (GraphDatabaseAPI) dbBuilder.newGraphDatabase(); long lastCommittedTransactionId = getLastTxId( db ); db.shutdown(); rebuildCounts( lastCommittedTransactionId ); checkEmptyCountStore(); }
private void startDb( KernelExtensionFactory<?> indexProviderFactory ) { if ( db != null ) { db.shutdown(); } TestGraphDatabaseFactory factory = new TestGraphDatabaseFactory(); factory.setFileSystem( fs.get() ); factory.setKernelExtensions( Collections.singletonList( indexProviderFactory ) ); db = (GraphDatabaseAPI) factory.newImpermanentDatabaseBuilder() .setConfig( default_schema_provider, PROVIDER_DESCRIPTOR.name() ).newGraphDatabase(); }
private void startDb() { if ( db != null ) { db.shutdown(); } TestGraphDatabaseFactory factory = new TestGraphDatabaseFactory(); factory.setFileSystem( fs.get() ); factory.setKernelExtensions( Collections.singletonList( mockedIndexProviderFactory ) ); db = (GraphDatabaseAPI) factory.newImpermanentDatabaseBuilder() .setConfig( GraphDatabaseSettings.default_schema_provider, PROVIDER_DESCRIPTOR.name() ).newGraphDatabase(); }
/** * Check that lifecycle status of extension is SHUTDOWN */ @Test public void shouldBeShutdown() { GraphDatabaseAPI graphdb = graphDb( 0 ); graphdb.shutdown(); assertEquals( LifecycleStatus.SHUTDOWN, graphdb.getDependencyResolver().resolveDependency( GlobalKernelExtensions .class ).resolveDependency( DummyExtension.class ).getStatus() ); } }
@Test public void skipPopulationWhenNodeAndRelationshipStoresAreEmpty() { GraphDatabaseAPI db = (GraphDatabaseAPI) dbBuilder.newGraphDatabase(); long lastCommittedTransactionId = getLastTxId( db ); db.shutdown(); InvocationTrackingProgressReporter progressReporter = new InvocationTrackingProgressReporter(); rebuildCounts( lastCommittedTransactionId, progressReporter ); checkEmptyCountStore(); assertTrue( progressReporter.isCompleteInvoked() ); assertFalse( progressReporter.isStartInvoked() ); }