Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit 201f35e

Browse files
authored
Merge pull request #230 from sherfert/4.0-version-assume
Fix version assume!
2 parents 437244d + 5dcf6fd commit 201f35e

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,5 @@ ext {
7777
mockitoVersion = '1.9.5'
7878
systemRulesVersion = '1.19.0'
7979
commonsIoVersion = '2.6'
80+
hamcrestVersion = '2.0.0.0'
8081
}

cypher-shell/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ dependencies {
6767
testCompile "junit:junit:$junitVersion"
6868
testCompile "org.mockito:mockito-core:$mockitoVersion"
6969
testCompile "com.github.stefanbirkner:system-rules:$systemRulesVersion"
70+
testCompile "org.hamcrest:java-hamcrest:$hamcrestVersion"
7071
testCompileOnly "com.google.code.findbugs:annotations:$findbugsVersion"
7172
}

cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellPlainIntegrationTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616

1717
import static org.hamcrest.CoreMatchers.containsString;
1818
import static org.hamcrest.MatcherAssert.assertThat;
19+
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
20+
import static org.junit.Assume.assumeThat;
1921
import static org.junit.Assert.assertEquals;
2022
import static org.neo4j.shell.prettyprint.OutputFormatter.NEWLINE;
23+
import static org.neo4j.shell.util.Versions.version;
2124

2225
public class CypherShellPlainIntegrationTest extends CypherShellIntegrationTest {
2326
@Rule

cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellVerboseIntegrationTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
import static org.hamcrest.CoreMatchers.equalTo;
2020
import static org.hamcrest.CoreMatchers.not;
2121
import static org.hamcrest.MatcherAssert.assertThat;
22+
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
2223
import static org.junit.Assert.assertEquals;
2324
import static org.junit.Assert.assertTrue;
25+
import static org.junit.Assume.assumeThat;
2426
import static org.junit.Assume.assumeTrue;
2527
import static org.neo4j.shell.util.Versions.majorVersion;
26-
import static org.neo4j.shell.util.Versions.minorVersion;
28+
import static org.neo4j.shell.util.Versions.version;
2729

2830
public class CypherShellVerboseIntegrationTest extends CypherShellIntegrationTest {
2931
@Rule
@@ -193,7 +195,7 @@ public void paramsAndListVariablesWithSpecialCharacters() throws EvaluationExcep
193195
public void cypherWithOrder() throws CommandException {
194196
// given
195197
String serverVersion = shell.getServerVersion();
196-
assumeTrue((minorVersion(serverVersion) == 6 && majorVersion(serverVersion) == 3) || majorVersion(serverVersion) > 3);
198+
assumeThat( version(serverVersion), greaterThanOrEqualTo(version("3.6")));
197199

198200
// Make sure we are creating a new NEW index
199201
try {
@@ -218,7 +220,7 @@ public void cypherWithOrder() throws CommandException {
218220
public void cypherWithQueryDetails() throws CommandException {
219221
// given
220222
String serverVersion = shell.getServerVersion();
221-
assumeTrue((minorVersion(serverVersion) > 0 && majorVersion(serverVersion) == 4) || majorVersion(serverVersion) > 4);
223+
assumeThat( version(serverVersion), greaterThanOrEqualTo(version("4.1")));
222224

223225
//when
224226
shell.execute("EXPLAIN MATCH (n) with n.age AS age RETURN age");
@@ -234,7 +236,7 @@ public void cypherWithQueryDetails() throws CommandException {
234236
public void cypherWithoutQueryDetails() throws CommandException {
235237
// given
236238
String serverVersion = shell.getServerVersion();
237-
assumeTrue((minorVersion(serverVersion) == 0 && majorVersion(serverVersion) == 4) || majorVersion(serverVersion) < 4);
239+
assumeThat( version(serverVersion), not(greaterThanOrEqualTo(version("4.1"))));
238240

239241
//when
240242
shell.execute("EXPLAIN MATCH (n) with n.age AS age RETURN age");

0 commit comments

Comments
 (0)