com.sonyericsson.hudson.plugins.gerrit.trigger.test
Class SshdServerMock.PrintLinesCommand

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.gerrit.trigger.test.SshdServerMock.CommandMock
      extended by com.sonyericsson.hudson.plugins.gerrit.trigger.test.SshdServerMock.PrintLinesCommand
All Implemented Interfaces:
org.apache.sshd.server.Command
Enclosing class:
SshdServerMock

public static class SshdServerMock.PrintLinesCommand
extends SshdServerMock.CommandMock

A Command that prints a given list of lines when the now() method is called and then exits with 0. This command is not working as expected yet.


Field Summary
 
Fields inherited from class com.sonyericsson.hudson.plugins.gerrit.trigger.test.SshdServerMock.CommandMock
command, WAIT_FOR_DESTROYED
 
Constructor Summary
SshdServerMock.PrintLinesCommand(String command, List<String> lines)
          Standard constructor.
 
Method Summary
 void now()
          call this to make the command print its lines to the output.
 void start(org.apache.sshd.server.Environment environment)
          Default implementation just waits for the command to be destroyed.
 
Methods inherited from class com.sonyericsson.hudson.plugins.gerrit.trigger.test.SshdServerMock.CommandMock
destroy, getCommand, getErrorStream, getInputStream, getOutputStream, isDestroyed, setErrorStream, setExitCallback, setInputStream, setOutputStream, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SshdServerMock.PrintLinesCommand

public SshdServerMock.PrintLinesCommand(String command,
                                        List<String> lines)
Standard constructor.

Parameters:
command - the command
lines - the lines to print.
Method Detail

now

public void now()
call this to make the command print its lines to the output.


start

public void start(org.apache.sshd.server.Environment environment)
           throws IOException
Description copied from class: SshdServerMock.CommandMock
Default implementation just waits for the command to be destroyed.

Specified by:
start in interface org.apache.sshd.server.Command
Overrides:
start in class SshdServerMock.CommandMock
Parameters:
environment - env.
Throws:
IOException - if so.


Copyright © 2004-2013. All Rights Reserved.