Open Kilda Java Documentation
NorthboundBaseTest.java
Go to the documentation of this file.
1 package org.openkilda.northbound.controller;
2 
3 import org.junit.AfterClass;
4 import org.junit.BeforeClass;
5 import org.neo4j.graphdb.GraphDatabaseService;
6 import org.neo4j.graphdb.factory.GraphDatabaseFactory;
7 import org.neo4j.io.fs.FileUtils;
8 import org.neo4j.kernel.configuration.BoltConnector;
9 
10 import java.io.File;
11 
17 public class NorthboundBaseTest {
18 
19  /*
20  * The neo4j block was added due to new dependency in FlowServiceImpl
21  */
22  private static GraphDatabaseService graphDb;
23  private static final File databaseDirectory = new File( "target/neo4j-test-db" );
24 
25  @BeforeClass
26  public static void setUpOnce() throws Exception {
27  FileUtils.deleteRecursively( databaseDirectory ); // delete neo db file
28 
29  // This next area enables Kilda to connect to the local db
30  BoltConnector bolt = new BoltConnector("0");
31  graphDb = new GraphDatabaseFactory()
32  .newEmbeddedDatabaseBuilder( databaseDirectory )
33  .setConfig( bolt.type, "BOLT" )
34  .setConfig( bolt.enabled, "true" )
35  .setConfig( bolt.listen_address, "localhost:7878" )
36  .newGraphDatabase();
37  }
38  @AfterClass
39  public static void teatDownOnce() {
40  graphDb.shutdown();
41  }
42  /*
43  * End of special block for neo
44  */
45 
46 }