ch.hsr.bieridee.utils
Class Testdb

java.lang.Object
  extended by ch.hsr.bieridee.utils.Testdb

public final class Testdb
extends java.lang.Object

Utiltiy to create a neo4j database with some testdata.


Method Summary
static org.neo4j.kernel.EmbeddedGraphDatabase createDB(java.lang.String path)
          Creates the Database at the given path with the given name.
static void deleteDB(org.neo4j.kernel.EmbeddedGraphDatabase db)
          Deletes the given database.
static org.neo4j.kernel.EmbeddedGraphDatabase fillDB(org.neo4j.kernel.EmbeddedGraphDatabase db)
          Fills the given database with test data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createDB

public static org.neo4j.kernel.EmbeddedGraphDatabase createDB(java.lang.String path)
Creates the Database at the given path with the given name. If a database with the same path/name exists, it will be deleted first (mercyless).

Parameters:
path - Path and name of the database to be created
Returns:
The newly created database

deleteDB

public static void deleteDB(org.neo4j.kernel.EmbeddedGraphDatabase db)
Deletes the given database.

Parameters:
db - The database to be deleted

fillDB

public static org.neo4j.kernel.EmbeddedGraphDatabase fillDB(org.neo4j.kernel.EmbeddedGraphDatabase db)
Fills the given database with test data. There is at least four nodes of every type and all needed relationships.

Parameters:
db - The database to be filled
Returns:
The filled database