Added console messaging when testing reb2sac and geneNet

This commit is contained in:
Chris Myers 2017-09-14 12:08:11 -06:00
parent 309e3f5a2f
commit 8d7e8fc8af

View file

@ -47,6 +47,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.lang.ProcessBuilder.Redirect;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
@ -327,7 +328,7 @@ public class Gui implements BioObserver, MouseListener, ActionListener, MouseMot
protected static final String atacsVersion = "6.1";
protected static final String iBioSimVersion = "2.9.6";
protected static final String iBioSimVersion = "3.0.0-beta";
protected SEDMLDocument sedmlDocument = null;
@ -8950,7 +8951,11 @@ public class Gui implements BioObserver, MouseListener, ActionListener, MouseMot
envp[i] = envVar + "=" + env.get(envVar);
i++;
}
ps.redirectErrorStream(true);
//ps.redirectOutput(Redirect.INHERIT);
ps.redirectError(Redirect.INHERIT);
//ps.redirectErrorStream(true);
Process reb2sac = ps.start();
if (reb2sac != null) {
exitValue = reb2sac.waitFor();
@ -8958,14 +8963,14 @@ public class Gui implements BioObserver, MouseListener, ActionListener, MouseMot
if (exitValue != 255 && exitValue != -1) {
Executables.reb2sacFound = false;
System.out.println("ERROR: " + Executables.reb2sacExecutable + " not found.");
System.out.println("ERROR: " + Executables.reb2sacExecutable + " not functional" + " (" + exitValue + ").");
}
} catch (IOException e) {
Executables.reb2sacFound = false;
System.out.println("ERROR: " + Executables.reb2sacExecutable + " reb2sac not found.");
System.out.println("ERROR: " + Executables.reb2sacExecutable + " not found.");
} catch (InterruptedException e) {
Executables.reb2sacFound = false;
System.out.println("ERROR: " + Executables.reb2sacExecutable + " throws exception.");
System.out.println("ERROR: " + Executables.reb2sacExecutable + " throws exception.");
}
exitValue = 1;
@ -8997,14 +9002,16 @@ public class Gui implements BioObserver, MouseListener, ActionListener, MouseMot
if (System.getenv("PATH") != null) {
env.put("PATH", System.getenv("PATH"));
}
ps.redirectErrorStream(true);
//ps.redirectOutput(Redirect.INHERIT);
ps.redirectError(Redirect.INHERIT);
//ps.redirectErrorStream(true);
Process geneNet = ps.start();
if (geneNet != null) {
exitValue = geneNet.waitFor();
}
if (exitValue != 255 && exitValue != 134 && exitValue != -1) {
Executables.geneNetFound = false;
System.out.println("ERROR: " + Executables.geneNetExecutable + " not functional.");
System.out.println("ERROR: " + Executables.geneNetExecutable + " not functional." + " (" + exitValue + ").");
}
} catch (IOException e) {