Skip to content

Commit

Permalink
Tidying up koan08a after a sed and snippet processing problem
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwebber committed Apr 18, 2012
1 parent 4a744a0 commit 65c53fb
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/koan/java/org/neo4j/tutorial/Koan08a.java
Expand Up @@ -84,27 +84,25 @@ public void shouldSizeTheDoctorWhoDataset()
// But as of Neo4j 1.7, Cypher can do it too...

ExecutionEngine engine = new ExecutionEngine(universe.getDatabase());
String cql = null;
String cqlNodes = null;
String cqlRels = null;
long items = 0;

// YOUR CODE GOES HERE
// SNIPPET_START

cql = "start nodes=node(*) "//, r=relationship(*) "
cqlNodes = "start nodes=node(*) "//, r=relationship(*) "
+ "return count(nodes)";
ExecutionResult result = engine.execute(cql);
items += ((Long)result.javaColumnAs("count(nodes)").next()).longValue();

cql = "start rels=relationship(*) "
cqlRels = "start rels=relationship(*) "
+ "return count(rels)";

// SNIPPET_END
ExecutionResult nodesResult = engine.execute(cqlNodes);
items += ((Long)nodesResult .javaColumnAs("count(nodes)").next()).longValue();

result = engine.execute(cql);
items += ((Long)result.javaColumnAs("count(rels)").next()).longValue();



ExecutionResult relsResult = engine.execute(cqlRels);
items += ((Long)relsResult.javaColumnAs("count(rels)").next()).longValue();

assertEquals(3354, items);
}
Expand Down

0 comments on commit 65c53fb

Please sign in to comment.