Skip to content

Commit

Permalink
removed the dataset size exercise, it's terrible
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwebber committed Apr 18, 2012
1 parent 65c53fb commit d1eccf1
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/koan/java/org/neo4j/tutorial/Koan08a.java
Expand Up @@ -77,35 +77,6 @@ public void shouldCountTheNumberOfEpisodes()
assertEquals(246l, result.javaColumnAs("count(episodes)").next());
}

@Test
public void shouldSizeTheDoctorWhoDataset()
{
// The Java APIs make it quite easy to brute force count nodes and relationships
// But as of Neo4j 1.7, Cypher can do it too...

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

// YOUR CODE GOES HERE
// SNIPPET_START

cqlNodes = "start nodes=node(*) "//, r=relationship(*) "
+ "return count(nodes)";

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

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

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

assertEquals(3354, items);
}

@Test
public void shouldFindAllTheEpisodesInWhichTheCybermenAppeared() throws Exception
Expand Down

0 comments on commit d1eccf1

Please sign in to comment.