Package org.neo4j.kernel

Examples of org.neo4j.kernel.EmbeddedGraphDatabase


    private static ShortestPath threeLayeredTraverserShortestPath;

    @BeforeClass
    public static void setup()
    {
        db = new EmbeddedGraphDatabase( "target/db" );
        threeLayeredTraverserShortestPath = new ShortestPath(db);
    }
View Full Code Here


    private static DBInserter dbInserter;

    @BeforeClass
    public static void setup()
    {
        db = new EmbeddedGraphDatabase( "target/db" );
        dbInserter = new DBInserter( db );
    }
View Full Code Here

        }
        if (useBatchInserter) {
            batchInserter = new BatchInserterImpl(dbPath.getAbsolutePath());
            graphDb = batchInserter.getGraphDbService();
        } else {
            graphDb = new EmbeddedGraphDatabase(dbPath.getAbsolutePath());
        }
        if (autoTx) {
            // with the batch inserter the tx is a dummy that simply succeeds all the time
            tx = graphDb.beginTx();
        }
View Full Code Here

    @Before
    public void setUp() throws Exception
    {
        startTime = System.nanoTime();
        db = new EmbeddedGraphDatabase("target/db" );
        this.database  = new Database((AbstractGraphDatabase) db );
        directionsPlugin = new DirectionsResource(null, database,  null )

    }
View Full Code Here

public class PrintNeo4j {

  public static void main(String[] args) {
    System.out.println("Hello Neo4j!");
//    GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "target/data/test" );
    GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "/Users/trisberg/neo4j/imdb" );
    Transaction tx = graphDb.beginTx();

    tx = graphDb.beginTx();
    try {
      for (Node n : graphDb.getAllNodes()) {
        System.out.print("=> " + n.getId() + " :: ");
        for (String s : n.getPropertyKeys()) {
          System.out.print(" : " + s + " = " + n.getProperty(s));
        }
        for (Relationship r : n.getRelationships()) {
          long start = r.getStartNode().getId();
          long end = r.getEndNode().getId();
          if (n.getId() == start) {
            System.out.print(" ** " + r.getType().name() + "--> " + end);
           
          }
          if (n.getId() == end) {
            System.out.print(" ** " + start + " <--" + r.getType().name());
           
          }
          for (String s : r.getPropertyKeys()) {
            System.out.print(" :: " + s + " = " + r.getProperty(s));
          }
        }
        System.out.println("!");
      }
      tx.success();
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    finally {
      tx.close();
    }
    try {
      Thread.sleep(5000);
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    graphDb.shutdown();
    System.out.println("Done!");
  }
View Full Code Here

    @Autowired Neo4jTemplate template;
    @Autowired PlatformTransactionManager transactionManager;

    @Test public void injectionForCrossStore() {
        Assert.assertNotNull("template", template);
        EmbeddedGraphDatabase graphDatabaseService = (EmbeddedGraphDatabase) template.getGraphDatabaseService();
        String fileSeparator = "target" + System.getProperty("file.separator") + "config-test";
        Assert.assertTrue("store-dir", graphDatabaseService.getStoreDir().endsWith(fileSeparator));
        Assert.assertNotNull("graphDatabaseService", graphDatabaseService);
        Assert.assertNotNull("transactionManager", transactionManager);
    }
View Full Code Here

    private static AbstractGraphDatabase graphDb;

    @BeforeClass
    public static synchronized void startGraphDb()
    {
    graphDb = new EmbeddedGraphDatabase("target" + File.separator + "var"
        + File.separator + ManagementBeansTest.class.getSimpleName());
    }
View Full Code Here

    public GraphDatabaseService neo;

    @Before
    public void setupNeo()
    {
        neo = new EmbeddedGraphDatabase( "var/neo" );
    }
View Full Code Here

    public GraphDatabaseService neo4j;

    @Before
    public void setupNeo()
    {
        neo4j = new EmbeddedGraphDatabase( "target/var/neo4j" );
    }
View Full Code Here

public class ManualTestPrepare
{
    public static void main( String[] args ) throws Exception
    {
        FileUtils.deleteDirectory( ManualTest1.PATH.getParentFile() );
        new EmbeddedGraphDatabase( ManualTest1.PATH.getAbsolutePath() ).shutdown();
        FileUtils.copyDirectory( ManualTest1.PATH, ManualTest2.PATH );
        FileUtils.deleteDirectory( ManualZooKeepers.PATH );
    }
View Full Code Here

TOP

Related Classes of org.neo4j.kernel.EmbeddedGraphDatabase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.