use of org.neo4j.kernel.impl.batchinsert.SimpleRelationship in project graphdb by neo4j-attic.
the class TestBatchInsert method testMore.
@Test
public void testMore() {
BatchInserter graphDb = newBatchInserter();
long startNode = graphDb.createNode(properties);
long[] endNodes = new long[25];
Set<Long> rels = new HashSet<Long>();
for (int i = 0; i < 25; i++) {
endNodes[i] = graphDb.createNode(properties);
rels.add(graphDb.createRelationship(startNode, endNodes[i], relTypeArray[i % 5], properties));
}
for (SimpleRelationship rel : graphDb.getRelationships(startNode)) {
assertTrue(rels.contains(rel.getId()));
assertEquals(rel.getStartNode(), startNode);
}
graphDb.setNodeProperties(startNode, properties);
graphDb.shutdown();
}
use of org.neo4j.kernel.impl.batchinsert.SimpleRelationship in project graphdb by neo4j-attic.
the class TestBatchInsert method testSimple.
@Test
public void testSimple() {
BatchInserter graphDb = newBatchInserter();
long node1 = graphDb.createNode(null);
long node2 = graphDb.createNode(null);
long rel1 = graphDb.createRelationship(node1, node2, RelTypes.BATCH_TEST, null);
SimpleRelationship rel = graphDb.getRelationshipById(rel1);
assertEquals(rel.getStartNode(), node1);
assertEquals(rel.getEndNode(), node2);
assertEquals(RelTypes.BATCH_TEST.name(), rel.getType().name());
graphDb.shutdown();
}
Aggregations