Search in sources :

Example 56 with TestDatabaseManagementServiceBuilder

use of org.neo4j.test.TestDatabaseManagementServiceBuilder in project neo4j by neo4j.

the class DetectAllRelationshipInconsistenciesIT method getGraphDatabaseAPI.

private GraphDatabaseAPI getGraphDatabaseAPI() {
    managementService = new TestDatabaseManagementServiceBuilder(directory.homePath()).setConfig(getConfig()).build();
    GraphDatabaseService database = managementService.database(DEFAULT_DATABASE_NAME);
    return (GraphDatabaseAPI) database;
}
Also used : GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI)

Example 57 with TestDatabaseManagementServiceBuilder

use of org.neo4j.test.TestDatabaseManagementServiceBuilder in project neo4j by neo4j.

the class SecurityProcedureQueryTypeTest method beforeAll.

@BeforeAll
static void beforeAll() {
    databaseManagementService = new TestDatabaseManagementServiceBuilder(testDirectory.homePath()).setConfig(GraphDatabaseSettings.auth_enabled, true).build();
    DependencyResolver dependencyResolver = ((GraphDatabaseFacade) databaseManagementService.database("system")).getDependencyResolver();
    planner = dependencyResolver.resolveDependency(FabricPlanner.class);
}
Also used : TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) GraphDatabaseFacade(org.neo4j.kernel.impl.factory.GraphDatabaseFacade) DependencyResolver(org.neo4j.common.DependencyResolver) FabricPlanner(org.neo4j.fabric.planning.FabricPlanner) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 58 with TestDatabaseManagementServiceBuilder

use of org.neo4j.test.TestDatabaseManagementServiceBuilder in project neo4j by neo4j.

the class CypherUpdateMapTest method setup.

@BeforeEach
void setup() {
    managementService = new TestDatabaseManagementServiceBuilder().impermanent().build();
    db = managementService.database(DEFAULT_DATABASE_NAME);
}
Also used : TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 59 with TestDatabaseManagementServiceBuilder

use of org.neo4j.test.TestDatabaseManagementServiceBuilder in project neo4j by neo4j.

the class EagerResultIT method startRestartableDatabase.

private GraphDatabaseService startRestartableDatabase() {
    Dependencies dependencies = new Dependencies();
    dependencies.satisfyDependencies(testContextSupplier);
    managementService = new TestDatabaseManagementServiceBuilder(storeDir).setExternalDependencies(dependencies).setConfig(GraphDatabaseInternalSettings.snapshot_query, true).build();
    return managementService.database(DEFAULT_DATABASE_NAME);
}
Also used : TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) Dependencies(org.neo4j.collection.Dependencies)

Example 60 with TestDatabaseManagementServiceBuilder

use of org.neo4j.test.TestDatabaseManagementServiceBuilder in project neo4j by neo4j.

the class PushToCloudCommandTest method createDbAndDump.

private void createDbAndDump() {
    Config config = Config.newBuilder().set(GraphDatabaseSettings.neo4j_home, homeDir.toAbsolutePath()).set(default_database, DBNAME).build();
    DatabaseLayout databaseLayout = DatabaseLayout.of(config);
    Neo4jLayout neo4jLayout = databaseLayout.getNeo4jLayout();
    DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(neo4jLayout.homeDirectory()).setConfig(config).build();
    managementService.database(databaseLayout.getDatabaseName());
    managementService.shutdown();
    dump = directory.file("some-archive.dump");
    new RealDumpCreator(ctx).dumpDatabase(DBNAME, dump);
}
Also used : TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) Config(org.neo4j.configuration.Config) DatabaseLayout(org.neo4j.io.layout.DatabaseLayout) Neo4jLayout(org.neo4j.io.layout.Neo4jLayout) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService)

Aggregations

TestDatabaseManagementServiceBuilder (org.neo4j.test.TestDatabaseManagementServiceBuilder)135 DatabaseManagementService (org.neo4j.dbms.api.DatabaseManagementService)74 Test (org.junit.jupiter.api.Test)48 Transaction (org.neo4j.graphdb.Transaction)42 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)38 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)30 Path (java.nio.file.Path)23 BeforeEach (org.junit.jupiter.api.BeforeEach)18 Node (org.neo4j.graphdb.Node)18 EphemeralFileSystemAbstraction (org.neo4j.io.fs.EphemeralFileSystemAbstraction)13 AssertableLogProvider (org.neo4j.logging.AssertableLogProvider)11 PageCache (org.neo4j.io.pagecache.PageCache)10 UncloseableDelegatingFileSystemAbstraction (org.neo4j.io.fs.UncloseableDelegatingFileSystemAbstraction)9 DatabaseLayout (org.neo4j.io.layout.DatabaseLayout)8 KernelTransaction (org.neo4j.kernel.api.KernelTransaction)7 TokenIndexProviderFactory (org.neo4j.kernel.impl.index.schema.TokenIndexProviderFactory)7 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 Dependencies (org.neo4j.collection.Dependencies)6 Config (org.neo4j.configuration.Config)6 DatabaseManagementServiceBuilder (org.neo4j.dbms.api.DatabaseManagementServiceBuilder)6