private GraphDatabaseService createTestDatabase( FileSystemAbstraction fileSystem, File storeDir ) { return new TestGraphDatabaseFactory() .setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fileSystem ) ) .newImpermanentDatabase( storeDir ); }
private GraphDatabaseService createGraphDatabase( EphemeralFileSystemAbstraction fs ) throws IOException { removePreviousAuthFile(); Map<Setting<?>, String> settings = new HashMap<>(); settings.put( GraphDatabaseSettings.auth_enabled, "true" ); TestGraphDatabaseBuilder graphDatabaseFactory = (TestGraphDatabaseBuilder) new TestGraphDatabaseFactory() .setFileSystem( fs ) .newImpermanentDatabaseBuilder() .setConfig( GraphDatabaseSettings.auth_enabled, "true" ); return graphDatabaseFactory.newGraphDatabase(); }
@Before public void before() { factory = new TestGraphDatabaseFactory() .setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fs.get() ) ); }
private GraphDatabaseService newDb() { return new TestGraphDatabaseFactory() .setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fsRule.get() ) ) .newImpermanentDatabase(); }
private GraphDatabaseService newDB( FileSystemAbstraction fs ) { return new TestGraphDatabaseFactory() .setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fs ) ) .newImpermanentDatabase( testDirectory.databaseDir() ); }
@BeforeEach void createDb() { db = new TestGraphDatabaseFactory() .setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fs ) ) .newImpermanentDatabase( testDirectory.databaseDir() ); }
private static GraphDatabaseAPI startDatabase( File storeDir, EphemeralFileSystemAbstraction fs, UpdateCapturingIndexProvider indexProvider ) { return (GraphDatabaseAPI) new TestGraphDatabaseFactory() .setFileSystem( fs ) .setKernelExtensions( singletonList( new IndexExtensionFactory( indexProvider ) ) ) .newImpermanentDatabaseBuilder( storeDir ) .setConfig( default_schema_provider, indexProvider.getProviderDescriptor().name() ) .newGraphDatabase(); }
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(); }
@Before public void setup() { fs = fsRule.get(); File storeDir = testDirectory.databaseDir(); builder = new TestGraphDatabaseFactory().setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fs ) ) .newImpermanentDatabaseBuilder( storeDir ); }
private void startDb() { db = new TestGraphDatabaseFactory().setInternalLogProvider( logProvider ) .setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fileSystem ) ) .newImpermanentDatabaseBuilder() .setConfig( index_background_sampling_enabled, "false" ) .newGraphDatabase(); }
private GraphDatabaseService graphDatabaseService( Config config ) { TestGraphDatabaseFactory factory = new TestGraphDatabaseFactory(); factory.setFileSystem( fileSystemRule.get() ); return factory.newImpermanentDatabaseBuilder( storeDir.databaseDir() ) // Shouldn't be necessary to set dense node threshold since it's a stick config .setConfig( config.getRaw() ) .newGraphDatabase(); }
@Before public void setup() { fs = fsRule.get(); dbBuilder = new TestGraphDatabaseFactory().setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fs ) ) .newImpermanentDatabaseBuilder( testDir.databaseDir() ); pageCache = pcRule.getPageCache( fs ); }
@Before public void setup() { fs = fsRule.get(); dbBuilder = new TestGraphDatabaseFactory().setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fs ) ) .newImpermanentDatabaseBuilder( testDir.databaseDir() ); pageCache = pcRule.getPageCache( fs ); }
@Before public void setup() { databaseLayout = testDirectory.databaseLayout(); storeDir = databaseLayout.databaseDirectory(); fileSystem = fileSystemRule.get(); new TestGraphDatabaseFactory().setFileSystem( fileSystem ).newImpermanentDatabase( storeDir ).shutdown(); }
protected GraphDatabaseService createGraphDatabase() { GraphDatabaseBuilder graphDatabaseBuilder = configure( createGraphDatabaseFactory() ) .setFileSystem( fileSystemRule.get() ) .newEmbeddedDatabaseBuilder( testDir.storeDir() ); return configure( graphDatabaseBuilder ).newGraphDatabase(); }
private GraphDatabaseAPI newDb( String logPruning, int rotateEveryNTransactions ) { this.rotateEveryNTransactions = rotateEveryNTransactions; fs = new EphemeralFileSystemAbstraction(); TestGraphDatabaseFactory gdf = new TestGraphDatabaseFactory(); gdf.setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fs ) ); GraphDatabaseBuilder builder = gdf.newImpermanentDatabaseBuilder(); builder.setConfig( keep_logical_logs, logPruning ); this.db = (GraphDatabaseAPI) builder.newGraphDatabase(); files = db.getDependencyResolver().resolveDependency( LogFiles.class ); return db; }
private GraphDatabaseService switchToEmbeddedGraphDatabaseService( BatchInserter inserter ) { inserter.shutdown(); TestGraphDatabaseFactory factory = new TestGraphDatabaseFactory(); factory.setFileSystem( fileSystemRule.get() ); return factory.newImpermanentDatabaseBuilder( localTestDirectory.databaseDir() ) // Shouldn't be necessary to set dense node threshold since it's a stick config .setConfig( configuration() ) .newGraphDatabase(); }
@Test public void startAsNormalWhenUpgradeIsNotAllowed() { createGraphDbAndKillIt(); // Try to start with upgrading disabled final GraphDatabaseService db = new TestGraphDatabaseFactory() .setFileSystem( fs.get() ) .newImpermanentDatabaseBuilder( storeDirectory.databaseDir() ) .setConfig( GraphDatabaseSettings.allow_upgrade, "false" ) .newGraphDatabase(); db.shutdown(); }
@Test public void startFromOlderTransactionLogsIfAllowed() throws Exception { createStoreWithLogEntryVersion( LogEntryVersion.V2_3 ); // Try to start with upgrading enabled final GraphDatabaseService db = new TestGraphDatabaseFactory() .setFileSystem( fs.get() ) .newImpermanentDatabaseBuilder( storeDirectory.databaseDir() ) .setConfig( GraphDatabaseSettings.allow_upgrade, "true" ) .newGraphDatabase(); db.shutdown(); }