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 26
26
import java .net .URI ;
27
27
import java .nio .channels .SocketChannel ;
28
28
import java .util .ArrayList ;
29
+ import java .util .Arrays ;
29
30
import java .util .List ;
30
31
import java .util .Map ;
31
32
import java .util .Scanner ;
@@ -190,7 +191,9 @@ private void installNeo4j() throws IOException
190
191
191
192
moveFile ( new File ( tempHomeDir ), targetHomeFile );
192
193
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" ) );
194
197
}
195
198
}
196
199
Original file line number Diff line number Diff line change 19
19
package org .neo4j .driver .util .cc ;
20
20
21
21
import java .io .BufferedReader ;
22
+ import java .io .File ;
22
23
import java .io .IOException ;
23
24
import java .io .InputStream ;
24
25
import java .io .InputStreamReader ;
@@ -53,11 +54,12 @@ public static boolean boltKitAvailable()
53
54
}
54
55
}
55
56
56
- public static String executeCommand ( List <String > commands )
57
+ public static String executeCommand ( List <String > commands , File directory )
57
58
{
58
59
try
59
60
{
60
61
ProcessBuilder processBuilder = new ProcessBuilder ().command ( commands );
62
+ processBuilder .directory ( directory );
61
63
ProcessEnvConfigurator .configure ( processBuilder );
62
64
return executeAndGetStdOut ( processBuilder );
63
65
}
@@ -72,9 +74,14 @@ public static String executeCommand( List<String> commands )
72
74
}
73
75
}
74
76
77
+ public static String executeCommand ( List <String > commands )
78
+ {
79
+ return executeCommand ( commands , null );
80
+ }
81
+
75
82
public static String executeCommand ( String ... command )
76
83
{
77
- return executeCommand ( asList ( command ) );
84
+ return executeCommand ( asList ( command ), null );
78
85
}
79
86
80
87
private static String executeAndGetStdOut ( ProcessBuilder processBuilder )
You can’t perform that action at this time.
0 commit comments