use of org.neo4j.test.ProcessStreamHandler in project neo4j by neo4j.
the class OnlineBackupCommandIT method runBackupToolFromOtherJvmToGetExitCode.
public static int runBackupToolFromOtherJvmToGetExitCode(File neo4jHome, String... args) throws Exception {
List<String> allArgs = new ArrayList<>(Arrays.asList(ProcessUtil.getJavaExecutable().toString(), "-cp", ProcessUtil.getClassPath(), AdminTool.class.getName()));
allArgs.add("backup");
allArgs.addAll(Arrays.asList(args));
Process process = Runtime.getRuntime().exec(allArgs.toArray(new String[allArgs.size()]), new String[] { "NEO4J_HOME=" + neo4jHome.getAbsolutePath() });
return new ProcessStreamHandler(process, true).waitForResult();
}
Aggregations