aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java
diff options
context:
space:
mode:
authorJana Fabrikova <[email protected]>2012-12-18 13:58:24 +0100
committerJana Fabrikova <[email protected]>2012-12-18 13:58:24 +0100
commit758f19cddefd164f0f2e1364a9e8d6c02dbe41e8 (patch)
treed6dd5cabfe320bb5fd2321a19f070c43cef00400 /tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java
parent9f073ba18f90391ac45ca8f8f8df1ae7516b90f9 (diff)
additions to test-extensions needed for the new AWTFramework
Diffstat (limited to 'tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java')
-rw-r--r--tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java38
1 files changed, 37 insertions, 1 deletions
diff --git a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java
index 4a2199f..49d58ea 100644
--- a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java
+++ b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java
@@ -64,7 +64,7 @@ public class ProcessWrapper {
public ProcessWrapper() {
}
- public ProcessWrapper(String toBeExecuted, List<String> otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) throws Exception {
+ public ProcessWrapper(String toBeExecuted, List<String> otherargs, URL u){
Assert.assertNotNull(u);
Assert.assertNotNull(toBeExecuted);
Assert.assertTrue(toBeExecuted.trim().length() > 1);
@@ -75,12 +75,24 @@ public class ProcessWrapper {
urledArgs.add(0, toBeExecuted);
urledArgs.add(u.toString());
this.args = urledArgs;
+ this.vars=null;
+ }
+
+ public ProcessWrapper(String toBeExecuted, List<String> otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) throws Exception {
+ this(toBeExecuted, otherargs, u);
this.addStdOutListener(stdoutl);
this.addStdErrListener(stderrl);
this.vars=vars;
}
+ public ProcessWrapper(String toBeExecuted, List<String> otherargs, URL u, List<ContentReaderListener> stdoutl, List<ContentReaderListener> stderrl, String[] vars) throws Exception {
+ this(toBeExecuted, otherargs, u);
+ this.addStdOutListeners(stdoutl);
+ this.addStdErrListeners(stderrl);
+ this.vars=vars;
+ }
+
ProcessWrapper(final List<String> args, File dir, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) {
this.args = args;
this.dir = dir;
@@ -89,6 +101,14 @@ public class ProcessWrapper {
this.vars = vars;
}
+ public ProcessWrapper(final List<String> args, File dir, List<ContentReaderListener> stdoutl, List<ContentReaderListener> stderrl, String[] vars) {
+ this.args = args;
+ this.dir = dir;
+ this.addStdOutListeners(stdoutl);
+ this.addStdErrListeners(stderrl);
+ this.vars = vars;
+ }
+
public final void addStdOutListener(ContentReaderListener l) {
if (l == null) {
return;
@@ -105,6 +125,22 @@ public class ProcessWrapper {
}
+ public final void addStdOutListeners(List<ContentReaderListener> l) {
+ if (l == null) {
+ return;
+ }
+ stdoutl.addAll(l);
+
+ }
+
+ public final void addStdErrListeners(List<ContentReaderListener> l) {
+ if (l == null) {
+ return;
+ }
+ stderrl.addAll(l);
+
+ }
+
/**
* @return the args
*/