diff options
Diffstat (limited to 'tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java')
-rw-r--r-- | tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java b/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java index 32f515a..2ee6b84 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java @@ -51,6 +51,7 @@ class ThreadedProcess extends Thread { List<String> args; Integer exitCode; Boolean running; + String[] variables; File dir; Throwable deadlyException = null; /* @@ -75,15 +76,36 @@ class ThreadedProcess extends Thread { return exitCode; } + public void setVariables(String[] variables) { + this.variables = variables; + } + + public String[] getVariables() { + return variables; + } + + + public ThreadedProcess(List<String> args) { this.args = args; } public ThreadedProcess(List<String> args, File dir) { - this.args = args; + this(args); this.dir = dir; } + public ThreadedProcess(List<String> args,String[] vars) { + this(args); + this.variables = vars; + } + + public ThreadedProcess(List<String> args, File dir,String[] vars) { + this(args,dir); + this.variables = vars; + } + + public String getCommandLine() { String commandLine = "unknown command"; try { @@ -110,9 +132,13 @@ class ThreadedProcess extends Thread { running = true; Runtime r = Runtime.getRuntime(); if (dir == null) { - p = r.exec(args.toArray(new String[0])); + if (variables == null) { + p = r.exec(args.toArray(new String[0])); + } else { + p = r.exec(args.toArray(new String[0]), variables); + } } else { - p = r.exec(args.toArray(new String[0]), new String[0], dir); + p = r.exec(args.toArray(new String[0]), variables, dir); } try { exitCode = p.waitFor(); |