From 6685e523ae59f0074a3b0a074ef01ae15f694a44 Mon Sep 17 00:00:00 2001 From: Satia Herfert Date: Wed, 20 Jun 2018 17:56:34 +0200 Subject: [PATCH] Change CypherComparisonSupport Change Acceptance tests accordingly. --- .../NotificationAcceptanceTest.java | 38 ++++++------------- .../BuiltInProcedureAcceptanceTest.scala | 2 +- ...teUniquenessConstraintAcceptanceTest.scala | 4 +- .../acceptance/CreateAcceptanceTest.scala | 2 +- .../acceptance/CypherComparisonSupport.scala | 27 +++++++------ .../acceptance/ExecutionEngineTest.scala | 9 ++--- .../acceptance/ForeachAcceptanceTest.scala | 2 +- .../acceptance/HintAcceptanceTest.scala | 12 +++--- .../acceptance/JoinAcceptanceTest.scala | 4 +- ...ionsBackedByCountStoreAcceptanceTest.scala | 28 +++++++------- .../acceptance/MiscAcceptanceTest.scala | 2 +- .../NotificationAcceptanceTest.scala | 8 ++-- .../ParameterValuesAcceptanceTest.scala | 12 +++--- .../QueryPlanCompactionAcceptanceTest.scala | 14 +++---- .../ShortestPathSameNodeAcceptanceTest.scala | 4 +- .../SpatialDistanceAcceptanceTest.scala | 6 +-- .../SpatialFunctionsAcceptanceTest.scala | 18 ++++----- .../SpatialIndexResultsAcceptanceTest.scala | 18 ++++----- .../acceptance/StartAcceptanceTest.scala | 6 +-- .../acceptance/TemporalAcceptanceTest.scala | 8 ++-- .../TemporalFunctionsAcceptanceTest.scala | 2 +- .../acceptance/UsingAcceptanceTest.scala | 6 +-- .../javacompat/ExecutionResultTest.java | 18 ++++----- .../cypher/CypherCompatibilityTest.scala | 6 +-- 24 files changed, 115 insertions(+), 141 deletions(-) diff --git a/community/community-it/cypher-it/src/test/java/org/neo4j/cypher/internal/javacompat/NotificationAcceptanceTest.java b/community/community-it/cypher-it/src/test/java/org/neo4j/cypher/internal/javacompat/NotificationAcceptanceTest.java index 79e0db65de717..dc65260dce150 100644 --- a/community/community-it/cypher-it/src/test/java/org/neo4j/cypher/internal/javacompat/NotificationAcceptanceTest.java +++ b/community/community-it/cypher-it/src/test/java/org/neo4j/cypher/internal/javacompat/NotificationAcceptanceTest.java @@ -26,19 +26,8 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; - -import org.neo4j.graphdb.InputPosition; +import org.neo4j.graphdb.*; import org.neo4j.graphdb.Notification; -import org.neo4j.graphdb.QueryExecutionException; -import org.neo4j.graphdb.Result; -import org.neo4j.graphdb.SeverityLevel; -import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.impl.notification.NotificationCode; import org.neo4j.graphdb.impl.notification.NotificationDetail; import org.neo4j.helpers.collection.Iterables; @@ -47,22 +36,19 @@ import org.neo4j.procedure.Procedure; import org.neo4j.test.rule.ImpermanentDatabaseRule; -import static org.hamcrest.Matchers.any; -import static org.hamcrest.Matchers.contains; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.empty; -import static org.hamcrest.Matchers.equalTo; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Stream; + +import static org.hamcrest.Matchers.*; import static org.junit.Assert.assertThat; import static org.neo4j.graphdb.Label.label; -import static org.neo4j.graphdb.impl.notification.NotificationCode.CREATE_UNIQUE_UNAVAILABLE_FALLBACK; -import static org.neo4j.graphdb.impl.notification.NotificationCode.EAGER_LOAD_CSV; -import static org.neo4j.graphdb.impl.notification.NotificationCode.INDEX_HINT_UNFULFILLABLE; -import static org.neo4j.graphdb.impl.notification.NotificationCode.LENGTH_ON_NON_PATH; -import static org.neo4j.graphdb.impl.notification.NotificationCode.RULE_PLANNER_UNAVAILABLE_FALLBACK; -import static org.neo4j.graphdb.impl.notification.NotificationCode.RUNTIME_UNSUPPORTED; -import static org.neo4j.graphdb.impl.notification.NotificationCode.UNBOUNDED_SHORTEST_PATH; +import static org.neo4j.graphdb.impl.notification.NotificationCode.*; import static org.neo4j.graphdb.impl.notification.NotificationDetail.Factory.index; + public class NotificationAcceptanceTest { @@ -132,14 +118,14 @@ public void shouldNotifyWhenUsingCreateUniqueWhenCypherVersionIs3_5() } @Test - public void shouldGetErrorWhenUsingCreateUniqueWhenCypherVersionIs3_3() + public void shouldGetErrorWhenUsingCreateUniqueWhenCypherVersionIs3_4() { // expect exception thrown.expect( QueryExecutionException.class ); thrown.expectMessage( "CREATE UNIQUE is no longer supported. You can achieve the same result using MERGE"); // when - db().execute( "CYPHER 3.3 MATCH (b) WITH b LIMIT 1 CREATE UNIQUE (b)-[:REL]->()" ); + db().execute( "CYPHER 3.4 MATCH (b) WITH b LIMIT 1 CREATE UNIQUE (b)-[:REL]->()" ); } @Test diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/BuiltInProcedureAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/BuiltInProcedureAcceptanceTest.scala index 3bfa6437bcee7..4a27dac5d1174 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/BuiltInProcedureAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/BuiltInProcedureAcceptanceTest.scala @@ -286,7 +286,7 @@ class BuiltInProcedureAcceptanceTest extends ProcedureCallAcceptanceTest with Cy } test("yield from void procedure should return correct error msg") { - failWithError(Configs.Procs + Configs.Version3_5 + Configs.Version3_3 - Configs.AllRulePlanners, + failWithError(Configs.Procs + Configs.Version3_5 + Configs.Version3_4 - Configs.AllRulePlanners, "CALL db.createLabel('Label') yield node", List("Cannot yield value from void procedure.")) } diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CompositeUniquenessConstraintAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CompositeUniquenessConstraintAcceptanceTest.scala index a89dba3fe378d..f0cbf0f188b29 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CompositeUniquenessConstraintAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CompositeUniquenessConstraintAcceptanceTest.scala @@ -23,7 +23,7 @@ package org.neo4j.internal.cypher.acceptance import org.neo4j.cypher._ -import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Versions.{Default, V3_3, v3_5} +import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Versions.{Default, V3_4, v3_5} import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport._ class CompositeUniquenessConstraintAcceptanceTest extends ExecutionEngineFunSuite with CypherComparisonSupport { @@ -45,7 +45,7 @@ class CompositeUniquenessConstraintAcceptanceTest extends ExecutionEngineFunSuit } val singlePropertyUniquenessFailConf = - TestConfiguration(Versions(v3_5, V3_3, Default), Planners(Planners.Default, Planners.Cost), Runtimes.all) + TestConfiguration(Versions(v3_5, V3_4, Default), Planners(Planners.Default, Planners.Cost), Runtimes.all) test("should fail to to create composite uniqueness constraints") { // When diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CreateAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CreateAcceptanceTest.scala index 181f9e5616fb1..a15985c516bad 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CreateAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CreateAcceptanceTest.scala @@ -37,7 +37,7 @@ class CreateAcceptanceTest extends ExecutionEngineFunSuite with QueryStatisticsT private val BIG_N = 1000 private val BIG_CREATE_CONFIGS = TestConfiguration(Versions.Default, Planners.Default, Runtimes(Runtimes.Interpreted, Runtimes.Slotted)) + - TestConfiguration(Versions.V3_3, Planners.Default, Runtimes(Runtimes.Interpreted)) + TestConfiguration(Versions.V3_4, Planners.Default, Runtimes(Runtimes.Interpreted)) test("handle big CREATE clause") { var query = "CREATE (x)" diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CypherComparisonSupport.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CypherComparisonSupport.scala index 44a569f2cdd02..756e2d8ed272e 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CypherComparisonSupport.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/CypherComparisonSupport.scala @@ -352,7 +352,7 @@ object CypherComparisonSupport { } object Versions { - val orderedVersions: Seq[Version] = Seq(V2_3, V3_1, V3_3, v3_5) + val orderedVersions: Seq[Version] = Seq(V2_3, V3_1, V3_4, v3_5) implicit def versionToVersions(version: Version): Versions = Versions(version) @@ -364,16 +364,16 @@ object CypherComparisonSupport { object V3_1 extends Version("3.1") - object V3_3 extends Version("3.3") { - // 3.3 has 3.5 runtime + object V3_4 extends Version("3.4") { + // 3.4 has 3.5 runtime override val acceptedRuntimeVersionNames = Set("3.5") } object v3_5 extends Version("3.5") object Default extends Version("") { - override val acceptedRuntimeVersionNames = Set("2.3", "3.1", "3.3", "3.5") - override val acceptedPlannerVersionNames = Set("2.3", "3.1", "3.3", "3.5") + override val acceptedRuntimeVersionNames = Set("2.3", "3.1", "3.4", "3.5") + override val acceptedPlannerVersionNames = Set("2.3", "3.1", "3.4", "3.5") } } @@ -599,13 +599,13 @@ object CypherComparisonSupport { TestConfiguration(Versions.Default, Planners.Default, Runtimes(Runtimes.Interpreted, Runtimes.Slotted)) + TestConfiguration(Versions.V2_3 -> Versions.V3_1, Planners.all, Runtimes.Default) + TestScenario(Versions.Default, Planners.Rule, Runtimes.Default) + - TestScenario(Versions.V3_3, Planners.Cost, Runtimes.Default) + TestScenario(Versions.V3_4, Planners.Cost, Runtimes.Default) def CommunityInterpreted: TestConfiguration = TestScenario(Versions.Default, Planners.Default, Runtimes.Interpreted) + TestConfiguration(Versions.V2_3 -> Versions.V3_1, Planners.all, Runtimes.Default) + TestScenario(Versions.Default, Planners.Rule, Runtimes.Default) + - TestScenario(Versions.V3_3, Planners.Cost, Runtimes.Default) + TestScenario(Versions.V3_4, Planners.Cost, Runtimes.Default) def SlottedInterpreted: TestConfiguration = TestScenario(Versions.Default, Planners.Default, Runtimes.Slotted) @@ -615,9 +615,10 @@ object CypherComparisonSupport { def Cost3_1: TestConfiguration = TestScenario(Versions.V3_1, Planners.Cost, Runtimes.Default) - def Cost3_3: TestConfiguration = TestScenario(Versions.V3_3, Planners.Cost, Runtimes.Default) + def Cost3_4: TestConfiguration = TestScenario(Versions.V3_4, Planners.Cost, Runtimes.Default) - def Cost3_4: TestConfiguration = TestScenario(Versions.v3_5, Planners.Cost, Runtimes.Default) + // FIXME that guy no works. Not part of AbsolutelyAll + def Cost3_5: TestConfiguration = TestScenario(Versions.v3_5, Planners.Cost, Runtimes.Default) def Rule2_3: TestConfiguration = TestScenario(Versions.V2_3, Planners.Rule, Runtimes.Default) @@ -629,7 +630,7 @@ object CypherComparisonSupport { def Version3_1: TestConfiguration = TestConfiguration(Versions.V3_1, Planners.all, Runtimes.Default) - def Version3_3: TestConfiguration = TestConfiguration(Versions.V3_3, Planners.Cost, Runtimes.Default) + def Version3_4: TestConfiguration = TestConfiguration(Versions.V3_4, Planners.Cost, Runtimes.Default) def Version3_5: TestConfiguration = TestConfiguration(Versions.v3_5, Planners.Cost, Runtimes(Runtimes.CompiledSource, Runtimes.CompiledBytecode)) + @@ -639,7 +640,7 @@ object CypherComparisonSupport { def AllRulePlanners: TestConfiguration = TestConfiguration(Versions(Versions.V2_3, Versions.V3_1, Versions.Default), Planners.Rule, Runtimes.Default) def BackwardsCompatibility: TestConfiguration = TestConfiguration(Versions.V2_3 -> Versions.V3_1, Planners.all, Runtimes.Default) + - TestScenario(Versions.V3_3, Planners.Cost, Runtimes.Default) + TestScenario(Versions.V3_4, Planners.Cost, Runtimes.Default) def Procs: TestConfiguration = TestScenario(Versions.Default, Planners.Default, Runtimes.ProcedureOrSchema) @@ -661,8 +662,6 @@ object CypherComparisonSupport { */ def All: TestConfiguration = AbsolutelyAll - Procs - def AllExceptSlotted: TestConfiguration = All - SlottedInterpreted - /** * These are all configurations that will be executed even if not explicitly expected to succeed or fail. * Even if not explicitly requested, they are executed to check if they unexpectedly succeed to make sure that @@ -674,7 +673,7 @@ object CypherComparisonSupport { Runtimes.ProcedureOrSchema)) + TestConfiguration(Versions.V2_3 -> Versions.V3_1, Planners.all, Runtimes.Default) + TestScenario(Versions.Default, Planners.Rule, Runtimes.Default) + - TestScenario(Versions.V3_3, Planners.Cost, Runtimes.Default) + TestScenario(Versions.V3_4, Planners.Cost, Runtimes.Default) /** * These experimental configurations will only be executed if you explicitly specify them in the test expectation. diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ExecutionEngineTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ExecutionEngineTest.scala index 2c657263191ab..b93c236e8ce3d 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ExecutionEngineTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ExecutionEngineTest.scala @@ -27,8 +27,6 @@ import java.io.{File, PrintWriter} import org.neo4j.cypher.ExecutionEngineHelper.createEngine import org.neo4j.cypher._ import org.neo4j.cypher.internal.ExecutionEngine -import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase -import org.neo4j.cypher.internal.javacompat.GraphDatabaseCypherService import org.neo4j.cypher.internal.runtime.CreateTempFileTestSupport import org.neo4j.cypher.internal.tracing.TimingCompilationTracer import org.neo4j.cypher.internal.tracing.TimingCompilationTracer.QueryEvent @@ -36,21 +34,22 @@ import org.neo4j.graphdb._ import org.neo4j.graphdb.config.Setting import org.neo4j.graphdb.factory.GraphDatabaseSettings import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Runtimes.ProcedureOrSchema -import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Versions.{V2_3, V3_1, v3_5} +import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Versions.{V3_1, v3_5} import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport._ +import org.neo4j.internal.kernel.api.Transaction.Type import org.neo4j.io.fs.FileUtils import org.neo4j.kernel.NeoStoreDataSource -import org.neo4j.internal.kernel.api.Transaction.Type import org.neo4j.kernel.api.security.AnonymousContext import org.neo4j.kernel.impl.coreapi.TopLevelTransaction import org.neo4j.test.{TestEnterpriseGraphDatabaseFactory, TestGraphDatabaseFactory} +import org.opencypher.v9_0.frontend.phases.CompilationPhaseTracer.CompilationPhase import scala.collection.JavaConverters._ import scala.collection.mutable class ExecutionEngineTest extends ExecutionEngineFunSuite with QueryStatisticsTestSupport with CreateTempFileTestSupport with CypherComparisonSupport { - private val startConf = Configs.CommunityInterpreted - Configs.Version3_3 + private val startConf = Configs.CommunityInterpreted - Configs.Version3_4 test("shouldGetRelationshipById") { val n = createNode() diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ForeachAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ForeachAcceptanceTest.scala index dda7170f66f4d..f519d33ac2e72 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ForeachAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ForeachAcceptanceTest.scala @@ -198,7 +198,7 @@ class ForeachAcceptanceTest extends ExecutionEngineFunSuite with CypherCompariso // when val config = TestConfiguration(Versions.Default, Planners.Default, Runtimes(Runtimes.Interpreted, Runtimes.Slotted, Runtimes.ProcedureOrSchema)) + - TestConfiguration(Versions(Versions.V3_1, Versions.V3_3), Planners.Cost, Runtimes.Default) + TestConfiguration(Versions(Versions.V3_1, Versions.V3_4), Planners.Cost, Runtimes.Default) failWithError(config, query, List("Expected to find a node at")) } diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/HintAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/HintAcceptanceTest.scala index 2d06adb23ac3e..1d169c1e8ca44 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/HintAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/HintAcceptanceTest.scala @@ -50,7 +50,7 @@ class HintAcceptanceTest |USING JOIN ON a |RETURN a.name, b.name""".stripMargin - executeWith(Configs.Interpreted + Configs.Version3_3 - Configs.Cost2_3 - Configs.Cost3_1, query, + executeWith(Configs.Interpreted + Configs.Version3_4 - Configs.Cost2_3 - Configs.Cost3_1, query, planComparisonStrategy = ComparePlansWithAssertion((p) => { p should useOperators("NodeLeftOuterHashJoin") p should not(useOperators("NodeHashJoin")) @@ -72,7 +72,7 @@ class HintAcceptanceTest executeWith(Configs.Interpreted - Configs.Cost2_3 - Configs.Cost3_1, query, planComparisonStrategy = ComparePlansWithAssertion((p) => { p should useOperators("NodeRightOuterHashJoin") p should not(useOperators("NodeHashJoin")) - }, expectPlansToFail = Configs.AllRulePlanners + Configs.BackwardsCompatibility)) + }, expectPlansToFail = Configs.AllRulePlanners + Configs.Cost2_3 + Configs.Cost3_1)) } test("should solve join hint on 1 variable with join on more, if possible") { @@ -84,12 +84,10 @@ class HintAcceptanceTest |USING JOIN ON pB |RETURN *""".stripMargin - // TODO: Once 3.3 comes out with the same bugfix, we should change the following lines to not exclude 3.3 - val cost3_3 = TestScenario(Versions.V3_3, Planners.Cost, Runtimes.Default) executeWith(Configs.Interpreted - Configs.Cost2_3 - Configs.Cost3_1, query, planComparisonStrategy = ComparePlansWithAssertion((p) => { p should useOperators("NodeRightOuterHashJoin") - }, expectPlansToFail = Configs.AllRulePlanners + Configs.Cost2_3 + Configs.Cost3_1 + cost3_3)) + }, expectPlansToFail = Configs.AllRulePlanners + Configs.Cost2_3 + Configs.Cost3_1)) } test("should do index seek instead of index scan with explicit index seek hint") { @@ -113,7 +111,7 @@ class HintAcceptanceTest |RETURN a.prop, b.prop """.stripMargin - executeWith(Configs.Interpreted - Configs.OldAndRule + Configs.Cost3_3, query, + executeWith(Configs.Interpreted - Configs.AllRulePlanners - Configs.Cost2_3 - Configs.Cost3_1, query, planComparisonStrategy = ComparePlansWithAssertion((p) => { p should useOperatorTimes("NodeIndexSeek", 2) }, expectPlansToFail = Configs.AllRulePlanners + Configs.Cost2_3 + Configs.Cost3_1)) @@ -136,7 +134,7 @@ class HintAcceptanceTest |AND date("2017-01-01") <= r.date <= date("2018-01-01") |RETURN COUNT(*)""".stripMargin - val result = executeWith(Configs.Version3_5 - Configs.Compiled - Configs.AllRulePlanners, query) + val result = executeWith(Configs.Version3_5 + Configs.Version3_4 - Configs.Compiled - Configs.AllRulePlanners, query) // Then result.toList should be(List(Map("COUNT(*)" -> 1))) diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/JoinAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/JoinAcceptanceTest.scala index 2086cf13f9e65..550ae00d5011a 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/JoinAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/JoinAcceptanceTest.scala @@ -89,7 +89,7 @@ class JoinAcceptanceTest extends ExecutionEngineFunSuite with CypherComparisonSu val expectSucceed = Configs.Interpreted - Configs.Cost2_3 - Configs.Cost3_1 executeWith(expectSucceed, query, - planComparisonStrategy = ComparePlansWithAssertion(_ should useOperators("NodeRightOuterHashJoin"), Configs.AllRulePlanners + Configs.BackwardsCompatibility)) + planComparisonStrategy = ComparePlansWithAssertion(_ should useOperators("NodeRightOuterHashJoin"), Configs.AllRulePlanners + Configs.Cost2_3 + Configs.Cost3_1)) } test("should handle node left outer hash join with different types for the node variable") { @@ -127,7 +127,7 @@ class JoinAcceptanceTest extends ExecutionEngineFunSuite with CypherComparisonSu val expectSucceed = Configs.Interpreted - Configs.Cost2_3 - Configs.Cost3_1 val result = executeWith(expectSucceed, query, - planComparisonStrategy = ComparePlansWithAssertion(_ should useOperators("NodeRightOuterHashJoin"), Configs.AllRulePlanners + Configs.BackwardsCompatibility)) + planComparisonStrategy = ComparePlansWithAssertion(_ should useOperators("NodeRightOuterHashJoin"), Configs.AllRulePlanners + Configs.Cost2_3 + Configs.Cost3_1)) } test("optional match join should not crash") { diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/MatchAggregationsBackedByCountStoreAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/MatchAggregationsBackedByCountStoreAcceptanceTest.scala index 08503bfd328e8..7d1edba07fc3d 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/MatchAggregationsBackedByCountStoreAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/MatchAggregationsBackedByCountStoreAcceptanceTest.scala @@ -567,8 +567,8 @@ class MatchAggregationsBackedByCountStoreAcceptanceTest val query = "MATCH (n), (m) RETURN count(n)" // Then - compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4) - compareCount(query, 9, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4, executeBefore = executeBefore) + compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5) + compareCount(query, 9, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5, executeBefore = executeBefore) } test("count store on two unlabeled nodes and count(*)") { @@ -577,8 +577,8 @@ class MatchAggregationsBackedByCountStoreAcceptanceTest val query = "MATCH (n), (m) RETURN count(*)" // Then - compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4) - compareCount(query, 9, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4, executeBefore = executeBefore) + compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5) + compareCount(query, 9, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5, executeBefore = executeBefore) } test("count store on one labeled node and one unlabeled") { @@ -587,8 +587,8 @@ class MatchAggregationsBackedByCountStoreAcceptanceTest val query = "MATCH (n:User),(m) RETURN count(n)" // Then - compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4) - compareCount(query, 6, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4, executeBefore = executeBefore) + compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5) + compareCount(query, 6, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5, executeBefore = executeBefore) } test("count store on one labeled node and one unlabeled and count(*)") { @@ -597,8 +597,8 @@ class MatchAggregationsBackedByCountStoreAcceptanceTest val query = "MATCH (n:User),(m) RETURN count(*)" // Then - compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4) - compareCount(query, 6, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4, executeBefore = executeBefore) + compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5) + compareCount(query, 6, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5, executeBefore = executeBefore) } test("count store on two labeled nodes") { @@ -607,8 +607,8 @@ class MatchAggregationsBackedByCountStoreAcceptanceTest val query = "MATCH (n:User),(m:User) RETURN count(n)" // Then - compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4) - compareCount(query, 4, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4, executeBefore = executeBefore) + compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5) + compareCount(query, 4, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5, executeBefore = executeBefore) } test("count store with many nodes") { @@ -617,8 +617,8 @@ class MatchAggregationsBackedByCountStoreAcceptanceTest val query = "MATCH (n:User),(m),(o:User),(p) RETURN count(*)" // Then - compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4) - compareCount(query, 36, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4, executeBefore = executeBefore) + compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5) + compareCount(query, 36, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5, executeBefore = executeBefore) } test("count store with many but odd number of nodes") { @@ -627,8 +627,8 @@ class MatchAggregationsBackedByCountStoreAcceptanceTest val query = "MATCH (n:User),(m),(o:User),(p), (q) RETURN count(*)" // Then - compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4) - compareCount(query, 108, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_4, executeBefore = executeBefore) + compareCount(query, 0, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5) + compareCount(query, 108, expectOtherPlanIn = expectOtherPlan + Configs.Cost3_1 + Configs.Cost3_5, executeBefore = executeBefore) } private def setupModel(label1: String = "User", diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/MiscAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/MiscAcceptanceTest.scala index 6426e3b21c08e..a8b1bd36ab6c4 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/MiscAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/MiscAcceptanceTest.scala @@ -101,7 +101,7 @@ class MiscAcceptanceTest extends ExecutionEngineFunSuite with CypherComparisonSu // If we would use Ints for storing the limit, then we would end up with "limit 0" // thus, if we actually return the two nodes, then it proves that we used a long val query = "MATCH (n) RETURN n LIMIT " + limit - val worksCorrectlyInConfig = Configs.Version3_5 + Configs.Version3_3 - Configs.AllRulePlanners + val worksCorrectlyInConfig = Configs.Version3_5 + Configs.Version3_4 - Configs.AllRulePlanners // the query will work in all configs, but only have the correct result in those specified configs val result = executeWith(Configs.All, query, Configs.All - worksCorrectlyInConfig) result.toList should equal(List(Map("n" -> a), Map("n" -> b))) diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/NotificationAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/NotificationAcceptanceTest.scala index 6fc310e6f120f..ba38cc6e7bcff 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/NotificationAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/NotificationAcceptanceTest.scala @@ -123,8 +123,8 @@ class NotificationAcceptanceTest extends ExecutionEngineFunSuite with CypherComp CARTESIAN_PRODUCT.notification(new graphdb.InputPosition(8, 1, 9), cartesianProduct(Set("c", "d").asJava)))) } - test("Warn for cartesian product when running 3.3") { - val result = innerExecuteDeprecated("explain cypher 3.3 match (a)-->(b), (c)-->(d) return *", Map.empty) + test("Warn for cartesian product when running 3.4") { + val result = innerExecuteDeprecated("explain cypher 3.4 match (a)-->(b), (c)-->(d) return *", Map.empty) result.notifications.toList should equal(List( CARTESIAN_PRODUCT.notification(new graphdb.InputPosition(19, 1, 20), cartesianProduct(Set("c", "d").asJava)))) @@ -424,9 +424,9 @@ class NotificationAcceptanceTest extends ExecutionEngineFunSuite with CypherComp result.notifications.map(_.getCode) should contain("Neo.ClientNotification.Statement.EagerOperatorWarning") } - test("should warn for eager after load csv in 3.3") { + test("should warn for eager after load csv in 3.4") { val result = innerExecuteDeprecated( - "EXPLAIN CYPHER 3.3 MATCH (n) LOAD CSV FROM 'file:///ignore/ignore.csv' AS line WITH * DELETE n MERGE () RETURN line", Map.empty) + "EXPLAIN CYPHER 3.4 MATCH (n) LOAD CSV FROM 'file:///ignore/ignore.csv' AS line WITH * DELETE n MERGE () RETURN line", Map.empty) result should use("LoadCSV", "Eager") result.notifications.map(_.getCode) should contain("Neo.ClientNotification.Statement.EagerOperatorWarning") diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ParameterValuesAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ParameterValuesAcceptanceTest.scala index 97c4a82af6e4f..f23401d367a45 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ParameterValuesAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ParameterValuesAcceptanceTest.scala @@ -125,37 +125,37 @@ class ParameterValuesAcceptanceTest extends ExecutionEngineFunSuite with CypherC test("match with missing parameter should return error for empty db") { // all versions of 3.3 and 3.4 - val config = Configs.Version3_5 + Configs.Version3_3 + Configs.Procs - Configs.AllRulePlanners + val config = Configs.Version3_5 + Configs.Version3_4 + Configs.Procs - Configs.AllRulePlanners failWithError(config, "MATCH (n:Person {name:{name}}) RETURN n", Seq("Expected parameter(s): name")) } test("match with missing parameter should return error for non-empty db") { // all versions of 3.3 and 3.4 - val config = Configs.Version3_5 + Configs.Version3_3 + Configs.Procs - Configs.AllRulePlanners - Configs.Compiled + val config = Configs.Version3_5 + Configs.Version3_4 + Configs.Procs - Configs.AllRulePlanners - Configs.Compiled failWithError(config, "CREATE (n:Person) WITH n MATCH (n:Person {name:{name}}) RETURN n", Seq("Expected parameter(s): name")) } test("match with multiple missing parameters should return error for empty db") { // all versions of 3.3 and 3.4 - val config = Configs.Version3_5 + Configs.Version3_3 + Configs.Procs - Configs.AllRulePlanners + val config = Configs.Version3_5 + Configs.Version3_4 + Configs.Procs - Configs.AllRulePlanners failWithError(config, "MATCH (n:Person {name:{name}, age:{age}}) RETURN n", Seq("Expected parameter(s): name, age")) } test("match with multiple missing parameters should return error for non-empty db") { // all versions of 3.3 and 3.4 - val config = Configs.Version3_5 + Configs.Version3_3 + Configs.Procs - Configs.AllRulePlanners - Configs.Compiled + val config = Configs.Version3_5 + Configs.Version3_4 + Configs.Procs - Configs.AllRulePlanners - Configs.Compiled failWithError(config, "CREATE (n:Person) WITH n MATCH (n:Person {name:{name}, age:{age}}) RETURN n", Seq("Expected parameter(s): name, age")) } test("match with misspelled parameter should return error for empty db") { // all versions of 3.3 and 3.4 - val config = Configs.Version3_5 + Configs.Version3_3 + Configs.Procs - Configs.AllRulePlanners + val config = Configs.Version3_5 + Configs.Version3_4 + Configs.Procs - Configs.AllRulePlanners failWithError(config, "MATCH (n:Person {name:{name}}) RETURN n", Seq("Expected parameter(s): name"), params = Map("nam" -> "Neo")) } test("match with misspelled parameter should return error for non-empty db") { // all versions of 3.3 and 3.4 - val config = Configs.Version3_5 + Configs.Version3_3 + Configs.Procs - Configs.AllRulePlanners - Configs.Compiled + val config = Configs.Version3_5 + Configs.Version3_4 + Configs.Procs - Configs.AllRulePlanners - Configs.Compiled failWithError(config, "CREATE (n:Person) WITH n MATCH (n:Person {name:{name}}) RETURN n", Seq("Expected parameter(s): name"), params = Map("nam" -> "Neo")) } diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/QueryPlanCompactionAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/QueryPlanCompactionAcceptanceTest.scala index 702a8c26ea90e..a2d433349bcf5 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/QueryPlanCompactionAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/QueryPlanCompactionAcceptanceTest.scala @@ -22,9 +22,9 @@ */ package org.neo4j.internal.cypher.acceptance -import org.opencypher.v9_0.util.test_helpers.WindowsStringSafe import org.neo4j.cypher.{ExecutionEngineFunSuite, QueryStatisticsTestSupport} import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport._ +import org.opencypher.v9_0.util.test_helpers.WindowsStringSafe class QueryPlanCompactionAcceptanceTest extends ExecutionEngineFunSuite with QueryStatisticsTestSupport with CypherComparisonSupport { @@ -552,7 +552,7 @@ class QueryPlanCompactionAcceptanceTest extends ExecutionEngineFunSuite with Que |""".stripMargin val result = executeWith(expectedToSucceed, query, - planComparisonStrategy = ComparePlansWithAssertion(_ should matchPlan(expectedPlan), expectPlansToFail = Configs.All - Configs.Cost3_4)) + planComparisonStrategy = ComparePlansWithAssertion(_ should matchPlan(expectedPlan), expectPlansToFail = Configs.All - Configs.Cost3_5)) assertStats(result, nodesCreated = 171, relationshipsCreated = 253, propertiesWritten = 564, labelsAdded = 171) } @@ -583,7 +583,7 @@ class QueryPlanCompactionAcceptanceTest extends ExecutionEngineFunSuite with Que |+-----------------+----------------+-------------------------------------------------------------------------------------------------+ |""".stripMargin - val result = executeWith(expectedToSucceed, query, planComparisonStrategy = ComparePlansWithAssertion(_ should matchPlan(expectedPlan), expectPlansToFail = Configs.All - Configs.Cost3_4)) + val result = executeWith(expectedToSucceed, query, planComparisonStrategy = ComparePlansWithAssertion(_ should matchPlan(expectedPlan), expectPlansToFail = Configs.All - Configs.Cost3_5)) assertStats(result, nodesCreated = 8, relationshipsCreated = 7, propertiesWritten = 21, labelsAdded = 8) } @@ -611,7 +611,7 @@ class QueryPlanCompactionAcceptanceTest extends ExecutionEngineFunSuite with Que || | | +----------------+---------------------------+-----------------------+ || | +Optional | 1 | line, u2 | | || | | +----------------+---------------------------+-----------------------+ - || | +ActiveRead | 1 | line, u2 | | + || | +ActiveRead | 0 | line, u2 | | || | | +----------------+---------------------------+-----------------------+ || | +Filter | 0 | line, u2 | u2.login = line.user2 | || | | +----------------+---------------------------+-----------------------+ @@ -629,7 +629,7 @@ class QueryPlanCompactionAcceptanceTest extends ExecutionEngineFunSuite with Que || | | +----------------+---------------------------+-----------------------+ || | +Optional | 1 | line, u1 | | || | | +----------------+---------------------------+-----------------------+ - || | +ActiveRead | 1 | line, u1 | | + || | +ActiveRead | 0 | line, u1 | | || | | +----------------+---------------------------+-----------------------+ || | +Filter | 0 | line, u1 | u1.login = line.user1 | || | | +----------------+---------------------------+-----------------------+ @@ -639,9 +639,9 @@ class QueryPlanCompactionAcceptanceTest extends ExecutionEngineFunSuite with Que |+-------------------------+----------------+---------------------------+-----------------------+ |""".stripMargin - val correctPlans = TestConfiguration(Versions(Versions.v3_5, Versions.v3_5), Planners.all, Runtimes.Interpreted) executeWith(expectedToSucceed, query, planComparisonStrategy = ComparePlansWithAssertion(_ should matchPlan(expectedPlan), - expectPlansToFail = Configs.All - correctPlans), params = Map("csv_filename" -> "x")) + // FIXME this is horrible, but I cardified it + expectPlansToFail = Configs.Version2_3 + Configs.Version3_1 + Configs.AllRulePlanners + Configs.SlottedInterpreted + TestConfiguration(Versions.V3_4, Planners(Planners.Cost, Planners.Default), Runtimes(Runtimes.Slotted, Runtimes.Default))), params = Map("csv_filename" -> "x")) } test("Don't compact query with consecutive expands due to presence of values in 'other' column") { diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathSameNodeAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathSameNodeAcceptanceTest.scala index c8dde299d7e1c..1c1299bf1f388 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathSameNodeAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/ShortestPathSameNodeAcceptanceTest.scala @@ -28,14 +28,14 @@ import org.neo4j.cypher.internal.runtime.InternalExecutionResult import org.neo4j.cypher.{ExecutionEngineFunSuite, ExecutionEngineHelper, RunWithConfigTestSupport, ShortestPathCommonEndNodesForbiddenException} import org.neo4j.graphdb.RelationshipType import org.neo4j.graphdb.factory.GraphDatabaseSettings -import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Versions.{V3_1, V3_3} +import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Versions.{V3_1, V3_4} import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport._ import org.neo4j.values.virtual.VirtualValues class ShortestPathSameNodeAcceptanceTest extends ExecutionEngineFunSuite with RunWithConfigTestSupport with CypherComparisonSupport { val expectedToFail = TestConfiguration( - Versions(Versions.Default, V3_1, V3_3), + Versions(Versions.Default, V3_1, V3_4), Planners(Planners.Cost, Planners.Rule, Planners.Default), Runtimes(Runtimes.Interpreted, Runtimes.Slotted, Runtimes.Default, Runtimes.ProcedureOrSchema)) diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialDistanceAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialDistanceAcceptanceTest.scala index 17461d003356b..f0e9b97b6c692 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialDistanceAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialDistanceAcceptanceTest.scala @@ -667,15 +667,13 @@ class SpatialDistanceAcceptanceTest extends ExecutionEngineFunSuite with CypherC graph.execute("CREATE (p:Place) SET p.location = point({y: 0, x: 0, crs: 'cartesian'})") Range(11, 100).foreach(i => graph.execute(s"CREATE (p:Place) SET p.location = point({y: $i, x: $i, crs: 'cartesian'})")) - val config = distanceConfig - Configs.Version3_3 - val query = """MATCH (p:Place) |WHERE distance(p.location, 5) <= 10 |RETURN p.location as point """.stripMargin // When - val result = executeWith(config, query) + val result = executeWith(distanceConfig, query) // Then result.toList shouldBe empty @@ -683,7 +681,7 @@ class SpatialDistanceAcceptanceTest extends ExecutionEngineFunSuite with CypherC // And given graph.execute(s"DROP INDEX ON :Place(location)") // when - val resultNoIndex = executeWith(config, query) + val resultNoIndex = executeWith(distanceConfig, query) // Then resultNoIndex.toList shouldBe empty diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialFunctionsAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialFunctionsAcceptanceTest.scala index 7c00b1262d4af..43cdd491c9f89 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialFunctionsAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialFunctionsAcceptanceTest.scala @@ -30,12 +30,11 @@ import org.neo4j.values.storable.{CoordinateReferenceSystem, Values} class SpatialFunctionsAcceptanceTest extends ExecutionEngineFunSuite with CypherComparisonSupport { val pointConfig = Configs.Interpreted - Configs.Version2_3 - val equalityConfig = Configs.Interpreted - Configs.Before3_3AndRule - val latestPointConfig = Configs.Interpreted - Configs.BackwardsCompatibility - Configs.AllRulePlanners + val equalityAndLatestPointConfig = Configs.Interpreted - Configs.Before3_3AndRule test("toString on points") { - executeWith(latestPointConfig, "RETURN toString(point({x:1, y:2})) AS s").toList should equal(List(Map("s" -> "point({x: 1.0, y: 2.0, crs: 'cartesian'})"))) - executeWith(latestPointConfig, "RETURN toString(point({longitude:1, latitude:2, height:3})) AS s").toList should equal(List(Map("s" -> "point({x: 1.0, y: 2.0, z: 3.0, crs: 'wgs-84-3d'})"))) + executeWith(equalityAndLatestPointConfig, "RETURN toString(point({x:1, y:2})) AS s").toList should equal(List(Map("s" -> "point({x: 1.0, y: 2.0, crs: 'cartesian'})"))) + executeWith(equalityAndLatestPointConfig, "RETURN toString(point({longitude:1, latitude:2, height:3})) AS s").toList should equal(List(Map("s" -> "point({x: 1.0, y: 2.0, z: 3.0, crs: 'wgs-84-3d'})"))) } test("point function should work with literal map") { @@ -99,7 +98,7 @@ class SpatialFunctionsAcceptanceTest extends ExecutionEngineFunSuite with Cypher test("point function should not work with NaN or infinity") { for(invalidDouble <- Seq(Double.NaN, Double.PositiveInfinity, Double.NegativeInfinity)) { - failWithError(Configs.DefaultInterpreted + Configs.SlottedInterpreted + Configs.Version3_3 + Configs.Procs, + failWithError(Configs.DefaultInterpreted + Configs.SlottedInterpreted + Configs.Version3_4 + Configs.Procs, "RETURN point({x: 2.3, y: $v}) as point", List("Cannot create a point with non-finite coordinate values"), params = Map(("v", invalidDouble))) } } @@ -296,7 +295,7 @@ class SpatialFunctionsAcceptanceTest extends ExecutionEngineFunSuite with Cypher createLabeledNode("Place") // When - val result = executeWith(equalityConfig, "MATCH (p:Place) SET p.location = point({latitude: 56.7, longitude: 12.78}) RETURN p.location as point", + val result = executeWith(equalityAndLatestPointConfig, "MATCH (p:Place) SET p.location = point({latitude: 56.7, longitude: 12.78}) RETURN p.location as point", planComparisonStrategy = ComparePlansWithAssertion(_ should useOperatorWithText("Projection", "point"), expectPlansToFail = Configs.AllRulePlanners)) @@ -439,8 +438,7 @@ class SpatialFunctionsAcceptanceTest extends ExecutionEngineFunSuite with Cypher |RETURN a > b, a < b """.stripMargin - val pointConfig = Configs.Interpreted - Configs.BackwardsCompatibility - Configs.AllRulePlanners - val result = executeWith(pointConfig, query).toList + val result = executeWith(equalityAndLatestPointConfig, query).toList withClue(s"Comparing '$a' to '$b'") { result should equal(List(Map("a > b" -> aBiggerB, "a < b" -> aSmallerB))) } @@ -459,7 +457,7 @@ class SpatialFunctionsAcceptanceTest extends ExecutionEngineFunSuite with Cypher |MATCH (place:Place) SET place.location = points |RETURN points """.stripMargin - val result = executeWith(equalityConfig, query, + val result = executeWith(equalityAndLatestPointConfig, query, planComparisonStrategy = ComparePlansWithAssertion(_ should useOperatorWithText("Projection", "point"), expectPlansToFail = Configs.AllRulePlanners)) @@ -588,7 +586,7 @@ class SpatialFunctionsAcceptanceTest extends ExecutionEngineFunSuite with Cypher """.stripMargin // Then - failWithError(equalityConfig + Configs.Procs, query, Seq("Collections containing point values with different CRS can not be stored in properties.")) + failWithError(equalityAndLatestPointConfig + Configs.Procs, query, Seq("Collections containing point values with different CRS can not be stored in properties.")) } test("accessors on 2D cartesian points") { diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialIndexResultsAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialIndexResultsAcceptanceTest.scala index 951019e59e48e..0922e5ad4cb05 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialIndexResultsAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/SpatialIndexResultsAcceptanceTest.scala @@ -32,7 +32,7 @@ import scala.collection.immutable.{Map => ImmutableMap} class SpatialIndexResultsAcceptanceTest extends IndexingTestSupport { private val equalityConfig = Configs.Interpreted - Configs.Before3_3AndRule - private val indexConfig = Configs.Interpreted - Configs.BackwardsCompatibility - Configs.AllRulePlanners + private val indexConfig = Configs.Interpreted - Configs.Cost3_1 - Configs.Cost2_3 - Configs.AllRulePlanners override def cypherComparisonSupport = true @@ -65,7 +65,7 @@ class SpatialIndexResultsAcceptanceTest extends IndexingTestSupport { planComparisonStrategy = ComparePlansWithAssertion({ plan => plan should useOperatorWithText("Projection", "point") plan should useOperatorWithText("NodeIndexSeek", ":Place(location)") - }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_3)) + }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_4)) // Then val point = result.columnAs("point").toList.head.asInstanceOf[Point] @@ -87,7 +87,7 @@ class SpatialIndexResultsAcceptanceTest extends IndexingTestSupport { planComparisonStrategy = ComparePlansWithAssertion({ plan => plan should useOperatorWithText("Projection", "point") plan should useOperatorWithText("NodeIndexSeek", ":Place(location)") - }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_3), + }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_4), params = ImmutableMap("param" -> Values.pointValue(CoordinateReferenceSystem.WGS84, 12.78, 56.7))) // Then @@ -110,7 +110,7 @@ class SpatialIndexResultsAcceptanceTest extends IndexingTestSupport { planComparisonStrategy = ComparePlansWithAssertion({ plan => plan should useOperatorWithText("Projection", "point") plan should useOperatorWithText("NodeIndexSeek", ":Place(location)") - }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_3), + }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_4), params = ImmutableMap("param" -> Array(Values.pointValue(CoordinateReferenceSystem.WGS84, 12.78, 56.7)))) // Then @@ -137,7 +137,7 @@ class SpatialIndexResultsAcceptanceTest extends IndexingTestSupport { planComparisonStrategy = ComparePlansWithAssertion({ plan => plan should useOperatorWithText("Projection", "point") plan should useOperatorWithText("NodeIndexSeek", ":Place(location)") - }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_3), + }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_4), params = ImmutableMap("param" -> Array(Values.pointValue(CoordinateReferenceSystem.WGS84, 12.78, 56.7), Values.pointValue(CoordinateReferenceSystem.WGS84, 13.78, 56.7)))) @@ -170,7 +170,7 @@ class SpatialIndexResultsAcceptanceTest extends IndexingTestSupport { planComparisonStrategy = ComparePlansWithAssertion({ plan => plan should useOperatorWithText("Projection", "point") plan should useOperatorWithText("NodeIndexSeek", ":Place(location)") - }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_3), + }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_4), params = ImmutableMap("param" -> List(Values.pointValue(CoordinateReferenceSystem.WGS84, 12.78, 56.7), Values.pointValue(CoordinateReferenceSystem.WGS84, 13.78, 56.7)))) @@ -210,7 +210,7 @@ class SpatialIndexResultsAcceptanceTest extends IndexingTestSupport { graph.execute("MATCH (p:Place) SET p.location = point({latitude: 56.7, longitude: 12.78, crs: 'WGS-84'}) RETURN p.location as point") graph.execute("CREATE (p:Place) SET p.location = point({latitude: 40.7, longitude: -35.78, crs: 'WGS-84'})") - val configuration = TestConfiguration(Versions(Versions.V3_3, Versions.v3_5, Versions.Default), Planners(Planners.Cost, Planners.Default), Runtimes(Runtimes.Interpreted, Runtimes.Slotted, Runtimes.Default)) + val configuration = TestConfiguration(Versions(Versions.V3_4, Versions.v3_5, Versions.Default), Planners(Planners.Cost, Planners.Default), Runtimes(Runtimes.Interpreted, Runtimes.Slotted, Runtimes.Default)) // When val result = executeWith(configuration, "MATCH (p:Place) WHERE p.location = point({latitude: 56.7, longitude: 12.78, crs: 'WGS-84'}) RETURN p.location as point", @@ -235,7 +235,7 @@ class SpatialIndexResultsAcceptanceTest extends IndexingTestSupport { planComparisonStrategy = ComparePlansWithAssertion({ plan => plan should useOperatorWithText("Projection", "point") plan should useOperatorWithText("NodeIndexSeek", ":Place(location)") - }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_3)) + }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_4)) // Then val point = result.columnAs("point").toList.head.asInstanceOf[Point] @@ -251,7 +251,7 @@ class SpatialIndexResultsAcceptanceTest extends IndexingTestSupport { graph.execute("MATCH (p:Place) SET p.location = point({x: 1.2, y: 3.4, z: 5.6}) RETURN p.location as point") graph.execute("CREATE (p:Place) SET p.location = point({x: 1.2, y: 3.4, z: 5.601})") - val configuration = TestConfiguration(Versions(Versions.V3_3, Versions.v3_5, Versions.Default), Planners(Planners.Cost, Planners.Default), Runtimes(Runtimes.Interpreted, Runtimes.Slotted, Runtimes.Default)) + val configuration = TestConfiguration(Versions(Versions.V3_4, Versions.v3_5, Versions.Default), Planners(Planners.Cost, Planners.Default), Runtimes(Runtimes.Interpreted, Runtimes.Slotted, Runtimes.Default)) // When val result = executeWith(configuration, "MATCH (p:Place) WHERE p.location = point({x: 1.2, y: 3.4, z: 5.6}) RETURN p.location as point", diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/StartAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/StartAcceptanceTest.scala index 7bf478a656ec0..beaa599dd6d3d 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/StartAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/StartAcceptanceTest.scala @@ -27,10 +27,10 @@ import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport.Configs class StartAcceptanceTest extends ExecutionEngineFunSuite with QueryStatisticsTestSupport with CypherComparisonSupport { - // START gets executed on legacy cypher, because it's deprecated and will be removes in 4.0. Therefore it is only + // START gets executed on legacy cypher, because it's deprecated and will be removed in 4.0. Therefore it is only // executable on the community interpreted runtime. - val expectedToSucceed = Configs.CommunityInterpreted - Configs.Version3_3 - val expectedToSucceedNoCost = Configs.CommunityInterpreted - Configs.Cost3_1 - Configs.Cost2_3 - Configs.Version3_3 + val expectedToSucceed = Configs.CommunityInterpreted - Configs.Version3_4 + val expectedToSucceedNoCost = Configs.CommunityInterpreted - Configs.Cost3_1 - Configs.Cost2_3 - Configs.Version3_4 test("START n=node:index(key = \"value\") RETURN n") { val node = createNode() diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TemporalAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TemporalAcceptanceTest.scala index f60339dc4c7fd..ee5c1b8a2ee6f 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TemporalAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TemporalAcceptanceTest.scala @@ -163,7 +163,7 @@ class TemporalAcceptanceTest extends ExecutionEngineFunSuite with QueryStatistic planComparisonStrategy = ComparePlansWithAssertion({ plan => plan should useOperatorWithText("Projection", "timeSpan") plan should useOperatorWithText("NodeIndexSeek", ":Occasion(timeSpan)") - }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_3), + }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_4), params = Map("param" -> Array(LocalDate.of(2018, 4, 1)))) @@ -189,7 +189,7 @@ class TemporalAcceptanceTest extends ExecutionEngineFunSuite with QueryStatistic planComparisonStrategy = ComparePlansWithAssertion({ plan => plan should useOperatorWithText("Projection", "timeSpan") plan should useOperatorWithText("NodeIndexSeek", ":Occasion(timeSpan)") - }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_3), + }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_4), params = Map("param" -> List(LocalDate.of(2018, 4, 1)))) @@ -215,7 +215,7 @@ class TemporalAcceptanceTest extends ExecutionEngineFunSuite with QueryStatistic planComparisonStrategy = ComparePlansWithAssertion({ plan => plan should useOperatorWithText("Projection", "timeSpan") plan should useOperatorWithText("NodeIndexSeek", ":Occasion(timeSpan)") - }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_3), + }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_4), params = Map("param" -> Array(LocalDate.of(2018, 4, 1), LocalDate.of(2018, 4, 2)))) @@ -242,7 +242,7 @@ class TemporalAcceptanceTest extends ExecutionEngineFunSuite with QueryStatistic planComparisonStrategy = ComparePlansWithAssertion({ plan => plan should useOperatorWithText("Projection", "timeSpan") plan should useOperatorWithText("NodeIndexSeek", ":Occasion(timeSpan)") - }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_3), + }, expectPlansToFail = Configs.AbsolutelyAll - Configs.Version3_5 - Configs.Version3_4), params = Map("param" -> List(LocalDate.of(2018, 4, 1), LocalDate.of(2018, 4, 2)))) diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TemporalFunctionsAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TemporalFunctionsAcceptanceTest.scala index 72e2b66580d3d..0d40f6cdaa29f 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TemporalFunctionsAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/TemporalFunctionsAcceptanceTest.scala @@ -29,7 +29,7 @@ import org.neo4j.internal.cypher.acceptance.CypherComparisonSupport._ class TemporalFunctionsAcceptanceTest extends ExecutionEngineFunSuite with CypherComparisonSupport with FakeClock { - val supported = (Configs.Version3_5 + Configs.Version3_3 + Configs.Version3_1) - Configs.Compiled + val supported = (Configs.Version3_5 + Configs.Version3_4 + Configs.Version3_1) - Configs.Compiled test("should get current default datetime") { val result = executeWith(supported, "RETURN datetime() as now") diff --git a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/UsingAcceptanceTest.scala b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/UsingAcceptanceTest.scala index 245c84317c4e3..032027c0b68c5 100644 --- a/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/UsingAcceptanceTest.scala +++ b/enterprise/cypher/acceptance-spec-suite/src/test/scala/org/neo4j/internal/cypher/acceptance/UsingAcceptanceTest.scala @@ -385,7 +385,7 @@ class UsingAcceptanceTest extends ExecutionEngineFunSuite with RunWithConfigTest |USING JOIN ON a |RETURN a.prop AS res""".stripMargin - val result = executeWith(Configs.Version3_5 + Configs.Version3_3 + Configs.AllRulePlanners, query, + val result = executeWith(Configs.Version3_5 + Configs.Version3_4 + Configs.AllRulePlanners, query, planComparisonStrategy = ComparePlansWithAssertion(_ should includeOnlyOneHashJoinOn("a"), expectPlansToFail = Configs.AllRulePlanners)) @@ -402,7 +402,7 @@ class UsingAcceptanceTest extends ExecutionEngineFunSuite with RunWithConfigTest |USING JOIN ON b |RETURN b.prop AS res""".stripMargin - val result = executeWith(Configs.Version3_5 + Configs.Version3_3 + Configs.AllRulePlanners, query, + val result = executeWith(Configs.Version3_5 + Configs.Version3_4 + Configs.AllRulePlanners, query, planComparisonStrategy = ComparePlansWithAssertion(_ should includeOnlyOneHashJoinOn("b"), expectPlansToFail = Configs.AllRulePlanners)) @@ -801,7 +801,7 @@ class UsingAcceptanceTest extends ExecutionEngineFunSuite with RunWithConfigTest | WHERE f.bar=5 and f.baz=3 | RETURN f """.stripMargin - val result = executeWith(Configs.Version3_5 + Configs.Version3_3 - Configs.Compiled - Configs.AllRulePlanners, query, + val result = executeWith(Configs.Version3_5 + Configs.Version3_4 - Configs.Compiled - Configs.AllRulePlanners, query, planComparisonStrategy = ComparePlansWithAssertion(planDescription => { planDescription should includeAtLeastOne(classOf[NodeIndexSeek], withVariable = "f") }, expectPlansToFail = Configs.AllRulePlanners)) diff --git a/enterprise/cypher/cypher/src/test/java/org/neo4j/cypher/internal/javacompat/ExecutionResultTest.java b/enterprise/cypher/cypher/src/test/java/org/neo4j/cypher/internal/javacompat/ExecutionResultTest.java index d023122c29df8..dc083491d8460 100644 --- a/enterprise/cypher/cypher/src/test/java/org/neo4j/cypher/internal/javacompat/ExecutionResultTest.java +++ b/enterprise/cypher/cypher/src/test/java/org/neo4j/cypher/internal/javacompat/ExecutionResultTest.java @@ -23,25 +23,21 @@ package org.neo4j.cypher.internal.javacompat; import org.hamcrest.CoreMatchers; -import org.junit.Assert; import org.junit.Rule; import org.junit.Test; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - import org.neo4j.graphdb.ExecutionPlanDescription; import org.neo4j.graphdb.Result; import org.neo4j.graphdb.Transaction; import org.neo4j.helpers.collection.Iterators; import org.neo4j.test.rule.EnterpriseDatabaseRule; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.greaterThanOrEqualTo; -import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.*; import static org.hamcrest.core.IsNull.notNullValue; public class ExecutionResultTest @@ -293,7 +289,7 @@ public void shouldReturnCorrectArrayType() @Test public void shouldContainCompletePlanFromFromLegacyVersions() { - for ( String version : new String[]{"2.3", "3.1", "3.3", "3.5"} ) + for ( String version : new String[]{"2.3", "3.1", "3.4", "3.5"} ) { // Given Result result = db.execute( String.format( "EXPLAIN CYPHER %s MATCH (n) RETURN n", version ) ); @@ -318,7 +314,7 @@ public void shouldContainCompleteProfileFromFromLegacyVersions() tx.success(); } - for ( String version : new String[]{"2.3", "3.1", "3.3", "3.5"} ) + for ( String version : new String[]{"2.3", "3.1", "3.4", "3.5"} ) { // When Result result = db.execute( String.format( "PROFILE CYPHER %s MATCH (n) RETURN n", version ) ); diff --git a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/CypherCompatibilityTest.scala b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/CypherCompatibilityTest.scala index 7d79ad6c14318..3beae5f9560db 100644 --- a/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/CypherCompatibilityTest.scala +++ b/enterprise/cypher/cypher/src/test/scala/org/neo4j/cypher/CypherCompatibilityTest.scala @@ -118,11 +118,11 @@ class CypherCompatibilityTest extends ExecutionEngineFunSuite with RunWithConfig } } - test("should allow executing enterprise queries on CYPHER 3.3") { + test("should allow executing enterprise queries on CYPHER 3.4") { runWithConfig() { db => - assertVersionAndRuntime(db, "3.3", "slotted") - assertVersionAndRuntime(db, "3.3", "compiled") + assertVersionAndRuntime(db, "3.4", "slotted") + assertVersionAndRuntime(db, "3.4", "compiled") } }