FileDocCategorySizeDatePackage
EchoOptionHandlerTest.javaAPI DocApache Commons NET 1.4.1 API2257Sat Dec 03 10:05:48 GMT 2005org.apache.commons.net.telnet

EchoOptionHandlerTest

public class EchoOptionHandlerTest extends TelnetOptionHandlerTestAbstract
JUnit test class for EchoOptionHandler

author
Bruno D'Avanzo

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)
main for running the test.

        junit.textui.TestRunner.run(EchoOptionHandlerTest.class);
    
protected voidsetUp()
setUp for the test.

        opthand1 = new EchoOptionHandler();
        opthand2 = new EchoOptionHandler(true, true, true, true);
        opthand3 = new EchoOptionHandler(false, false, false, false);
    
public voidtestAnswerSubnegotiation()
test of server-driven subnegotiation. Checks that no subnegotiation is made.

        int subn[] =
        {
            TelnetCommand.IAC, TelnetCommand.SB, TelnetOption.ECHO,
            1, TelnetCommand.IAC, TelnetCommand.SE,
        };

        int resp1[] = opthand1.answerSubnegotiation(subn, subn.length);

        assertEquals(resp1, null);
    
public voidtestConstructors()
test of the constructors.

        assertEquals(opthand1.getOptionCode(), TelnetOption.ECHO);
        super.testConstructors();
    
public voidtestStartSubnegotiation()
test of client-driven subnegotiation. Checks that no subnegotiation is made.

        int resp1[] = opthand1.startSubnegotiationLocal();
        int resp2[] = opthand1.startSubnegotiationRemote();

        assertEquals(resp1, null);
        assertEquals(resp2, null);