TerminalTypeOptionHandlerTestpublic class TerminalTypeOptionHandlerTest extends TelnetOptionHandlerTestAbstract JUnit test class for TerminalTypeOptionHandler
|
Methods Summary |
---|
protected boolean | equalInts(int[] a1, int[] a2)compares two arrays of int
if(a1.length != a2.length)
{
return(false);
}
else
{
boolean result = true;
for(int ii=0; ii<a1.length; ii++)
{
if(a1[ii]!= a2[ii])
result = false;
}
return(result);
}
| public static void | main(java.lang.String[] args)main for running the test.
junit.textui.TestRunner.run(TerminalTypeOptionHandlerTest.class);
| protected void | setUp()setUp for the test.
opthand1 = new TerminalTypeOptionHandler("VT100");
opthand2 = new TerminalTypeOptionHandler("ANSI", true, true, true, true);
opthand3 = new TerminalTypeOptionHandler("ANSI", false, false, false, false);
| public void | testAnswerSubnegotiation()test of client-driven subnegotiation.
Checks that the terminal type is sent
int subn[] =
{
TelnetOption.TERMINAL_TYPE, 1
};
int expected1[] =
{
TelnetOption.TERMINAL_TYPE, 0, 'V", 'T", '1", '0", '0"
};
int expected2[] =
{
TelnetOption.TERMINAL_TYPE, 0, 'A", 'N", 'S", 'I"
};
int resp1[] = opthand1.answerSubnegotiation(subn, subn.length);
int resp2[] = opthand2.answerSubnegotiation(subn, subn.length);
assertTrue(equalInts(resp1, expected1));
assertTrue(equalInts(resp2, expected2));
| public void | testConstructors()test of the constructors.
assertEquals(opthand1.getOptionCode(), TelnetOption.TERMINAL_TYPE);
super.testConstructors();
| public void | testStartSubnegotiation()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);
|
|