harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r467232 - in /incubator/harmony/enhanced/classlib/trunk/modules/auth/src: main/java/common/javax/security/auth/kerberos/ test/java/common/org/apache/harmony/auth/tests/javax/security/auth/kerberos/
Date Tue, 24 Oct 2006 04:01:31 GMT
Author: smishura
Date: Mon Oct 23 21:01:30 2006
New Revision: 467232

URL: http://svn.apache.org/viewvc?view=rev&rev=467232
Log:
Fix for KerberosPrincipal.toString() + minor cleanup

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/kerberos/KerberosPrincipalTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java?view=diff&rev=467232&r1=467231&r2=467232
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java
Mon Oct 23 21:01:30 2006
@@ -59,9 +59,6 @@
     // type of the principal
     private transient int type;
 
-    // TODO: It is gag.
-    // When KerberosPrincipla will be realize then this method
-    // should be delete or modify
     private void init(String name) {
 
         // FIXME: correctly implement parsing name according to RFC 1964
@@ -122,19 +119,12 @@
     }
 
     public KerberosPrincipal(String name) {
-        // TODO: If principal name does't specify then a default realm
-        // should be read from krb.conf file else IllegalArgumentException
-        // should be throw
         init(name);
         type = KRB_NT_PRINCIPAL;
     }
 
     public KerberosPrincipal(String name, int type) {
-        // TODO: If principal name does't specify then a default realm
-        // should be read from krb.conf file else IllegalArgumentException
-        // should be throw
         init(name);
-        // TODO: it is gag
         if (type < 0 || type > KRB_NT_UID) {
             throw new IllegalArgumentException(Messages.getString("auth.25")); //$NON-NLS-1$
         }
@@ -174,7 +164,7 @@
 
     @Override
     public String toString() {
-        return super.toString();
+        return name;
     }
 
     private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
{

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/kerberos/KerberosPrincipalTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/kerberos/KerberosPrincipalTest.java?view=diff&rev=467232&r1=467231&r2=467232
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/kerberos/KerberosPrincipalTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/kerberos/KerberosPrincipalTest.java
Mon Oct 23 21:01:30 2006
@@ -231,13 +231,12 @@
      * @tests javax.security.auth.kerberos.KerberosPrincipal#toString()
      */
     public void test_toString() {
-        // FIXME
-        // KerberosPrincipal principal = new
-        // KerberosPrincipal("name@apache.org");
-        //
-        // assertEquals("javax.security.auth.kerberos.KerberosPrincipal@"
-        // + Integer.toHexString(principal.hashCode()), principal
-        // .toString());
+
+        String name = "name@apache.org";
+
+        KerberosPrincipal principal = new KerberosPrincipal(name);
+
+        assertEquals(name, principal.toString());
     }
 
     /**



Mime
View raw message