You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by br...@apache.org on 2003/06/01 13:33:40 UTC

cvs commit: jakarta-commons/net/src/test/org/apache/commons/net/telnet SimpleOptionHandlerTest.java

brudav      2003/06/01 04:33:40

  Modified:    net/src/java/org/apache/commons/net/telnet TelnetOption.java
               net/src/test/org/apache/commons/net/telnet
                        SimpleOptionHandlerTest.java
  Log:
  Resolution to bug 20354 (unable to register option handlers if option > 39)
  
  Revision  Changes    Path
  1.5       +34 -3     jakarta-commons/net/src/java/org/apache/commons/net/telnet/TelnetOption.java
  
  Index: TelnetOption.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/telnet/TelnetOption.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TelnetOption.java	26 Jan 2003 00:21:45 -0000	1.4
  +++ TelnetOption.java	1 Jun 2003 11:33:40 -0000	1.5
  @@ -154,7 +154,7 @@
       public static int EXTENDED_OPTIONS_LIST = 255;
   
       private static int __FIRST_OPTION = BINARY;
  -    private static int __LAST_OPTION = NEW_ENVIRONMENT_VARIABLES;
  +    private static int __LAST_OPTION = EXTENDED_OPTIONS_LIST;
   
       private static final String __optionString[] = {
                   "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME", "STATUS",
  @@ -164,7 +164,31 @@
                   "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD", "TACACS UID",
                   "OUTPUT MARKING", "TTYLOC", "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED",
                   "LFLOW", "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
  -                "ENCRYPT", "NEW-ENVIRON"
  +                "ENCRYPT", "NEW-ENVIRON", "TN3270E", "XAUTH", "CHARSET", "RSP",
  +                "Com Port Control", "Suppress Local Echo", "Start TLS",
  +                "KERMIT", "SEND-URL", "FORWARD_X", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "TELOPT PRAGMA LOGON", "TELOPT SSPI LOGON",
  +                "TELOPT PRAGMA HEARTBEAT", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "", "", "", "", "", "", "", "", "", "",
  +                "Extended-Options-List"
               };
   
   
  @@ -177,7 +201,14 @@
        ***/
       public static final String getOption(int code)
       {
  -        return __optionString[code];
  +        if(__optionString[code].length() == 0)
  +        {
  +            return "UNASSIGNED";
  +        }
  +        else
  +        {
  +            return __optionString[code];
  +        }
       }
   
   
  
  
  
  1.4       +2 -2      jakarta-commons/net/src/test/org/apache/commons/net/telnet/SimpleOptionHandlerTest.java
  
  Index: SimpleOptionHandlerTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/test/org/apache/commons/net/telnet/SimpleOptionHandlerTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SimpleOptionHandlerTest.java	18 May 2003 04:19:41 -0000	1.3
  +++ SimpleOptionHandlerTest.java	1 Jun 2003 11:33:40 -0000	1.4
  @@ -77,7 +77,7 @@
       {
           opthand1 = new SimpleOptionHandler(4);
           opthand2 = new SimpleOptionHandler(8, true, true, true, true);
  -        opthand3 = new SimpleOptionHandler(30, false, false, false, false);
  +        opthand3 = new SimpleOptionHandler(91, false, false, false, false);
       }
   
       /***
  @@ -87,7 +87,7 @@
       {
           assertEquals(opthand1.getOptionCode(), 4);
           assertEquals(opthand2.getOptionCode(), 8);
  -        assertEquals(opthand3.getOptionCode(), 30);
  +        assertEquals(opthand3.getOptionCode(), 91);
           super.testConstructors();
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org