1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.net.telnet;
18
19
20
21
22 public class SimpleOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
23
24
25
26 @Override
27 protected void setUp() {
28 opthand1 = new SimpleOptionHandler(4);
29 opthand2 = new SimpleOptionHandler(8, true, true, true, true);
30 opthand3 = new SimpleOptionHandler(91, false, false, false, false);
31 }
32
33
34
35
36 @Override
37 public void testAnswerSubnegotiation() {
38 final int[] subn = { TelnetCommand.IAC, TelnetCommand.SB, 4, 1, TelnetCommand.IAC, TelnetCommand.SE, };
39
40 final int[] resp1 = opthand1.answerSubnegotiation(subn, subn.length);
41
42 assertNull(resp1);
43 }
44
45
46
47
48 @Override
49 public void testConstructors() {
50 assertEquals(opthand1.getOptionCode(), 4);
51 assertEquals(opthand2.getOptionCode(), 8);
52 assertEquals(opthand3.getOptionCode(), 91);
53 super.testConstructors();
54 }
55
56
57
58
59 @Override
60 public void testStartSubnegotiation() {
61
62 final int[] resp1 = opthand1.startSubnegotiationLocal();
63 final int[] resp2 = opthand1.startSubnegotiationRemote();
64
65 assertNull(resp1);
66 assertNull(resp2);
67 }
68 }