Skip to content

Commit

Permalink
Updated koan and slide deck to 1.6.M03
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwebber committed Jan 13, 2012
1 parent 0c6c190 commit fbc6c69
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 43 deletions.
Binary file modified presentation/A Programmatic Introduction to Neo4j.pptx
Binary file not shown.
10 changes: 5 additions & 5 deletions settings/ivy.xml
Expand Up @@ -2,19 +2,19 @@
<ivy-module xmlns:m="http://ant.apache.org/ivy/maven" version="2.0">
<info organisation="org.neo4j" module="neo4j-koans"/>
<dependencies>
<dependency org="org.neo4j.app" name="neo4j-server" rev="1.6-SNAPSHOT">
<dependency org="org.neo4j.app" name="neo4j-server" rev="1.6.M03">
<artifact name="neo4j-server" ext="jar"/>
<artifact name="neo4j-server" m:classifier="static-web" ext="jar"/>
<artifact name="neo4j-server" m:classifier="tests" ext="jar"/>
<exclude org="org.slf4j" />
</dependency>
<dependency org="org.neo4j" name="server-api" rev="1.6-SNAPSHOT"/>
<dependency org="org.neo4j" name="neo4j-community" rev="1.6-SNAPSHOT"/>
<dependency org="org.neo4j" name="neo4j-kernel" rev="1.6-SNAPSHOT">
<dependency org="org.neo4j" name="server-api" rev="1.6.M03"/>
<dependency org="org.neo4j" name="neo4j-community" rev="1.6.M03"/>
<dependency org="org.neo4j" name="neo4j-kernel" rev="1.6.M03">
<artifact name="neo4j-kernel" ext="jar"/>
<artifact name="neo4j-kernel" m:classifier="tests" ext="jar"/>
</dependency>
<dependency org="org.neo4j" name="neo4j-shell" rev="1.6-SNAPSHOT"/>
<dependency org="org.neo4j" name="neo4j-shell" rev="1.6.M03"/>
<dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="1.7.5"/>
<dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="1.7.5"/>
<dependency org="org.mortbay.jetty" name="jetty" rev="6.1.25"/>
Expand Down
47 changes: 25 additions & 22 deletions src/koan/java/org/neo4j/tutorial/Koan08b.java
Expand Up @@ -170,29 +170,32 @@ public void shouldListTheEnemySpeciesAndCharactersForEachEpisodeWithPeterDavison
// SNIPPET_END

ExecutionResult result = engine.execute(cql);

System.out.println(result.dumpToString() );

assertThat(result.dumpToString(), containsString(
"+----------------------------------------------------------------------------------------------------------+\n" +
"| episode.episode | episode.title | species | characters |\n" +
"+----------------------------------------------------------------------------------------------------------+\n" +
"| 116 | Castrovalva | List(null) | List(Master) |\n" +
"| 118 | Kinda | List(null) | List(Mara) |\n" +
"| 119 | The Visitation | List(null) | List(Terileptils) |\n" +
"| 121 | Earthshock | List(Cyberman) | List(null) |\n" +
"| 122 | Time-Flight | List(null) | List(Master) |\n" +
"| 123 | Arc of Infinity | List(null) | List(Omega) |\n" +
"| 124 | Snakedance | List(null) | List(Mara) |\n" +
"| 125 | Mawdryn Undead | List(null, null) | List(Mawdryn, Black Guardian) |\n" +
"| 126 | Terminus | List(null) | List(Vanir) |\n" +
"| 127 | Enlightenment | List(null) | List(Black Guardian) |\n" +
"| 128 | The King's Demons | List(null) | List(Master) |\n" +
"| 129 | The Five Doctors | List(Dalek, null) | List(null, Master) |\n" +
"| 130 | Warriors of the Deep | List(Silurian, Sea Devil) | List(null, null) |\n" +
"| 131 | The Awakening | List(null) | List(Malus) |\n" +
"| 132 | Frontios | List(Tractator) | List(null) |\n" +
"| 133 | Resurrection of the Daleks | List(Dalek) | List(null) |\n" +
"| 134 | Planet of Fire | List(null) | List(Master) |\n" +
"| 135 | The Caves of Androzani | List(null) | List(Master) |\n" +
"+----------------------------------------------------------------------------------------------------------+"
"+------------------------------------------------------------------------------------------------------------+\n" +
"| episode.episode | episode.title | species | characters |\n" +
"+------------------------------------------------------------------------------------------------------------+\n" +
"| \"116\" | \"Castrovalva\" | List(null) | List(Master) |\n" +
"| \"118\" | \"Kinda\" | List(null) | List(Mara) |\n" +
"| \"119\" | \"The Visitation\" | List(null) | List(Terileptils) |\n" +
"| \"121\" | \"Earthshock\" | List(Cyberman) | List(null) |\n" +
"| \"122\" | \"Time-Flight\" | List(null) | List(Master) |\n" +
"| \"123\" | \"Arc of Infinity\" | List(null) | List(Omega) |\n" +
"| \"124\" | \"Snakedance\" | List(null) | List(Mara) |\n" +
"| \"125\" | \"Mawdryn Undead\" | List(null, null) | List(Mawdryn, Black Guardian) |\n" +
"| \"126\" | \"Terminus\" | List(null) | List(Vanir) |\n" +
"| \"127\" | \"Enlightenment\" | List(null) | List(Black Guardian) |\n" +
"| \"128\" | \"The King's Demons\" | List(null) | List(Master) |\n" +
"| \"129\" | \"The Five Doctors\" | List(Dalek, null) | List(null, Master) |\n" +
"| \"130\" | \"Warriors of the Deep\" | List(Silurian, Sea Devil) | List(null, null) |\n" +
"| \"131\" | \"The Awakening\" | List(null) | List(Malus) |\n" +
"| \"132\" | \"Frontios\" | List(Tractator) | List(null) |\n" +
"| \"133\" | \"Resurrection of the Daleks\" | List(Dalek) | List(null) |\n" +
"| \"134\" | \"Planet of Fire\" | List(null) | List(Master) |\n" +
"| \"135\" | \"The Caves of Androzani\" | List(null) | List(Master) |\n" +
"+------------------------------------------------------------------------------------------------------------+"
));

final List<String> columnNames = result.javaColumns();
Expand Down
@@ -1,16 +1,13 @@
package org.neo4j.tutorial.koan14;

import org.neo4j.cypher.ExecutionEngine;
import org.neo4j.cypher.ExecutionResult;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.server.rest.security.SecurityRule;

import javax.servlet.http.HttpServletRequest;

public class UserNameAndPasswordForSalariesSecurityRule implements SecurityRule
{
@Override
public boolean isAuthorized(HttpServletRequest httpServletRequest, GraphDatabaseService graphDatabaseService)
public boolean isAuthorized(HttpServletRequest httpServletRequest)
{
boolean loggedIn = false;

Expand All @@ -22,18 +19,6 @@ public boolean isAuthorized(HttpServletRequest httpServletRequest, GraphDatabase
"X-Password"));
// SNIPPET_END

ExecutionEngine engine = new ExecutionEngine(graphDatabaseService);
String cql = null;

cql = "start char = node:characters(character = 'Rose Tyler')"
+ "match (char)-[:COMES_FROM]->(planet)"
+ "return planet.planet";

ExecutionResult result = engine.execute(cql);
String planet = (String) result.javaColumnAs("planet.planet").next();

System.out.println(planet);

return loggedIn;
}

Expand Down

0 comments on commit fbc6c69

Please sign in to comment.