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 InvalidTelnetOptionException
22: * <p>
23: * @author Bruno D'Avanzo
24: ***/
25: public class InvalidTelnetOptionExceptionTest extends TestCase {
26: private InvalidTelnetOptionException exc1;
27: private String msg1;
28: private int code1;
29:
30: /***
31: * main for running the test.
32: ***/
33: public static void main(String args[]) {
34: junit.textui.TestRunner
35: .run(InvalidTelnetOptionExceptionTest.class);
36: }
37:
38: /***
39: * setUp for the test.
40: ***/
41: protected void setUp() {
42: msg1 = new String("MSG");
43: code1 = 13;
44: exc1 = new InvalidTelnetOptionException(msg1, code1);
45: }
46:
47: /***
48: * test of the constructors.
49: ***/
50: public void testConstructors() {
51: assertTrue(exc1.getMessage().indexOf(msg1) >= 0);
52: assertTrue(exc1.getMessage().indexOf("" + code1) >= 0);
53: }
54: }
|