Search in sources :

Example 6 with ProcessStreamHandler

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();
}
Also used : ArrayList(java.util.ArrayList) ProcessStreamHandler(org.neo4j.test.ProcessStreamHandler)

Aggregations

ProcessStreamHandler (org.neo4j.test.ProcessStreamHandler)6 ArrayList (java.util.ArrayList)3 OutputStream (java.io.OutputStream)1 Field (java.lang.reflect.Field)1 RemoteException (java.rmi.RemoteException)1 ExecutorService (java.util.concurrent.ExecutorService)1 Args (org.neo4j.helpers.Args)1 Exceptions.launderedException (org.neo4j.helpers.Exceptions.launderedException)1 RmiLocation (org.neo4j.shell.impl.RmiLocation)1 InputStreamAwaiter (org.neo4j.test.InputStreamAwaiter)1