diff --git a/build.gradle b/build.gradle index 325d3cf4..31230f89 100644 --- a/build.gradle +++ b/build.gradle @@ -77,4 +77,5 @@ ext { mockitoVersion = '1.9.5' systemRulesVersion = '1.19.0' commonsIoVersion = '2.6' + hamcrestVersion = '2.0.0.0' } diff --git a/cypher-shell/build.gradle b/cypher-shell/build.gradle index 26162b06..9945b5ea 100644 --- a/cypher-shell/build.gradle +++ b/cypher-shell/build.gradle @@ -67,5 +67,6 @@ dependencies { testCompile "junit:junit:$junitVersion" testCompile "org.mockito:mockito-core:$mockitoVersion" testCompile "com.github.stefanbirkner:system-rules:$systemRulesVersion" + testCompile "org.hamcrest:java-hamcrest:$hamcrestVersion" testCompileOnly "com.google.code.findbugs:annotations:$findbugsVersion" } diff --git a/cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellPlainIntegrationTest.java b/cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellPlainIntegrationTest.java index d016448e..fb6b4a9f 100644 --- a/cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellPlainIntegrationTest.java +++ b/cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellPlainIntegrationTest.java @@ -16,8 +16,11 @@ import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.junit.Assume.assumeThat; import static org.junit.Assert.assertEquals; import static org.neo4j.shell.prettyprint.OutputFormatter.NEWLINE; +import static org.neo4j.shell.util.Versions.version; public class CypherShellPlainIntegrationTest extends CypherShellIntegrationTest { @Rule diff --git a/cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellVerboseIntegrationTest.java b/cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellVerboseIntegrationTest.java index e1a76401..5d998ed9 100644 --- a/cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellVerboseIntegrationTest.java +++ b/cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellVerboseIntegrationTest.java @@ -19,11 +19,13 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeThat; import static org.junit.Assume.assumeTrue; import static org.neo4j.shell.util.Versions.majorVersion; -import static org.neo4j.shell.util.Versions.minorVersion; +import static org.neo4j.shell.util.Versions.version; public class CypherShellVerboseIntegrationTest extends CypherShellIntegrationTest { @Rule @@ -193,7 +195,7 @@ public void paramsAndListVariablesWithSpecialCharacters() throws EvaluationExcep public void cypherWithOrder() throws CommandException { // given String serverVersion = shell.getServerVersion(); - assumeTrue((minorVersion(serverVersion) == 6 && majorVersion(serverVersion) == 3) || majorVersion(serverVersion) > 3); + assumeThat( version(serverVersion), greaterThanOrEqualTo(version("3.6"))); // Make sure we are creating a new NEW index try { @@ -218,7 +220,7 @@ public void cypherWithOrder() throws CommandException { public void cypherWithQueryDetails() throws CommandException { // given String serverVersion = shell.getServerVersion(); - assumeTrue((minorVersion(serverVersion) > 0 && majorVersion(serverVersion) == 4) || majorVersion(serverVersion) > 4); + assumeThat( version(serverVersion), greaterThanOrEqualTo(version("4.1"))); //when shell.execute("EXPLAIN MATCH (n) with n.age AS age RETURN age"); @@ -234,7 +236,7 @@ public void cypherWithQueryDetails() throws CommandException { public void cypherWithoutQueryDetails() throws CommandException { // given String serverVersion = shell.getServerVersion(); - assumeTrue((minorVersion(serverVersion) == 0 && majorVersion(serverVersion) == 4) || majorVersion(serverVersion) < 4); + assumeThat( version(serverVersion), not(greaterThanOrEqualTo(version("4.1")))); //when shell.execute("EXPLAIN MATCH (n) with n.age AS age RETURN age");