use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class ConfigurationIT method before.
@Before
public void before() throws Exception {
db = (GraphDatabaseAPI) new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().newGraphDatabase();
server = new GraphDatabaseShellServer(db);
client = ShellLobby.newClient(server, InterruptSignalHandler.getHandler());
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class LegacyIndexesUpgradeTest method startDatabase.
private GraphDatabaseService startDatabase(boolean allowUpgread) {
GraphDatabaseFactory factory = new TestGraphDatabaseFactory();
GraphDatabaseBuilder builder = factory.newEmbeddedDatabaseBuilder(testDir.graphDbDir());
builder.setConfig(GraphDatabaseSettings.allow_store_upgrade, Boolean.toString(allowUpgread));
builder.setConfig(GraphDatabaseSettings.pagecache_memory, "8m");
return builder.newGraphDatabase();
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class LegacyIndexesUpgradeTest method checkIndexData.
private void checkIndexData() {
GraphDatabaseService db = new TestGraphDatabaseFactory().newEmbeddedDatabase(testDir.graphDbDir());
try {
IntFunction<String> keyFactory = basicKeyFactory();
Factory<Node> readNodes = readNodes(db);
readIndex(db, nodeIndex(db, "node-1", EXACT_CONFIG), readNodes, keyFactory, stringValues());
readIndex(db, nodeIndex(db, "node-2", EXACT_CONFIG), readNodes, keyFactory, intValues());
readIndex(db, nodeIndex(db, "node-3", FULLTEXT_CONFIG), readNodes, keyFactory, stringValues());
readIndex(db, nodeIndex(db, "node-4", FULLTEXT_CONFIG), readNodes, keyFactory, longValues());
Factory<Relationship> relationships = readRelationships(db);
readIndex(db, relationshipIndex(db, "rel-1", EXACT_CONFIG), relationships, keyFactory, stringValues());
readIndex(db, relationshipIndex(db, "rel-2", EXACT_CONFIG), relationships, keyFactory, floatValues());
readIndex(db, relationshipIndex(db, "rel-3", FULLTEXT_CONFIG), relationships, keyFactory, stringValues());
readIndex(db, relationshipIndex(db, "rel-4", FULLTEXT_CONFIG), relationships, keyFactory, doubleValues());
} finally {
db.shutdown();
}
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class ProcedureIT method shouldLogLikeThereIsNoTomorrow.
@Test
public void shouldLogLikeThereIsNoTomorrow() throws Throwable {
// Given
AssertableLogProvider logProvider = new AssertableLogProvider();
db.shutdown();
db = new TestGraphDatabaseFactory().setInternalLogProvider(logProvider).setUserLogProvider(logProvider).newImpermanentDatabaseBuilder().setConfig(plugin_dir, plugins.getRoot().getAbsolutePath()).setConfig(procedure_unrestricted, "org.neo4j.procedure.*").newGraphDatabase();
// When
try (Transaction ignore = db.beginTx()) {
Result res = db.execute("CALL org.neo4j.procedure.logAround()");
while (res.hasNext()) {
res.next();
}
}
// Then
AssertableLogProvider.LogMatcherBuilder match = inLog(Procedures.class);
logProvider.assertAtLeastOnce(match.debug("1"), match.info("2"), match.warn("3"), match.error("4"));
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class UserAggregationFunctionIT method setUp.
@Before
public void setUp() throws IOException {
new JarBuilder().createJarFor(plugins.newFile("myFunctions.jar"), ClassWithFunctions.class);
db = new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().setConfig(GraphDatabaseSettings.plugin_dir, plugins.getRoot().getAbsolutePath()).newGraphDatabase();
}
Aggregations