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

Commit

Permalink
Updated test cypherWithProfileWithMemory to include details column an…
Browse files Browse the repository at this point in the history
…d fixed imports
  • Loading branch information
LinneaAndersson committed May 11, 2020
1 parent 4c66ff3 commit 01719f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.neo4j.shell.prettyprint.TablePlanFormatter;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
Expand Down Expand Up @@ -207,7 +206,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");
Expand All @@ -223,7 +222,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");
Expand Down Expand Up @@ -264,7 +263,7 @@ public void cypherWithProfileWithMemory() throws CommandException {
//then
String actual = linePrinter.output();
assertThat(actual, containsString("| Plan | Statement | Version | Planner | Runtime | Time | DbHits | Rows | Memory (Bytes) |")); // First table
assertThat(actual, containsString("| Operator | Estimated Rows | Rows | DB Hits | Cache H/M | Memory (Bytes) | Identifiers |")); // Second table
assertThat(actual, containsString("| Operator | Details | Estimated Rows | Rows | DB Hits | Cache H/M | Memory (Bytes) |")); // Second table
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class TablePlanFormatter {
private static final String TIME = "Time (ms)";
private static final String ORDER = "Ordered by";
private static final String MEMORY = "Memory (Bytes)";
private static final String IDENTIFIERS = "Identifiers";
public static final String IDENTIFIERS = "Identifiers";
private static final String OTHER = "Other";
public static final String DETAILS = "Details";
private static final String SEPARATOR = ", ";
Expand Down

0 comments on commit 01719f1

Please sign in to comment.