Skip to content

Commit 5a0074a

Browse files
author
Zhen
committed
Change the java driver to use neokit to manage server start
TODO: Test on windows Able to take args to change the server version used in the driver
1 parent 389376e commit 5a0074a

14 files changed

+154
-462
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "neokit"]
2+
path = neokit
3+
url = https://github.com/neo-technology/neokit.git

driver/src/test/java/org/neo4j/driver/v1/integration/CredentialsIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void shouldGetHelpfulErrorOnInvalidCredentials() throws Throwable
8787

8888
private void enableAuth( String password ) throws Exception
8989
{
90-
neo4j.restartServerOnEmptyDatabase( Neo4jSettings.DEFAULT
90+
neo4j.restart( Neo4jSettings.TEST_SETTINGS
9191
.updateWith( Neo4jSettings.AUTH_ENABLED, "true" )
9292
.updateWith( Neo4jSettings.DATA_DIR, tempDir.getRoot().getAbsolutePath().replace("\\", "/") ));
9393

driver/src/test/java/org/neo4j/driver/v1/integration/LoadCSVIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
package org.neo4j.driver.v1.integration;
2020

21-
import org.junit.Ignore;
2221
import org.junit.Rule;
2322
import org.junit.Test;
2423

@@ -39,7 +38,7 @@
3938
public class LoadCSVIT
4039
{
4140
@Rule
42-
public TestNeo4j neo4j = new TestNeo4j( Neo4jSettings.DEFAULT.without( Neo4jSettings.IMPORT_DIR ));
41+
public TestNeo4j neo4j = new TestNeo4j( Neo4jSettings.TEST_SETTINGS.without( Neo4jSettings.IMPORT_DIR ));
4342

4443
@Test
4544
public void shouldLoadCSV() throws Throwable

driver/src/test/java/org/neo4j/driver/v1/integration/TLSSocketChannelIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void shouldPerformTLSHandshakeWithTrustedCert() throws Throwable
138138
finally
139139
{
140140
// always restore the db default settings
141-
neo4j.restartServerOnEmptyDatabase( Neo4jSettings.DEFAULT );
141+
neo4j.restart();
142142
}
143143
}
144144

@@ -197,8 +197,8 @@ private void createFakeServerCertPairInKnownCerts( String host, int port, File k
197197
public void shouldFailTLSHandshakeDueToServerCertNotSignedByKnownCA() throws Throwable
198198
{
199199
// Given
200-
neo4j.restartServerOnEmptyDatabase(
201-
Neo4jSettings.DEFAULT.updateWith(
200+
neo4j.restart(
201+
Neo4jSettings.TEST_SETTINGS.updateWith(
202202
Neo4jSettings.CERT_DIR,
203203
folder.getRoot().getAbsolutePath().replace("\\", "/") ) );
204204
SocketChannel channel = SocketChannel.open();

driver/src/test/java/org/neo4j/driver/v1/stress/DriverStresser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static void main( String... args ) throws Throwable
5757
public static void setup() throws Exception
5858
{
5959
server = Neo4jRunner.getOrCreateGlobalRunner();
60-
server.ensureRunning( Neo4jSettings.DEFAULT );
60+
server.ensureRunning( Neo4jSettings.TEST_SETTINGS );
6161
driver = GraphDatabase.driver( "bolt://localhost" );
6262
}
6363

@@ -88,7 +88,7 @@ public int operation()
8888
public static void tearDown() throws Exception
8989
{
9090
driver.close();
91-
server.stop();
91+
server.stopNeo4j();
9292
}
9393

9494

driver/src/test/java/org/neo4j/driver/v1/tck/DriverAuthSteps.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void reset()
6363
{
6464
driver.close();
6565
}
66-
neo4j.useDefaultEncryptionKeyAndCert();
66+
neo4j.restart();
6767
}
6868
catch ( Exception e )
6969
{
@@ -121,7 +121,7 @@ public void aProtocolErrorIsRaised() throws Throwable
121121

122122
private Driver configureCredentials( String name, String oldPassword, String newPassword ) throws Exception
123123
{
124-
neo4j.restartServerOnEmptyDatabase( Neo4jSettings.DEFAULT
124+
neo4j.restart( Neo4jSettings.TEST_SETTINGS
125125
.updateWith( Neo4jSettings.AUTH_ENABLED, "true" )
126126
.updateWith( Neo4jSettings.DATA_DIR, tempDir.getAbsolutePath().replace("\\", "/") ));
127127

driver/src/test/java/org/neo4j/driver/v1/tck/DriverSecurityComplianceSteps.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public void clearAfterEachScenario() throws Throwable
268268
@After("@modifies_db_config")
269269
public void resetDbWithDefaultSettings() throws Throwable
270270
{
271-
neo4j.useDefaultEncryptionKeyAndCert();
271+
neo4j.restart();
272272
}
273273

274274
private File tempFile(String prefix, String suffix) throws Throwable

driver/src/test/java/org/neo4j/driver/v1/util/Neo4jDefaultInstaller.java

Lines changed: 0 additions & 77 deletions
This file was deleted.

driver/src/test/java/org/neo4j/driver/v1/util/Neo4jInstaller.java

Lines changed: 0 additions & 138 deletions
This file was deleted.

0 commit comments

Comments
 (0)