Search in sources :

Example 1 with IdController

use of org.neo4j.internal.id.IdController 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

Test (org.junit.jupiter.api.Test)1 DependencyResolver (org.neo4j.common.DependencyResolver)1 DatabaseManagementService (org.neo4j.dbms.api.DatabaseManagementService)1 BufferedIdController (org.neo4j.internal.id.BufferedIdController)1 BufferingIdGeneratorFactory (org.neo4j.internal.id.BufferingIdGeneratorFactory)1 IdController (org.neo4j.internal.id.IdController)1 IdGeneratorFactory (org.neo4j.internal.id.IdGeneratorFactory)1 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)1 TestDatabaseManagementServiceBuilder (org.neo4j.test.TestDatabaseManagementServiceBuilder)1