directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r950291 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/directory/server/core/interceptor/ core-integ/src/main/java/org/apache/directory/server/core/integ/ core-inte...
Date Tue, 01 Jun 2010 22:44:07 GMT
Author: elecharny
Date: Tue Jun  1 22:44:07 2010
New Revision: 950291

URL: http://svn.apache.org/viewvc?rev=950291&view=rev
Log:
o The DS getSession now throw an LdapException
o Eliminated a potential NPE when transmitting a null password
o The bind() method now throws an LdapException
o Fixed the InterceptorException
o Fixed tests as bind() throws an exception now
o Added tests where we send a null password, to show that DIRSERVER-1309 has been fixed

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/OperationManager.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorException.java
    directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java
    directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java
    directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
Tue Jun  1 22:44:07 2010
@@ -36,6 +36,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.schema.SchemaService;
 import org.apache.directory.shared.ldap.csn.Csn;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -196,7 +197,7 @@ public interface DirectoryService extend
      *
      * @return a logical session as a specific user
      */
-    CoreSession getSession( DN principalDn, byte[] credentials ) throws Exception;
+    CoreSession getSession( DN principalDn, byte[] credentials ) throws LdapException;
 
     
     /**

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
Tue Jun  1 22:44:07 2010
@@ -78,6 +78,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -939,11 +940,14 @@ public class LdapCoreSessionConnection i
     {
         try
         {
-            setSession( directoryService.getSession( name, credentials.getBytes() ) );
+            byte[] credBytes = ( credentials == null ? StringTools.EMPTY_BYTES : StringTools.getBytesUtf8(
credentials ) );
+
+            setSession( directoryService.getSession( name, credBytes ) );
         }
-        catch( Exception e )
+        catch ( LdapException e )
         {
             LOG.warn( e.getMessage(), e );
+            throw e;
         }
         
         return null;

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/OperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/OperationManager.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/OperationManager.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/OperationManager.java
Tue Jun  1 22:44:07 2010
@@ -42,6 +42,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 
 
@@ -147,7 +148,7 @@ public interface OperationManager
     /**
      * TODO document after determining if this method should be here.
      */
-    void bind( BindOperationContext opContext ) throws Exception;
+    void bind( BindOperationContext opContext ) throws LdapException;
 
     
     /**

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
Tue Jun  1 22:44:07 2010
@@ -58,6 +58,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -770,7 +771,7 @@ public class InterceptorChain
     }
 
 
-    public void bind( BindOperationContext opContext ) throws Exception
+    public void bind( BindOperationContext opContext ) throws LdapException
     {
         Element node = getStartingEntry();
         Interceptor head = node.interceptor;
@@ -781,9 +782,9 @@ public class InterceptorChain
         {
             head.bind( next, opContext );
         }
-        catch ( Exception ne )
+        catch ( LdapException le )
         {
-            throw ne;
+            throw le;
         }
         catch ( Throwable e )
         {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorException.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorException.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorException.java
Tue Jun  1 22:44:07 2010
@@ -22,6 +22,8 @@ package org.apache.directory.server.core
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.ldap.exception.LdapException;
+
 
 /**
  * A {@link NamingException} that wraps uncaught runtime exceptions thrown
@@ -30,7 +32,7 @@ import javax.naming.NamingException;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class InterceptorException extends NamingException
+public class InterceptorException extends LdapException
 {
     private static final long serialVersionUID = 3258690996517746233L;
 
@@ -45,8 +47,9 @@ public class InterceptorException extend
      *
      * @param interceptor the Interceptor causing the failure
      */
-    public InterceptorException(Interceptor interceptor)
+    public InterceptorException( Interceptor interceptor )
     {
+        super();
         this.interceptor = interceptor;
     }
 
@@ -57,7 +60,7 @@ public class InterceptorException extend
      * @param interceptor the Interceptor causing the failure
      * @param explanation String explanation of why the Interceptor failed
      */
-    public InterceptorException(Interceptor interceptor, String explanation)
+    public InterceptorException( Interceptor interceptor, String explanation )
     {
         super( explanation );
         this.interceptor = interceptor;
@@ -70,10 +73,10 @@ public class InterceptorException extend
      * @param interceptor the Interceptor causing the failure
      * @param rootCause   the root cause of this exception
      */
-    public InterceptorException(Interceptor interceptor, Throwable rootCause)
+    public InterceptorException( Interceptor interceptor, Throwable rootCause )
     {
-        this( interceptor );
-        super.setRootCause( rootCause );
+        super( rootCause );
+        this.interceptor = interceptor;
     }
 
 
@@ -84,10 +87,10 @@ public class InterceptorException extend
      * @param explanation String explanation of why the Interceptor failed
      * @param rootCause   the root cause of this exception
      */
-    public InterceptorException(Interceptor interceptor, String explanation, Throwable rootCause)
+    public InterceptorException( Interceptor interceptor, String explanation, Throwable rootCause
)
     {
-        this( interceptor, explanation );
-        super.setRootCause( rootCause );
+        super( explanation, rootCause );
+        this.interceptor = interceptor;
     }
 
 

Modified: directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
(original)
+++ directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
Tue Jun  1 22:44:07 2010
@@ -54,6 +54,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -377,8 +378,10 @@ public class IntegrationUtils
     public static LdapConnection getConnectionAs( DirectoryService dirService, DN dn, String
password ) throws Exception
     {
         Object connectionObj = LdapConnectionFactory.getCoreSessionConnection();
-        ( ( LdapCoreSessionConnection ) connectionObj ).setSession( dirService.getSession(
dn, password.getBytes() ) );
         
+        byte[] passwdBytes = password == null ? StringTools.EMPTY_BYTES : StringTools.getBytesUtf8(
password );
+        ( ( LdapCoreSessionConnection ) connectionObj ).setSession( dirService.getSession(
dn, passwdBytes ) );
+
         return ( LdapConnection )connectionObj;
     }
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
Tue Jun  1 22:44:07 2010
@@ -23,9 +23,9 @@ package org.apache.directory.server.core
 import static org.apache.directory.server.core.integ.IntegrationUtils.apply;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getConnectionAs;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getUserAddLdif;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.directory.ldap.client.api.LdapConnection;
@@ -37,6 +37,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.IntegrationUtils;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.After;
@@ -208,11 +209,17 @@ public class SimpleAuthenticationIT exte
         // close and try with old password (should fail)
         connection.close();
 
-        connection.bind( userDn, "test" );
-        assertFalse( connection.isAuthenticated() );
+        try
+        {
+            connection.bind( userDn, "test" );
+            fail();
+        }
+        catch ( LdapException le )
+        {
+            connection.close();
+        }
 
-        // close and try again now with new password (should fail)
-        connection.close();
+        // close and try again now with new password (should succeed)
         connection.bind( userDn, "newpwd" );
 
         entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
@@ -259,11 +266,17 @@ public class SimpleAuthenticationIT exte
         // close and try with old password (should fail)
         connection.close();
 
-        connection.bind( userDn, "test" );
-        assertFalse( connection.isAuthenticated() );
-        connection.close();
+        try
+        {
+            connection.bind( userDn, "test" );
+            fail();
+        }
+        catch ( LdapException le )
+        {
+            connection.close();
+        }
 
-        // try again now with new password (should be successfull)
+        // try again now with new password (should be successful)
         connection.bind( userDn, "secret" );
         assertTrue( connection.isAuthenticated() );
         entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
@@ -301,11 +314,17 @@ public class SimpleAuthenticationIT exte
         // close and try with old password (should fail)
         connection.close();
 
-        connection.bind( userDn, "test" );
-        assertFalse( connection.isAuthenticated() );
-        connection.close();
+        try
+        {
+            connection.bind( userDn, "test" );
+            fail();
+        }
+        catch ( LdapException le )
+        {
+            connection.close();
+        }
 
-        // try again now with new password (should be successfull)
+        // try again now with new password (should be successful)
         connection.bind( userDn, "secret" );
         entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
         assertNotNull( entry );
@@ -341,9 +360,15 @@ public class SimpleAuthenticationIT exte
         // close and try with old password (should fail)
         connection.close();
 
-        connection.bind( userDn, "test" );
-        assertFalse( connection.isAuthenticated() );
-        connection.close();
+        try
+        {
+            connection.bind( userDn, "test" );
+            fail();
+        }
+        catch ( LdapException le )
+        {
+            connection.close();
+        }
 
         // try again now with new password (should be successful)
         connection.bind( userDn, "test123" );
@@ -381,11 +406,17 @@ public class SimpleAuthenticationIT exte
         // close and try with old password (should fail)
         connection.close();
 
-        connection.bind( userDn, "test" );
-        assertFalse( connection.isAuthenticated() );
-        connection.close();
+        try
+        {
+            connection.bind( userDn, "test" );
+            fail();
+        }
+        catch ( LdapException le )
+        {
+            connection.close();
+        }
 
-        // try again now with new password (should be successfull)
+        // try again now with new password (should be successful)
         connection.bind( userDn, "secret" );
         entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
         assertNotNull( entry );
@@ -422,9 +453,15 @@ public class SimpleAuthenticationIT exte
         // close and try with old password (should fail)
         connection.close();
 
-        connection.bind( userDn, "test" );
-        assertFalse( connection.isAuthenticated() );
-        connection.close();
+        try
+        {
+            connection.bind( userDn, "test" );
+            fail();
+        }
+        catch ( LdapException le )
+        {
+            connection.close();
+        }
 
         // try again now with new password (should be successful)
         connection.bind( userDn, "secret" );
@@ -462,11 +499,17 @@ public class SimpleAuthenticationIT exte
         // close and try with old password (should fail)
         connection.close();
 
-        connection.bind( userDn, "test" );
-        assertFalse( connection.isAuthenticated() );
-        connection.close();
+        try
+        {
+            connection.bind( userDn, "test" );
+            fail();
+        }
+        catch ( LdapException le )
+        {
+            connection.close();
+        }
 
-        // try again now with new password (should be successfull)
+        // try again now with new password (should be successful)
         connection.bind( userDn, "secret" );
         entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
         assertNotNull( entry );
@@ -501,8 +544,14 @@ public class SimpleAuthenticationIT exte
         connection.modify( modReq );
         connection.close();
 
-        connection.bind( userDn, "test" );
-        assertFalse( connection.isAuthenticated() );
-        connection.close();
+        try
+        {
+            connection.bind( userDn, "test" );
+            fail();
+        }
+        catch ( LdapException le )
+        {
+            connection.close();
+        }
     }
 }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java
Tue Jun  1 22:44:07 2010
@@ -40,11 +40,14 @@ import javax.naming.directory.InitialDir
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
+import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.server.core.integ.IntegrationUtils;
 import org.apache.directory.server.core.jndi.CoreContextFactory;
 import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -85,7 +88,7 @@ public class SimpleBindIT extends Abstra
      * @throws Exception on error
      */
     @Test
-    public void testSimpleBindUserPassword()
+    public void testSimpleBindAPrincipalAPassword()
     {
         // We will bind using JNDI
         // Set up the environment for creating the initial context
@@ -128,7 +131,7 @@ public class SimpleBindIT extends Abstra
      * @throws Exception on error
      */
     @Test
-    public void testSimpleBindUserBadPassword()
+    public void testSimpleBindAPrincipalBadPassword()
     {
         // We will bind using JNDI
         // Set up the environment for creating the initial context
@@ -167,7 +170,7 @@ public class SimpleBindIT extends Abstra
      * @throws Exception on error
      */
     @Test
-    public void testSimpleBindBadUserPassword()
+    public void testSimpleBindBadPrincipalAPassword()
     {
         // We will bind using JNDI
         // Set up the environment for creating the initial context
@@ -206,7 +209,7 @@ public class SimpleBindIT extends Abstra
      * @throws Exception on error
      */
     @Test
-    public void testSimpleBindUnknowUserPassword()
+    public void testSimpleBindUnknowPrincipalAPassword()
     {
         // We will bind using JNDI
         // Set up the environment for creating the initial context
@@ -247,7 +250,7 @@ public class SimpleBindIT extends Abstra
      * @throws Exception on error
      */
     @Test
-    public void testSimpleBindNoUserNoPassword()
+    public void testSimpleBindNoPrincipalNoPassword()
     {
         // We will bind using JNDI
         // Set up the environment for creating the initial context
@@ -258,7 +261,7 @@ public class SimpleBindIT extends Abstra
         // Bind on the rootDSE
         env.put( Context.PROVIDER_URL, "" );
 
-        // Authenticate as admin and password "secret"
+        // Authenticate with no principal and no password : this is an anonymous bind
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );
         env.put( Context.SECURITY_PRINCIPAL, "" );
         env.put( Context.SECURITY_CREDENTIALS, "" );
@@ -325,7 +328,7 @@ public class SimpleBindIT extends Abstra
      * @throws Exception on error
      */
     @Test
-    public void testSimpleBindUserNoPassword()
+    public void testSimpleBindAPrincipalNoPassword()
     {
         // We will bind using JNDI
         // Set up the environment for creating the initial context
@@ -358,12 +361,46 @@ public class SimpleBindIT extends Abstra
 
 
     /**
+     * covers the Unauthenticated case : we should get a UnwillingToPerform error.
+     * 
+     * @throws Exception on error
+     */
+    @Test
+    public void testSimpleBindAPrincipalNullPassword() throws Exception
+    {
+        try
+        {
+            LdapConnection connection = IntegrationUtils.getConnectionAs( service, "uid=admin,ou=system",
null );
+            
+            // We should have failed wilh an LdapUnwillingToPerformException
+            fail();
+        }
+        catch ( LdapUnwillingToPerformException lutpe )
+        {
+            // expected
+        }
+
+        LdapConnection connection = IntegrationUtils.getConnectionAs( service, "uid=admin,ou=system",
"secret" );
+
+        try
+        {
+            connection.bind( "uid=admin,ou=system", null );
+            fail();
+        }
+        catch ( LdapUnwillingToPerformException lutpe )
+        {
+            // expected
+        }
+    }
+
+
+    /**
      * not allowed by the server. We should get a invalidCredentials error.
      * 
      * @throws Exception on error
      */
     @Test
-    public void testSimpleBindNoUserPassword() throws Exception
+    public void testSimpleBindNoPrincipalAPassword() throws Exception
     {
         // We will bind using JNDI
         // Set up the environment for creating the initial context

Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java
(original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java
Tue Jun  1 22:44:07 2010
@@ -39,6 +39,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.schema.SchemaService;
 import org.apache.directory.shared.ldap.csn.Csn;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -368,7 +369,7 @@ public class MockDirectoryService implem
     }
 
 
-    public CoreSession getSession( DN principalDn, byte[] credentials ) throws Exception
+    public CoreSession getSession( DN principalDn, byte[] credentials ) throws LdapException
     {
         return null;
     }

Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java
(original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java
Tue Jun  1 22:44:07 2010
@@ -41,6 +41,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 
 public class MockOperationManager implements OperationManager
@@ -57,7 +58,7 @@ public class MockOperationManager implem
     }
 
     
-    public void bind( BindOperationContext opContext ) throws Exception
+    public void bind( BindOperationContext opContext ) throws LdapException
     {
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Tue Jun  1 22:44:07 2010
@@ -660,8 +660,7 @@ public class DefaultDirectoryService imp
     }
     
     
-    public CoreSession getSession( DN principalDn, byte[] credentials ) 
-        throws Exception
+    public CoreSession getSession( DN principalDn, byte[] credentials ) throws LdapException
     {
         if ( ! started )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
Tue Jun  1 22:44:07 2010
@@ -53,6 +53,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapAffectMultipleDsaException;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.exception.LdapPartialResultException;
 import org.apache.directory.shared.ldap.exception.LdapReferralException;
@@ -271,7 +272,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public void bind( BindOperationContext opContext ) throws Exception
+    public void bind( BindOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> BindOperation : {}", opContext );
 

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
Tue Jun  1 22:44:07 2010
@@ -86,8 +86,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.cursor.Cursor;
 import org.apache.directory.shared.ldap.cursor.CursorIterator;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
-import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
@@ -796,7 +797,7 @@ public class MaxImmSubFilterTest
         }
 
 
-        public CoreSession getSession( DN principalDn, byte[] credentials ) throws Exception
+        public CoreSession getSession( DN principalDn, byte[] credentials ) throws LdapException
         {
             return null;
         }
@@ -930,7 +931,7 @@ public class MaxImmSubFilterTest
         }
 
         
-        public void bind( BindOperationContext opContext ) throws Exception
+        public void bind( BindOperationContext opContext ) throws LdapException
         {
         }
 

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
Tue Jun  1 22:44:07 2010
@@ -52,6 +52,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.csn.Csn;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -602,7 +603,7 @@ public class InterceptorChainTest
         }
 
 
-        public CoreSession getSession( DN principalDn, byte[] credentials ) throws Exception
+        public CoreSession getSession( DN principalDn, byte[] credentials ) throws LdapException
         {
             return null;
         }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java?rev=950291&r1=950290&r2=950291&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
Tue Jun  1 22:44:07 2010
@@ -192,7 +192,7 @@ public class SimpleBindIT extends Abstra
      * try to connect using a user with an invalid DN: we should get a invalidDNSyntax error.
      */
     @Test
-    public void testSimpleBindBadUserPassword()
+    public void testSimpleBindBadPrincipalAPassword()
     {
         Hashtable<String, String> env = new Hashtable<String, String>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
@@ -222,7 +222,7 @@ public class SimpleBindIT extends Abstra
      * try to connect using a unknown user: we should get a invalidCredentials error.
      */
     @Test
-    public void testSimpleBindUnknowUserPassword()
+    public void testSimpleBindUnknowPrincipalAPassword()
     {
         Hashtable<String, String> env = new Hashtable<String, String>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
@@ -250,7 +250,7 @@ public class SimpleBindIT extends Abstra
      * covers the anonymous authentication : we should be able to read the rootDSE, but that's
it
      */
     @Test
-    public void testSimpleBindNoUserNoPassword()
+    public void testSimpleBindNoPrincipalNoPassword()
     {
         boolean oldValue = ldapServer.getDirectoryService().isAllowAnonymousAccess();
         ldapServer.getDirectoryService().setAllowAnonymousAccess( false );
@@ -336,7 +336,7 @@ public class SimpleBindIT extends Abstra
      * covers the Unauthenticated case : we should get a UnwillingToPerform error.
      */
     @Test
-    public void testSimpleBindUserNoPassword()
+    public void testSimpleBindPrincipalNoPassword()
     {
         Hashtable<String, String> env = new Hashtable<String, String>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
@@ -366,7 +366,7 @@ public class SimpleBindIT extends Abstra
      * not allowed by the server. We should get a invalidCredentials error.
      */
     @Test
-    public void testSimpleBindNoUserPassword() throws Exception
+    public void testSimpleBindNoUserAPassword() throws Exception
     {
         Hashtable<String, String> env = new Hashtable<String, String>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );



Mime
View raw message