private void addNode( EmbeddedGraphDatabase graphDb ) { Node referenceNode = graphDb.getReferenceNode(); Node node = graphDb.createNode(); referenceNode.createRelationshipTo( node, MyRels.TEST ); } }
private Node addNode( EmbeddedGraphDatabase graphDb ) { Node referenceNode = graphDb.getReferenceNode(); Node node = graphDb.createNode(); node.setProperty( "theId", node.getId() ); referenceNode.createRelationshipTo( node, MyRels.TEST ); return node; } }
private Node addNode( EmbeddedGraphDatabase graphDb ) { Node referenceNode = graphDb.getReferenceNode(); Node node = graphDb.createNode(); node.setProperty( "theId", node.getId() ); referenceNode.createRelationshipTo( node, MyRels.TEST ); return node; } }
@Override protected void tryBackup( EmbeddedGraphDatabase graphDb, String location, int relCount ) throws IOException { System.out.println( "backing up to backup location" ); Backup backupComp = Neo4jBackup.neo4jDataSource( graphDb, location ); backupComp.doBackup(); EmbeddedGraphDatabase bDb = Util.startGraphDbInstance( location ); Transaction bTx = bDb.beginTx(); try { List<Relationship> rels = new ArrayList<Relationship>(); for ( Relationship rel : bDb.getReferenceNode().getRelationships() ) { rels.add( rel ); } assertEquals( relCount, rels.size() ); bTx.success(); } finally { bTx.finish(); } Util.stopGraphDb( bDb ); } }
protected void tryBackup( EmbeddedGraphDatabase graphDb, String location, int relCount ) throws IOException { System.out.println( "backing up to running EmbeddedGraphDatabase instance" ); EmbeddedGraphDatabase bDb = Util.startGraphDbInstance( location ); Backup backupComp = Neo4jBackup.neo4jDataSource( graphDb, bDb ); configureBackup( backupComp ); backupComp.doBackup(); Util.stopGraphDb( bDb ); bDb = Util.startGraphDbInstance( location ); Transaction bTx = bDb.beginTx(); try { List<Relationship> rels = new ArrayList<Relationship>(); for ( Relationship rel : bDb.getReferenceNode().getRelationships() ) { rels.add( rel ); } assertEquals( relCount, rels.size() ); bTx.success(); } finally { bTx.finish(); } Util.stopGraphDb( bDb ); }
protected void tryBackup( EmbeddedGraphDatabase graphDb, String location, int relCount ) throws IOException { setupBackup( graphDb, location ); EmbeddedGraphDatabase bDb = Util.startGraphDbInstance( location ); IndexService bIndexService = new LuceneIndexService( bDb ); Transaction bTx = bDb.beginTx(); try { List<Relationship> rels = new ArrayList<Relationship>(); for ( Relationship rel : bDb.getReferenceNode().getRelationships() ) { rels.add( rel ); } assertEquals( relCount, rels.size() ); Node node = bIndexService.getSingleNode( "number", relCount ); assertEquals( true, node != null ); assertEquals( node.getId(), (long) (Long) node.getProperty( "theId", -1L ) ); bTx.success(); } finally { bTx.finish(); } Util.stopGraphDb( bDb, bIndexService ); }
for ( Relationship rel : bDb.getReferenceNode().getRelationships() )