Skip to content

Commit

Permalink
Fix the manual
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegrohmann committed Feb 16, 2016
1 parent 2e4fdbe commit 79d1a76
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 64 deletions.
Expand Up @@ -19,15 +19,6 @@
*/ */
package org.neo4j.cypher.example; package org.neo4j.cypher.example;


import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
Expand All @@ -37,6 +28,15 @@
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;


import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.RelationshipType; import org.neo4j.graphdb.RelationshipType;
Expand All @@ -50,16 +50,14 @@
import org.neo4j.visualization.asciidoc.AsciidocHelper; import org.neo4j.visualization.asciidoc.AsciidocHelper;


import static java.util.Arrays.asList; import static java.util.Arrays.asList;

import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.hasItems; import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;

import static org.neo4j.cypher.internal.javacompat.RegularExpressionMatcher.matchesPattern;
import static org.neo4j.cypher.javacompat.RegularExpressionMatcher.matchesPattern;
import static org.neo4j.helpers.collection.IteratorUtil.asIterable; import static org.neo4j.helpers.collection.IteratorUtil.asIterable;
import static org.neo4j.helpers.collection.IteratorUtil.count; import static org.neo4j.helpers.collection.IteratorUtil.count;


Expand Down
Expand Up @@ -19,24 +19,24 @@
*/ */
package org.neo4j.cypher.docgen package org.neo4j.cypher.docgen


import org.neo4j.cypher.internal.RewindableExecutionResult import java.io.{File, PrintWriter, StringWriter}
import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult
import org.neo4j.graphdb.index.Index
import org.junit.Test import org.junit.Test
import scala.collection.JavaConverters._ import org.neo4j.cypher._
import java.io.{StringWriter, File, PrintWriter} import org.neo4j.cypher.export.{DatabaseSubGraph, SubGraphExporter}
import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult
import org.neo4j.cypher.internal.compiler.v3_0.prettifier.Prettifier
import org.neo4j.cypher.internal.javacompat.GraphImpl
import org.neo4j.cypher.internal.{ExecutionEngine, RewindableExecutionResult}
import org.neo4j.graphdb._ import org.neo4j.graphdb._
import org.neo4j.graphdb.index.Index
import org.neo4j.kernel.GraphDatabaseAPI
import org.neo4j.test.GraphDatabaseServiceCleaner.cleanDatabaseContent
import org.neo4j.test.{AsciiDocGenerator, GraphDescription, TestGraphDatabaseFactory}
import org.neo4j.visualization.asciidoc.AsciidocHelper import org.neo4j.visualization.asciidoc.AsciidocHelper
import org.neo4j.cypher.javacompat.GraphImpl
import org.neo4j.cypher._
import export.{DatabaseSubGraph, SubGraphExporter}
import org.neo4j.test.{ImpermanentGraphDatabase, TestGraphDatabaseFactory, GraphDescription}
import org.scalatest.Assertions import org.scalatest.Assertions
import org.neo4j.test.AsciiDocGenerator
import org.neo4j.test.GraphDatabaseServiceCleaner.cleanDatabaseContent import scala.collection.JavaConverters._
import org.neo4j.kernel.GraphDatabaseAPI
import org.neo4j.tooling.GlobalGraphOperations
import org.neo4j.cypher.internal.compiler.v3_0.prettifier.Prettifier


/* /*
Use this base class for tests that are more flowing text with queries intersected in the middle of the text. Use this base class for tests that are more flowing text with queries intersected in the middle of the text.
Expand Down
Expand Up @@ -29,22 +29,21 @@ import org.neo4j.cypher.example.JavaExecutionEngineDocTest
import org.neo4j.cypher.export.{DatabaseSubGraph, SubGraphExporter} import org.neo4j.cypher.export.{DatabaseSubGraph, SubGraphExporter}
import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult
import org.neo4j.cypher.internal.compiler.v3_0.prettifier.Prettifier import org.neo4j.cypher.internal.compiler.v3_0.prettifier.Prettifier
import org.neo4j.cypher.internal.helpers.GraphIcing
import org.neo4j.cypher.internal.frontend.v3_0.helpers.Eagerly import org.neo4j.cypher.internal.frontend.v3_0.helpers.Eagerly
import org.neo4j.cypher.internal.{RewindableExecutionResult, ServerExecutionEngine} import org.neo4j.cypher.internal.helpers.GraphIcing
import org.neo4j.cypher.javacompat.GraphImpl import org.neo4j.cypher.internal.javacompat.GraphImpl
import org.neo4j.cypher.internal.{ExecutionEngine, RewindableExecutionResult}
import org.neo4j.graphdb._ import org.neo4j.graphdb._
import org.neo4j.graphdb.factory.{GraphDatabaseFactory, GraphDatabaseSettings} import org.neo4j.graphdb.factory.GraphDatabaseSettings
import org.neo4j.graphdb.index.Index import org.neo4j.graphdb.index.Index
import org.neo4j.kernel.configuration.Settings
import org.neo4j.kernel.GraphDatabaseAPI import org.neo4j.kernel.GraphDatabaseAPI
import org.neo4j.kernel.configuration.Settings
import org.neo4j.kernel.impl.api.KernelStatement import org.neo4j.kernel.impl.api.KernelStatement
import org.neo4j.kernel.impl.api.index.IndexingService import org.neo4j.kernel.impl.api.index.IndexingService
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingMode import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingMode
import org.neo4j.kernel.impl.core.ThreadToStatementContextBridge import org.neo4j.kernel.impl.core.ThreadToStatementContextBridge
import org.neo4j.test.GraphDatabaseServiceCleaner.cleanDatabaseContent import org.neo4j.test.GraphDatabaseServiceCleaner.cleanDatabaseContent
import org.neo4j.test.{AsciiDocGenerator, GraphDescription, TestGraphDatabaseFactory} import org.neo4j.test.{AsciiDocGenerator, GraphDescription, TestGraphDatabaseFactory}
import org.neo4j.tooling.GlobalGraphOperations
import org.neo4j.visualization.asciidoc.AsciidocHelper import org.neo4j.visualization.asciidoc.AsciidocHelper
import org.neo4j.visualization.graphviz.{AsciiDocStyle, GraphStyle, GraphvizWriter} import org.neo4j.visualization.graphviz.{AsciiDocStyle, GraphStyle, GraphvizWriter}
import org.neo4j.walk.Walker import org.neo4j.walk.Walker
Expand Down Expand Up @@ -332,7 +331,7 @@ abstract class DocumentingTestBase extends JUnitSuite with DocumentationHelper w
} }


var db: GraphDatabaseAPI = null var db: GraphDatabaseAPI = null
var engine: ServerExecutionEngine = null var engine: ExecutionEngine = null
var nodeMap: Map[String, Long] = null var nodeMap: Map[String, Long] = null
var nodeIndex: Index[Node] = null var nodeIndex: Index[Node] = null
var relIndex: Index[Relationship] = null var relIndex: Index[Relationship] = null
Expand Down Expand Up @@ -446,7 +445,7 @@ abstract class DocumentingTestBase extends JUnitSuite with DocumentationHelper w
setConfig(GraphDatabaseSettings.node_keys_indexable, "name"). setConfig(GraphDatabaseSettings.node_keys_indexable, "name").
setConfig(GraphDatabaseSettings.node_auto_indexing, Settings.TRUE). setConfig(GraphDatabaseSettings.node_auto_indexing, Settings.TRUE).
newGraphDatabase().asInstanceOf[GraphDatabaseAPI] newGraphDatabase().asInstanceOf[GraphDatabaseAPI]
engine = new ServerExecutionEngine(db) engine = new ExecutionEngine(db)


softReset() softReset()
} }
Expand Down
Expand Up @@ -38,7 +38,7 @@ package org.neo4j.cypher.docgen.tooling
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import org.neo4j.cypher.ExecutionEngine import org.neo4j.cypher.internal.ExecutionEngine
import org.neo4j.graphdb.GraphDatabaseService import org.neo4j.graphdb.GraphDatabaseService
import org.neo4j.test.TestGraphDatabaseFactory import org.neo4j.test.TestGraphDatabaseFactory


Expand Down
Expand Up @@ -19,7 +19,7 @@
*/ */
package org.neo4j.cypher.docgen.tooling.tests package org.neo4j.cypher.docgen.tooling.tests


import org.neo4j.cypher.ExecutionEngine import org.neo4j.cypher.internal.ExecutionEngine
import org.neo4j.cypher.docgen.tooling._ import org.neo4j.cypher.docgen.tooling._
import org.neo4j.cypher.internal.RewindableExecutionResult import org.neo4j.cypher.internal.RewindableExecutionResult
import org.neo4j.cypher.internal.frontend.v3_0.test_helpers.CypherFunSuite import org.neo4j.cypher.internal.frontend.v3_0.test_helpers.CypherFunSuite
Expand Down
Expand Up @@ -56,7 +56,7 @@ public DocsExecutionEngine( GraphDatabaseService database, LogProvider logProvid
} }


protected protected
org.neo4j.cypher.ExecutionEngine createInnerEngine( GraphDatabaseService database, LogProvider logProvider ) org.neo4j.cypher.internal.ExecutionEngine createInnerEngine( GraphDatabaseService database, LogProvider logProvider )
{ {
return new org.neo4j.cypher.internal.DocsExecutionEngine( database, logProvider, null, null ); return new org.neo4j.cypher.internal.DocsExecutionEngine( database, logProvider, null, null );
} }
Expand All @@ -70,7 +70,7 @@ org.neo4j.cypher.ExecutionEngine createInnerEngine( GraphDatabaseService databas
*/ */
public InternalExecutionResult execute( String query ) throws CypherException public InternalExecutionResult execute( String query ) throws CypherException
{ {
return (InternalExecutionResult) inner.internalExecute( query, Collections.<String, Object> emptyMap() ); return inner.internalExecute( query, Collections.<String, Object> emptyMap() );
} }


/** /**
Expand All @@ -83,7 +83,7 @@ public InternalExecutionResult execute( String query ) throws CypherException
*/ */
public InternalExecutionResult execute( String query, Map<String,Object> params ) throws CypherException public InternalExecutionResult execute( String query, Map<String,Object> params ) throws CypherException
{ {
return (InternalExecutionResult) inner.internalExecute( query, params ); return inner.internalExecute( query, params );
} }


/** /**
Expand All @@ -99,7 +99,7 @@ public InternalExecutionResult execute( String query, Map<String,Object> params
*/ */
public InternalExecutionResult profile( String query ) throws CypherException public InternalExecutionResult profile( String query ) throws CypherException
{ {
return (InternalExecutionResult) inner.internalProfile( query, Collections.<String, Object> emptyMap() ); return inner.internalProfile( query, Collections.<String, Object> emptyMap() );
} }


/** /**
Expand All @@ -116,7 +116,7 @@ public InternalExecutionResult profile( String query ) throws CypherException
*/ */
public InternalExecutionResult profile( String query, Map<String,Object> params ) throws CypherException public InternalExecutionResult profile( String query, Map<String,Object> params ) throws CypherException
{ {
return (InternalExecutionResult) inner.internalProfile( query, params ); return inner.internalProfile( query, params );
} }


/** /**
Expand Down
Expand Up @@ -21,8 +21,8 @@ package org.neo4j.cypher.internal


import java.util.{Map => JavaMap} import java.util.{Map => JavaMap}


import org.neo4j.cypher.SyntaxException
import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult
import org.neo4j.cypher.{ExecutionEngine, SyntaxException}
import org.neo4j.graphdb.GraphDatabaseService import org.neo4j.graphdb.GraphDatabaseService
import org.neo4j.kernel.impl.query.{QueryExecutionMonitor, QuerySession} import org.neo4j.kernel.impl.query.{QueryExecutionMonitor, QuerySession}
import org.neo4j.logging.{LogProvider, NullLogProvider} import org.neo4j.logging.{LogProvider, NullLogProvider}
Expand Down
Expand Up @@ -19,26 +19,24 @@
*/ */
package org.neo4j.cypher.docgen package org.neo4j.cypher.docgen


import java.io.{File, FileOutputStream, OutputStreamWriter, PrintWriter, Writer}
import java.nio.charset.StandardCharsets import java.nio.charset.StandardCharsets


import org.neo4j.cypher.internal.RewindableExecutionResult import org.junit.{After, Before, Test}
import org.neo4j.cypher._
import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult
import org.neo4j.cypher.internal.compiler.v3_0.prettifier.Prettifier import org.neo4j.cypher.internal.compiler.v3_0.prettifier.Prettifier
import org.neo4j.graphdb.index.Index import org.neo4j.cypher.internal.helpers.GraphIcing
import org.junit.Test import org.neo4j.cypher.internal.javacompat.GraphImpl
import scala.collection.JavaConverters._ import org.neo4j.cypher.internal.{ExecutionEngine, ExecutionResult, RewindableExecutionResult}
import java.io.{ File, FileOutputStream, OutputStreamWriter, PrintWriter, Writer }
import org.neo4j.graphdb._ import org.neo4j.graphdb._
import org.neo4j.graphdb.index.Index
import org.neo4j.kernel.GraphDatabaseAPI import org.neo4j.kernel.GraphDatabaseAPI
import org.neo4j.test.{GraphDatabaseServiceCleaner, GraphDescription, TestGraphDatabaseFactory}
import org.neo4j.visualization.asciidoc.AsciidocHelper import org.neo4j.visualization.asciidoc.AsciidocHelper
import org.neo4j.cypher.javacompat.GraphImpl
import org.neo4j.cypher._
import org.neo4j.test.{GraphDatabaseServiceCleaner, ImpermanentGraphDatabase, TestGraphDatabaseFactory,
GraphDescription}
import org.scalatest.Assertions import org.scalatest.Assertions
import org.junit.Before
import org.junit.After import scala.collection.JavaConverters._
import org.neo4j.cypher.internal.helpers.GraphIcing


/* /*
Use this base class for refcard tests Use this base class for refcard tests
Expand Down
Expand Up @@ -19,9 +19,9 @@
*/ */
package org.neo4j.cypher.docgen.refcard package org.neo4j.cypher.docgen.refcard


import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult import org.neo4j.cypher.QueryStatisticsTestSupport
import org.neo4j.cypher.{ ExecutionResult, QueryStatisticsTestSupport }
import org.neo4j.cypher.docgen.RefcardTest import org.neo4j.cypher.docgen.RefcardTest
import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult


class AggregationTest extends RefcardTest with QueryStatisticsTestSupport { class AggregationTest extends RefcardTest with QueryStatisticsTestSupport {
val graphDescription = List("ROOT KNOWS A", "A KNOWS B", "B KNOWS C", "C KNOWS ROOT") val graphDescription = List("ROOT KNOWS A", "A KNOWS B", "B KNOWS C", "C KNOWS ROOT")
Expand Down
Expand Up @@ -19,12 +19,12 @@
*/ */
package org.neo4j.cypher.docgen.refcard package org.neo4j.cypher.docgen.refcard


import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult
import org.neo4j.cypher.{ ExecutionResult, QueryStatisticsTestSupport }
import org.neo4j.cypher.docgen.RefcardTest
import org.neo4j.graphdb.DynamicLabel
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit


import org.neo4j.cypher.QueryStatisticsTestSupport
import org.neo4j.cypher.docgen.RefcardTest
import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult

class IndexTest extends RefcardTest with QueryStatisticsTestSupport { class IndexTest extends RefcardTest with QueryStatisticsTestSupport {
val graphDescription = List("A:Person KNOWS B:Person") val graphDescription = List("A:Person KNOWS B:Person")
val title = "INDEX" val title = "INDEX"
Expand Down
Expand Up @@ -19,9 +19,9 @@
*/ */
package org.neo4j.cypher.docgen.refcard package org.neo4j.cypher.docgen.refcard


import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult import org.neo4j.cypher.QueryStatisticsTestSupport
import org.neo4j.cypher.{ ExecutionResult, QueryStatisticsTestSupport }
import org.neo4j.cypher.docgen.RefcardTest import org.neo4j.cypher.docgen.RefcardTest
import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult


class LabelsTest extends RefcardTest with QueryStatisticsTestSupport { class LabelsTest extends RefcardTest with QueryStatisticsTestSupport {
val graphDescription = List("A:Person KNOWS ROOT") val graphDescription = List("A:Person KNOWS ROOT")
Expand Down
Expand Up @@ -19,9 +19,9 @@
*/ */
package org.neo4j.cypher.docgen.refcard package org.neo4j.cypher.docgen.refcard


import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult import org.neo4j.cypher.QueryStatisticsTestSupport
import org.neo4j.cypher.{ ExecutionResult, QueryStatisticsTestSupport }
import org.neo4j.cypher.docgen.RefcardTest import org.neo4j.cypher.docgen.RefcardTest
import org.neo4j.cypher.internal.compiler.v3_0.executionplan.InternalExecutionResult


class PathFunctionsTest extends RefcardTest with QueryStatisticsTestSupport { class PathFunctionsTest extends RefcardTest with QueryStatisticsTestSupport {
val graphDescription = List("ROOT KNOWS A", "A:Person KNOWS B:Person", "B KNOWS C:Person", "C KNOWS ROOT") val graphDescription = List("ROOT KNOWS A", "A:Person KNOWS B:Person", "B KNOWS C:Person", "C KNOWS ROOT")
Expand Down

0 comments on commit 79d1a76

Please sign in to comment.