|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sonyericsson.hudson.plugins.gerrit.trigger.test.SshdServerMock.CommandMock
public static class SshdServerMock.CommandMock
A mocked ssh command.
SshdServerMock.createCommand(String)| Field Summary | |
|---|---|
protected String |
command
|
protected static int |
WAIT_FOR_DESTROYED
The max ms to wait before checking if the command is destroyed. |
| Constructor Summary | |
|---|---|
SshdServerMock.CommandMock(String command)
Standard constructor. |
|
| Method Summary | |
|---|---|
void |
destroy()
|
String |
getCommand()
The command from the client. |
OutputStream |
getErrorStream()
The error stream from the command. |
InputStream |
getInputStream()
The input stream to the command. |
OutputStream |
getOutputStream()
the output stream from the command. |
boolean |
isDestroyed()
Is the command destroyed. |
void |
setErrorStream(OutputStream errorStream)
|
void |
setExitCallback(org.apache.sshd.server.ExitCallback exitCallback)
|
void |
setInputStream(InputStream inputStream)
|
void |
setOutputStream(OutputStream outputStream)
|
void |
start(org.apache.sshd.server.Environment environment)
Default implementation just waits for the command to be destroyed. |
void |
stop(int exitCode)
Stops the command from running. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int WAIT_FOR_DESTROYED
protected String command
| Constructor Detail |
|---|
public SshdServerMock.CommandMock(String command)
command - the command to "execute".| Method Detail |
|---|
public void setInputStream(InputStream inputStream)
setInputStream in interface org.apache.sshd.server.Commandpublic void setOutputStream(OutputStream outputStream)
setOutputStream in interface org.apache.sshd.server.Commandpublic void setErrorStream(OutputStream errorStream)
setErrorStream in interface org.apache.sshd.server.Commandpublic void setExitCallback(org.apache.sshd.server.ExitCallback exitCallback)
setExitCallback in interface org.apache.sshd.server.Command
public void start(org.apache.sshd.server.Environment environment)
throws IOException
start in interface org.apache.sshd.server.Commandenvironment - env.
IOException - if so.public void stop(int exitCode)
exitCode - the exitCode to return to the client.public void destroy()
destroy in interface org.apache.sshd.server.Commandpublic boolean isDestroyed()
public InputStream getInputStream()
public OutputStream getOutputStream()
public OutputStream getErrorStream()
public String getCommand()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||