Search in sources :

Example 41 with DependencyResolver

use of org.neo4j.common.DependencyResolver in project neo4j by neo4j.

the class CommunityEditionModuleIntegrationTest method createBufferedIdComponentsByDefault.

@Test
void createBufferedIdComponentsByDefault() {
    DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(testDirectory.homePath()).build();
    GraphDatabaseAPI database = (GraphDatabaseAPI) managementService.database(DEFAULT_DATABASE_NAME);
    try {
        DependencyResolver dependencyResolver = database.getDependencyResolver();
        IdController idController = dependencyResolver.resolveDependency(IdController.class);
        IdGeneratorFactory idGeneratorFactory = dependencyResolver.resolveDependency(IdGeneratorFactory.class);
        assertThat(idController).isInstanceOf(BufferedIdController.class);
        assertThat(idGeneratorFactory).isInstanceOf(BufferingIdGeneratorFactory.class);
    } finally {
        managementService.shutdown();
    }
}
Also used : TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) BufferedIdController(org.neo4j.internal.id.BufferedIdController) IdController(org.neo4j.internal.id.IdController) IdGeneratorFactory(org.neo4j.internal.id.IdGeneratorFactory) BufferingIdGeneratorFactory(org.neo4j.internal.id.BufferingIdGeneratorFactory) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService) DependencyResolver(org.neo4j.common.DependencyResolver) Test(org.junit.jupiter.api.Test)

Aggregations

DependencyResolver (org.neo4j.common.DependencyResolver)41 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)13 Config (org.neo4j.configuration.Config)12 Test (org.junit.jupiter.api.Test)10 DatabaseManagementService (org.neo4j.dbms.api.DatabaseManagementService)8 DatabaseContext (org.neo4j.dbms.database.DatabaseContext)6 GraphDatabaseFacade (org.neo4j.kernel.impl.factory.GraphDatabaseFacade)5 TestDatabaseManagementServiceBuilder (org.neo4j.test.TestDatabaseManagementServiceBuilder)5 GraphDatabaseQueryService (org.neo4j.kernel.GraphDatabaseQueryService)4 KernelTransaction (org.neo4j.kernel.api.KernelTransaction)4 IndexingService (org.neo4j.kernel.impl.api.index.IndexingService)4 SystemGraphComponents (org.neo4j.dbms.database.SystemGraphComponents)3 Transaction (org.neo4j.graphdb.Transaction)3 IdGeneratorFactory (org.neo4j.internal.id.IdGeneratorFactory)3 PageCache (org.neo4j.io.pagecache.PageCache)3 CheckPointer (org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointer)3 SimpleTriggerInfo (org.neo4j.kernel.impl.transaction.log.checkpoint.SimpleTriggerInfo)3 TokenHolders (org.neo4j.token.TokenHolders)3 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2