Skip to content

Commit 236d3e7

Browse files
author
Zhen Li
committed
Make boltkit working on windows too
1 parent 117921f commit 236d3e7

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

driver/src/test/java/org/neo4j/driver/internal/DirectDriverBoltKitTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.IOException;
2323
import java.net.URI;
2424

25+
import org.junit.Test;
2526
import org.neo4j.driver.v1.Driver;
2627
import org.neo4j.driver.v1.GraphDatabase;
2728
import org.neo4j.driver.v1.Record;
@@ -34,6 +35,7 @@
3435

3536
public class DirectDriverBoltKitTest
3637
{
38+
@Test
3739
public void shouldBeAbleRunCypher() throws StubServer.ForceKilled, InterruptedException, IOException
3840
{
3941
// Given

driver/src/test/java/org/neo4j/driver/v1/GraphDatabaseBoltKitTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.IOException;
2323
import java.net.URI;
2424

25+
import org.junit.Test;
2526
import org.neo4j.driver.internal.RoutingDriver;
2627
import org.neo4j.driver.v1.util.StubServer;
2728

@@ -31,6 +32,7 @@
3132

3233
public class GraphDatabaseBoltKitTest
3334
{
35+
@Test
3436
public void boltPlusDiscoverySchemeShouldInstantiateClusterDriver() throws IOException, InterruptedException, StubServer.ForceKilled
3537
{
3638
// Given

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
package org.neo4j.driver.v1.util;
2121

2222
import java.io.IOException;
23+
import java.net.URISyntaxException;
2324
import java.net.URL;
25+
import java.nio.file.Paths;
2426
import java.util.ArrayList;
2527
import java.util.List;
2628

@@ -39,7 +41,7 @@ public static class ForceKilled extends Exception {}
3941
private StubServer( String script, int port ) throws IOException, InterruptedException
4042
{
4143
List<String> command = new ArrayList<>();
42-
command.addAll( singletonList( "/usr/local/bin/boltstub" ) );
44+
command.addAll( singletonList( "boltstub" ) );
4345
command.addAll( asList( Integer.toString( port ), script ) );
4446
ProcessBuilder server = new ProcessBuilder().inheritIO().command( command );
4547
process = server.start();
@@ -74,6 +76,14 @@ private static String resource( String fileName )
7476
{
7577
fail( fileName + " does not exists" );
7678
}
77-
return resource.getFile();
79+
try
80+
{
81+
return Paths.get( resource.toURI() ).toFile().getCanonicalPath();
82+
}
83+
catch ( Throwable e )
84+
{
85+
fail( e.toString() );
86+
throw new RuntimeException( e );
87+
}
7888
}
7989
}

0 commit comments

Comments
 (0)