1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.net.telnet;
17
18 import junit.framework.TestCase;
19
20 /***
21 * JUnit test class for TelnetOption
22 * <p>
23 * @author Bruno D'Avanzo
24 ***/
25 public class TelnetOptionTest extends TestCase
26 {
27 /***
28 * main for running the test.
29 ***/
30 public static void main(String args[])
31 {
32 junit.textui.TestRunner.run(TelnetOptionTest.class);
33 }
34
35 /***
36 * test of the isValidOption method.
37 ***/
38 public void testisValidOption()
39 {
40 assertTrue(TelnetOption.isValidOption(0));
41 assertTrue(TelnetOption.isValidOption(91));
42 assertTrue(TelnetOption.isValidOption(255));
43 assertTrue(!TelnetOption.isValidOption(256));
44 }
45
46 /***
47 * test of the getOption method.
48 ***/
49 public void testGetOption()
50 {
51 assertEquals(TelnetOption.getOption(0), "BINARY");
52 assertEquals(TelnetOption.getOption(91), "UNASSIGNED");
53 assertEquals(TelnetOption.getOption(255), "Extended-Options-List");
54 }
55 }