|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Process
lp.test.util.FakeProcess
public class FakeProcess
A fake process class. Was used before but now it is here just for fun :o)
Field Summary | |
---|---|
private int |
exit
The exit value. |
private InputStream |
stderr
The standard error InputStream . |
private OutputStream |
stdin
The standard input OutputStream . |
private InputStream |
stdout
The standard output InputStream . |
Constructor Summary | |
---|---|
FakeProcess(int exit)
Creates a new instance with the given return value. |
|
FakeProcess(String stdout,
int exit)
Creates a new instance with the given contents of standard output and and a given return value. |
|
FakeProcess(String stdout,
String stderr,
int exit)
Creates a new instance with the given contents of standard output and standard error streams and a given return value. |
Method Summary | |
---|---|
void |
destroy()
Has no effect. |
int |
exitValue()
Returns the exit value of this fake process. |
InputStream |
getErrorStream()
Returns the standard error InputStream of this fake process. |
InputStream |
getInputStream()
Returns the standard output InputStream of this fake process. |
OutputStream |
getOutputStream()
Returns the standard input OutputStream of this fake process. |
int |
waitFor()
Returns the exit value of this fake process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final OutputStream stdin
OutputStream
.
private final InputStream stdout
InputStream
.
private final InputStream stderr
InputStream
.
private final int exit
Constructor Detail |
---|
public FakeProcess(int exit)
black hole
OutputStream
.
exit
- the return value of the new fake processpublic FakeProcess(String stdout, int exit)
black hole
OutputStream
.
stdout
- the contents of the standard output stream of the new
processexit
- the return value of the new fake processpublic FakeProcess(String stdout, String stderr, int exit)
black hole
OutputStream
.
stdout
- the contents of the standard output stream of the new
fake processstderr
- the contents of the error output stream of the new
fake processexit
- the return value of the new fake processMethod Detail |
---|
public OutputStream getOutputStream()
OutputStream
of this fake process.
getOutputStream
in class Process
OutputStream
of this fake processpublic InputStream getInputStream()
InputStream
of this fake process.
getInputStream
in class Process
InputStream
of this fake processpublic InputStream getErrorStream()
InputStream
of this fake process.
getErrorStream
in class Process
InputStream
of this fake processpublic int waitFor()
waitFor
in class Process
public int exitValue()
exitValue
in class Process
public void destroy()
destroy
in class Process
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |