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

Commit 2e01e7b

Browse files
authored
Merge pull request #60 from spacecowboy/update-java-drivers
Update to latest java driver milestone
2 parents f6ff76a + 35277e7 commit 2e01e7b

File tree

4 files changed

+44
-8
lines changed

4 files changed

+44
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ clean: ## Clean build directories
5555
rm -rf tmp
5656
./gradlew clean
5757

58-
rmhosts:
58+
rmhosts: ## Remove known hosts file
5959
rm -rf ~/.neo4j/known_hosts
6060

6161
launch: rmhosts clean build run ## Removes known hosts file, cleans, builds, and runs the shell

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ subprojects {
6262
ext {
6363
argparse4jVersion = '0.7.0'
6464
junitVersion = '4.12'
65-
neo4jJavaVersion = '1.1.0-M02'
65+
neo4jJavaVersion = '1.1.0-M05'
6666
findbugsVersion = '3.0.0'
6767
jansiVersion = '1.13'
6868
jlineVersion = '2.14.2'

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

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class CypherShellIntegrationTest {
3232
private Logger logger = mock(Logger.class);
3333
private Command rollbackCommand;
3434
private Command commitCommand;
35-
private Command beginCommand ;
35+
private Command beginCommand;
3636
private CypherShell shell;
3737

3838
@Before
@@ -49,7 +49,7 @@ public void setUp() throws Exception {
4949

5050
@After
5151
public void tearDown() throws Exception {
52-
shell.execute("MATCH (n:TestPerson) DETACH DELETE (n)");
52+
shell.execute("MATCH (n) DETACH DELETE (n)");
5353
}
5454

5555
@Test
@@ -100,7 +100,43 @@ public void rollbackScenario() throws CommandException {
100100
rollbackCommand.execute("");
101101

102102
//then
103-
shell.execute("MATCH (n:TestPerson) RETURN n");
103+
shell.execute("MATCH (n) RETURN n");
104+
105+
ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
106+
verify(logger, times(3)).printOut(captor.capture());
107+
108+
List<String> result = captor.getAllValues();
109+
assertThat(result.get(2), is("n\n(:TestPerson {name: \"Jane Smith\"})"));
110+
}
111+
112+
@Test
113+
public void resetOutOfTxScenario() throws CommandException {
114+
//when
115+
shell.execute("CREATE (:TestPerson {name: \"Jane Smith\"})");
116+
shell.reset();
117+
118+
//then
119+
shell.execute("CREATE (:TestPerson {name: \"Jane Smith\"})");
120+
shell.execute("MATCH (n) RETURN n");
121+
122+
ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
123+
verify(logger, times(3)).printOut(captor.capture());
124+
125+
List<String> result = captor.getAllValues();
126+
assertThat(result.get(2), is("n\n(:TestPerson {name: \"Jane Smith\"})" +
127+
"\n(:TestPerson {name: \"Jane Smith\"})"));
128+
}
129+
130+
@Test
131+
public void resetInTxScenario() throws CommandException {
132+
//when
133+
beginCommand.execute("");
134+
shell.execute("CREATE (:Random)");
135+
shell.reset();
136+
137+
//then
138+
shell.execute("CREATE (:TestPerson {name: \"Jane Smith\"})");
139+
shell.execute("MATCH (n) RETURN n");
104140

105141
ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
106142
verify(logger, times(3)).printOut(captor.capture());
@@ -116,7 +152,7 @@ public void commitScenario() throws CommandException {
116152
commitCommand.execute("");
117153

118154
//then
119-
shell.execute("MATCH (n:TestPerson) RETURN n");
155+
shell.execute("MATCH (n) RETURN n");
120156

121157
ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
122158
verify(logger, times(2)).printOut(captor.capture());
@@ -126,7 +162,7 @@ public void commitScenario() throws CommandException {
126162
}
127163

128164
@Test
129-
public void setUnsetVariables() throws CommandException {
165+
public void setAndListVariables() throws CommandException {
130166
assertTrue(shell.getAll().isEmpty());
131167

132168
long randomLong = System.currentTimeMillis();

tyrekicking.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function prepare-bundle {
1111
}
1212

1313
function testscript {
14-
if cypher-shell/cypher-shell "RETURN 1;"; then
14+
if cypher-shell/cypher-shell -u neo4j -p neo "RETURN 1;"; then
1515
echo "$1 Success!"
1616
else
1717
echo "$1 Failure!"

0 commit comments

Comments
 (0)