File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
driver/src/test/java/org/neo4j/driver/util Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 2626import java .net .URI ;
2727import java .nio .channels .SocketChannel ;
2828import java .util .ArrayList ;
29+ import java .util .Arrays ;
2930import java .util .List ;
3031import java .util .Map ;
3132import java .util .Scanner ;
@@ -190,7 +191,9 @@ private void installNeo4j() throws IOException
190191
191192 moveFile ( new File ( tempHomeDir ), targetHomeFile );
192193 debug ( "Installed server at `%s`." , HOME_DIR );
193- executeCommand ( "neoctrl-set-initial-password" , PASSWORD , HOME_DIR );
194+
195+ String setPasswordCommand = "5.0" .equals ( split [split .length - 1 ] ) ? "neo4j-admin dbms set-initial-password" : "neo4j-admin set-initial-password" ;
196+ executeCommand ( Arrays .asList ( setPasswordCommand , PASSWORD ), new File ( HOME_DIR + "/bin" ) );
194197 }
195198 }
196199
Original file line number Diff line number Diff line change 1919package org .neo4j .driver .util .cc ;
2020
2121import java .io .BufferedReader ;
22+ import java .io .File ;
2223import java .io .IOException ;
2324import java .io .InputStream ;
2425import java .io .InputStreamReader ;
@@ -53,11 +54,12 @@ public static boolean boltKitAvailable()
5354 }
5455 }
5556
56- public static String executeCommand ( List <String > commands )
57+ public static String executeCommand ( List <String > commands , File directory )
5758 {
5859 try
5960 {
6061 ProcessBuilder processBuilder = new ProcessBuilder ().command ( commands );
62+ processBuilder .directory ( directory );
6163 ProcessEnvConfigurator .configure ( processBuilder );
6264 return executeAndGetStdOut ( processBuilder );
6365 }
@@ -72,9 +74,14 @@ public static String executeCommand( List<String> commands )
7274 }
7375 }
7476
77+ public static String executeCommand ( List <String > commands )
78+ {
79+ return executeCommand ( commands , null );
80+ }
81+
7582 public static String executeCommand ( String ... command )
7683 {
77- return executeCommand ( asList ( command ) );
84+ return executeCommand ( asList ( command ), null );
7885 }
7986
8087 private static String executeAndGetStdOut ( ProcessBuilder processBuilder )
You can’t perform that action at this time.
0 commit comments