diff options
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiMockProcess.java')
-rw-r--r-- | systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiMockProcess.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiMockProcess.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiMockProcess.java new file mode 100644 index 0000000000..3c31f495e7 --- /dev/null +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiMockProcess.java @@ -0,0 +1,56 @@ +package org.eclipse.linuxtools.systemtap.ui.tests; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +public class SystemtapGuiMockProcess extends Process { + protected int exitcode; + + public SystemtapGuiMockProcess(int exitcode) { + this.exitcode = exitcode; + } + + @Override + public void destroy() { + } + + @Override + public int exitValue() { + return exitcode; + } + + @Override + public InputStream getErrorStream() { + return new InputStream() { + @Override + public int read() throws IOException { + return -1; + } + }; + } + + @Override + public InputStream getInputStream() { + return new InputStream() { + @Override + public int read() throws IOException { + return -1; + } + }; + } + + @Override + public OutputStream getOutputStream() { + return new OutputStream() { + public void write(int b) throws IOException { + } + }; + } + + @Override + public int waitFor() throws InterruptedException { + return exitcode; + } + +} |