1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.net.telnet;
17
18 /***
19 * JUnit test class for SuppressGAOptionHandler
20 * <p>
21 * @author Bruno D'Avanzo
22 ***/
23 public class SuppressGAOptionHandlerTest extends TelnetOptionHandlerTestAbstract
24 {
25 /***
26 * main for running the test.
27 ***/
28 public static void main(String args[])
29 {
30 junit.textui.TestRunner.run(SuppressGAOptionHandlerTest.class);
31 }
32
33 /***
34 * setUp for the test.
35 ***/
36 protected void setUp()
37 {
38 opthand1 = new SuppressGAOptionHandler();
39 opthand2 = new SuppressGAOptionHandler(true, true, true, true);
40 opthand3 = new SuppressGAOptionHandler(false, false, false, false);
41 }
42
43 /***
44 * test of the constructors.
45 ***/
46 public void testConstructors()
47 {
48 assertEquals(opthand1.getOptionCode(), TelnetOption.SUPPRESS_GO_AHEAD);
49 super.testConstructors();
50 }
51
52 /***
53 * test of client-driven subnegotiation.
54 * Checks that no subnegotiation is made.
55 ***/
56 public void testStartSubnegotiation()
57 {
58
59 int resp1[] = opthand1.startSubnegotiationLocal();
60 int resp2[] = opthand1.startSubnegotiationRemote();
61
62 assertEquals(resp1, null);
63 assertEquals(resp2, null);
64 }
65
66 /***
67 * test of server-driven subnegotiation.
68 * Checks that no subnegotiation is made.
69 ***/
70 public void testAnswerSubnegotiation()
71 {
72 int subn[] =
73 {
74 TelnetCommand.IAC, TelnetCommand.SB, TelnetOption.SUPPRESS_GO_AHEAD,
75 1, TelnetCommand.IAC, TelnetCommand.SE,
76 };
77
78 int resp1[] = opthand1.answerSubnegotiation(subn, subn.length);
79
80 assertEquals(resp1, null);
81 }
82 }