use of org.neo4j.graphdb.factory.module.edition.CommunityEditionModule in project neo4j by neo4j.
the class CommitContentionTest method createDb.
private GraphDatabaseService createDb() {
Config cfg = Config.newBuilder().set(neo4j_home, testDirectory.absolutePath()).build();
managementService = new DatabaseManagementServiceFactory(DbmsInfo.COMMUNITY, globalModule -> new CommunityEditionModule(globalModule) {
@Override
public DatabaseTransactionStats createTransactionMonitor() {
return new SkipTransactionDatabaseStats();
}
}).build(cfg, GraphDatabaseDependencies.newDependencies().dependencies(noOpSystemGraphInitializer(cfg)));
return managementService.database(cfg.get(GraphDatabaseSettings.default_database));
}
use of org.neo4j.graphdb.factory.module.edition.CommunityEditionModule in project neo4j by neo4j.
the class DatabaseManagementServiceFactoryTest method newFaultyGraphDatabaseFacadeFactory.
private static DatabaseManagementServiceFactory newFaultyGraphDatabaseFacadeFactory(final RuntimeException startupError, RuntimeException shutdownError) {
return new DatabaseManagementServiceFactory(DbmsInfo.UNKNOWN, CommunityEditionModule::new) {
@Override
protected GlobalModule createGlobalModule(Config config, ExternalDependencies dependencies) {
final LifeSupport lifeMock = mock(LifeSupport.class);
doThrow(startupError).when(lifeMock).start();
if (shutdownError != null) {
doThrow(shutdownError).when(lifeMock).shutdown();
}
doAnswer(invocation -> invocation.getArgument(0)).when(lifeMock).add(any(Lifecycle.class));
return new GlobalModule(config, dbmsInfo, dependencies) {
@Override
public LifeSupport createLife() {
return lifeMock;
}
};
}
};
}
Aggregations