1 package org.openkilda.wfm;
3 import org.neo4j.graphdb.GraphDatabaseService;
4 import org.neo4j.graphdb.factory.GraphDatabaseBuilder;
5 import org.neo4j.graphdb.factory.GraphDatabaseFactory;
6 import org.neo4j.kernel.configuration.BoltConnector;
9 import java.nio.file.Path;
12 private final String DIRECTORY_NAME =
"neo4j";
14 private final GraphDatabaseBuilder dbBuilder;
15 private GraphDatabaseService db = null;
16 private final String listenAddress;
19 this.listenAddress = listenAddress;
21 Path dbPath = rootDir.resolve(DIRECTORY_NAME);
22 File dbDir = dbPath.toFile();
25 BoltConnector bolt =
new BoltConnector(
"0");
26 dbBuilder =
new GraphDatabaseFactory()
27 .newEmbeddedDatabaseBuilder(dbDir)
28 .setConfig(bolt.type,
"BOLT")
29 .setConfig(bolt.enabled,
"true")
30 .setConfig(bolt.listen_address,
this.listenAddress);
34 db = dbBuilder.newGraphDatabase();
GraphDatabaseService getGraphDatabaseService()
Neo4jFixture(Path rootDir, String listenAddress)
String getListenAddress()