use of org.neo4j.test.TestDatabaseManagementServiceBuilder in project neo4j by neo4j.
the class BigStoreIT method startDb.
private void startDb() {
var builder = new TestDatabaseManagementServiceBuilder(testDirectory.homePath()).setFileSystem(fs);
managementService = builder.build();
db = managementService.database(DEFAULT_DATABASE_NAME);
}
use of org.neo4j.test.TestDatabaseManagementServiceBuilder in project neo4j by neo4j.
the class TestConcurrentRelationshipChainLoadingIssue method tryToTriggerRelationshipLoadingStoppingMidWay.
private void tryToTriggerRelationshipLoadingStoppingMidWay(int denseNodeThreshold) throws Throwable {
DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder().impermanent().setConfig(dense_node_threshold, denseNodeThreshold).build();
GraphDatabaseAPI db = (GraphDatabaseAPI) managementService.database(DEFAULT_DATABASE_NAME);
Node node = createNodeWithRelationships(db);
checkStateToHelpDiagnoseFlakyTest(db, node);
long end = currentTimeMillis() + SECONDS.toMillis(5);
int iterations = 0;
while (currentTimeMillis() < end && iterations < 100) {
tryOnce(db, node);
iterations++;
}
managementService.shutdown();
}
use of org.neo4j.test.TestDatabaseManagementServiceBuilder in project neo4j by neo4j.
the class DumpCommandIT method putStoreInDirectory.
private void putStoreInDirectory(Config config, Path databaseDirectory) {
String databaseName = databaseDirectory.getFileName().toString();
DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(databaseDirectory.getParent().getParent().getParent()).setConfig(config).setConfig(default_database, databaseName).build();
managementService.shutdown();
}
use of org.neo4j.test.TestDatabaseManagementServiceBuilder in project neo4j by neo4j.
the class DefaultDatabaseManagerUpgradeIT method createDbms.
private void createDbms() {
TestDatabaseManagementServiceBuilder builder = new TestDatabaseManagementServiceBuilder(neo4jLayout);
dbms = builder.setConfig(GraphDatabaseSettings.allow_upgrade, false).setUserLogProvider(userLogProvider).build();
}
use of org.neo4j.test.TestDatabaseManagementServiceBuilder in project neo4j by neo4j.
the class MemoryRecommendationsCommandTest method createDatabaseWithNativeIndexes.
private static void createDatabaseWithNativeIndexes(Path homeDirectory, String databaseName) {
// Create one index for every provider that we have
for (SchemaIndex schemaIndex : SchemaIndex.values()) {
DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(homeDirectory).setConfig(default_schema_provider, schemaIndex.providerName()).setConfig(default_database, databaseName).build();
GraphDatabaseService db = managementService.database(databaseName);
String key = "key-" + schemaIndex.name();
try {
Label labelOne = Label.label("one");
try (Transaction tx = db.beginTx()) {
tx.schema().indexFor(labelOne).on(key).create();
tx.commit();
}
try (Transaction tx = db.beginTx()) {
RandomValues randomValues = RandomValues.create();
for (int i = 0; i < 10_000; i++) {
tx.createNode(labelOne).setProperty(key, randomValues.nextValue().asObject());
}
tx.commit();
}
} finally {
managementService.shutdown();
}
}
}
Aggregations