01: /*
02: * Copyright 2003-2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
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: * main for running the test.
28: ***/
29: public static void main(String args[]) {
30: junit.textui.TestRunner.run(TelnetOptionTest.class);
31: }
32:
33: /***
34: * test of the isValidOption method.
35: ***/
36: public void testisValidOption() {
37: assertTrue(TelnetOption.isValidOption(0));
38: assertTrue(TelnetOption.isValidOption(91));
39: assertTrue(TelnetOption.isValidOption(255));
40: assertTrue(!TelnetOption.isValidOption(256));
41: }
42:
43: /***
44: * test of the getOption method.
45: ***/
46: public void testGetOption() {
47: assertEquals(TelnetOption.getOption(0), "BINARY");
48: assertEquals(TelnetOption.getOption(91), "UNASSIGNED");
49: assertEquals(TelnetOption.getOption(255),
50: "Extended-Options-List");
51: }
52: }
|