@Override protected void configure( GraphDatabaseFactory databaseFactory ) { super.configure( databaseFactory ); List<KernelExtensionFactory<?>> extensions = Collections.singletonList( singleInstanceIndexProviderFactory( "test", provider ) ); ((TestGraphDatabaseFactory) databaseFactory).setKernelExtensions( extensions ); } }.withSetting( default_schema_provider, provider.getProviderDescriptor().name() );
@Before public void before() throws MisconfiguredIndexException { when( mockedIndexProvider.getProviderDescriptor() ).thenReturn( PROVIDER_DESCRIPTOR ); when( mockedIndexProvider.storeMigrationParticipant( any( FileSystemAbstraction.class ), any( PageCache.class ) ) ) .thenReturn( StoreMigrationParticipant.NOT_PARTICIPATING ); when( mockedIndexProvider.bless( any( IndexDescriptor.class ) ) ).thenCallRealMethod(); TestGraphDatabaseFactory factory = new TestGraphDatabaseFactory(); factory.setFileSystem( fs.get() ); factory.setKernelExtensions( Collections.singletonList( mockedIndexProviderFactory ) ); db = (GraphDatabaseAPI) factory.newImpermanentDatabaseBuilder().setConfig( default_schema_provider, PROVIDER_DESCRIPTOR.name() ).newGraphDatabase(); ctxSupplier = db.getDependencyResolver().resolveDependency( ThreadToStatementContextBridge.class ); }
@Before public void before() { factory = new TestGraphDatabaseFactory(); factory.setFileSystem( new UncloseableDelegatingFileSystemAbstraction( fs.get() ) ); factory.setKernelExtensions( Collections.singletonList( singleInstanceIndexProviderFactory( "test", provider ) ) ); }
private GraphDatabaseAPI createDatabase( TrackingIndexExtensionFactory indexExtensionFactory ) { return (GraphDatabaseAPI) new TestGraphDatabaseFactory() .setKernelExtensions( singletonList( indexExtensionFactory ) ).newEmbeddedDatabaseBuilder( directory.databaseDir() ) .setConfig( default_schema_provider, DESCRIPTOR.name() ).newGraphDatabase(); }
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(); }
@Before public void setUp() { TestGraphDatabaseFactory dbFactory = new TestGraphDatabaseFactory(); dbFactory.setKernelExtensions( Collections.singletonList( new PredefinedIndexProviderFactory( indexProvider ) ) ); db = dbFactory.newImpermanentDatabaseBuilder( graphDbDir ) .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(); }