    1   /*
    2    * Copyright 2003-2004 The Apache Software Foundation
    3    *
    4    * Licensed under the Apache License, Version 2.0 (the "License");
    5    * you may not use this file except in compliance with the License.
    6    * You may obtain a copy of the License at
    7    *
    8    *     http://www.apache.org/licenses/LICENSE-2.0
    9    *
    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  {
    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  }