directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 56247 - in incubator/directory/eve/trunk/jndi-provider/src: java/org/apache/eve/auth java/org/apache/eve/jndi test/org/apache/eve/jndi test/org/apache/eve/jndi/ibs
Date Mon, 01 Nov 2004 16:06:38 GMT
Author: akarasulu
Date: Mon Nov  1 08:06:38 2004
New Revision: 56247

Modified:
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/auth/LdapPrincipal.java
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java
   incubator/directory/eve/trunk/jndi-provider/src/test/org/apache/eve/jndi/AbstractJndiTest.java
   incubator/directory/eve/trunk/jndi-provider/src/test/org/apache/eve/jndi/ibs/AuthorizationServiceTest.java
Log:
non-serializable LdapPrincipal was causing a problem

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/auth/LdapPrincipal.java
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/auth/LdapPrincipal.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/auth/LdapPrincipal.java
Mon Nov  1 08:06:38 2004
@@ -19,6 +19,7 @@
 
 import javax.naming.Name;
 import java.security.Principal;
+import java.io.Serializable;
 
 import org.apache.ldap.common.name.LdapName;
 
@@ -30,7 +31,7 @@
  * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class LdapPrincipal implements Principal
+public class LdapPrincipal implements Principal, Serializable
 {
     /** the normalized distinguished name of the principal */
     private final Name name;

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java
Mon Nov  1 08:06:38 2004
@@ -162,9 +162,20 @@
     {
         if ( env.containsKey( SHUTDOWN_OP_ENV ) )
         {
-            provider.shutdown();
-            provider = null;
-            initialEnv = null;
+            try
+            {
+                provider.shutdown();
+            }
+            catch( Throwable t )
+            {
+                t.printStackTrace();
+            }
+            finally
+            {
+                provider = null;
+                initialEnv = null;
+            }
+
             return null;
         }
 

Modified: incubator/directory/eve/trunk/jndi-provider/src/test/org/apache/eve/jndi/AbstractJndiTest.java
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/test/org/apache/eve/jndi/AbstractJndiTest.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/test/org/apache/eve/jndi/AbstractJndiTest.java
Mon Nov  1 08:06:38 2004
@@ -137,15 +137,7 @@
         env.put( EveContextFactory.SHUTDOWN_OP_ENV, "" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "testing" );
-
-        try
-        {
-            new InitialContext( env );
-        }
-        catch( Exception e )
-        {
-        }
-
+        try { new InitialContext( env ); } catch( Exception e ) {}
         sysRoot = null;
     }
 }

Modified: incubator/directory/eve/trunk/jndi-provider/src/test/org/apache/eve/jndi/ibs/AuthorizationServiceTest.java
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/test/org/apache/eve/jndi/ibs/AuthorizationServiceTest.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/test/org/apache/eve/jndi/ibs/AuthorizationServiceTest.java
Mon Nov  1 08:06:38 2004
@@ -63,6 +63,13 @@
     }
 
 
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+        sysRootAsNonRootUser = null;
+    }
+
+
     /**
      * Makes sure the admin cannot delete the admin account.
      *
@@ -155,20 +162,20 @@
     }
 
 
-//    /**
-//     * Makes sure the a non-admin user cannot rename the admin account.
-//     */
-//    public void testModifyOnAdminByNonAdmin()
-//    {
-//        Attributes attributes = new LockableAttributesImpl();
-//        attributes.put( "userPassword", "replaced" );
-//
-//        try
-//        {
-//            sysRootAsNonRootUser.modifyAttributes( "uid=admin",
-//                    DirContext.REPLACE_ATTRIBUTE, attributes );
-//            fail( sysRootAsNonRootUser.getPrincipal().getDn() +
-//                    " should not be able to modify attributes on admin" );
-//        } catch( Exception e ) { }
-//    }
+    /**
+     * Makes sure the a non-admin user cannot rename the admin account.
+     */
+    public void testModifyOnAdminByNonAdmin()
+    {
+        Attributes attributes = new LockableAttributesImpl();
+        attributes.put( "userPassword", "replaced" );
+
+        try
+        {
+            sysRootAsNonRootUser.modifyAttributes( "uid=admin",
+                    DirContext.REPLACE_ATTRIBUTE, attributes );
+            fail( sysRootAsNonRootUser.getPrincipal().getDn() +
+                    " should not be able to modify attributes on admin" );
+        } catch( Exception e ) { }
+    }
 }

Mime
View raw message