use of org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory in project neo4j by neo4j.
the class NonUniqueIndexTests method newEmbeddedGraphDatabaseWithSlowJobScheduler.
private GraphDatabaseService newEmbeddedGraphDatabaseWithSlowJobScheduler() {
GraphDatabaseFactoryState graphDatabaseFactoryState = new GraphDatabaseFactoryState();
graphDatabaseFactoryState.setUserLogProvider(NullLogService.getInstance().getUserLogProvider());
return new GraphDatabaseFacadeFactory(DatabaseInfo.COMMUNITY, CommunityEditionModule::new) {
@Override
protected PlatformModule createPlatform(File storeDir, Config config, Dependencies dependencies, GraphDatabaseFacade graphDatabaseFacade) {
return new PlatformModule(storeDir, config, databaseInfo, dependencies, graphDatabaseFacade) {
@Override
protected Neo4jJobScheduler createJobScheduler() {
return newSlowJobScheduler();
}
@Override
protected LogService createLogService(LogProvider userLogProvider) {
return NullLogService.getInstance();
}
};
}
}.newFacade(directory.graphDbDir(), Config.embeddedDefaults(), graphDatabaseFactoryState.databaseDependencies());
}
use of org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory in project neo4j by neo4j.
the class EmbeddedGraphDatabase method create.
protected void create(File storeDir, Config config, GraphDatabaseFacadeFactory.Dependencies dependencies) {
GraphDatabaseDependencies newDependencies = newDependencies(dependencies).settingsClasses(asList(append(GraphDatabaseSettings.class, dependencies.settingsClasses())));
new GraphDatabaseFacadeFactory(DatabaseInfo.COMMUNITY, CommunityEditionModule::new).initFacade(storeDir, config, newDependencies, this);
}
use of org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory in project neo4j by neo4j.
the class GraphDatabaseFacadeFactoryTest method shouldThrowAppropriateExceptionIfStartFails.
@Test
public void shouldThrowAppropriateExceptionIfStartFails() {
// Given
RuntimeException startupError = new RuntimeException();
GraphDatabaseFacadeFactory db = newFaultyGraphDatabaseFacadeFactory(startupError);
try {
// When
db.initFacade(dir.graphDbDir(), Collections.emptyMap(), deps, mockFacade);
fail("Should have thrown " + RuntimeException.class);
} catch (RuntimeException exception) {
// Then
assertEquals(startupError, Exceptions.rootCause(exception));
}
}
Aggregations