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