directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1092826 - /directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
Date Fri, 15 Apr 2011 21:56:11 GMT
Author: elecharny
Date: Fri Apr 15 21:56:11 2011
New Revision: 1092826

URL: http://svn.apache.org/viewvc?rev=1092826&view=rev
Log:
Added a test

Modified:
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java?rev=1092826&r1=1092825&r2=1092826&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
Fri Apr 15 21:56:11 2011
@@ -179,6 +179,24 @@ public class SimpleBindRequestTest exten
 
 
     /**
+     * Test a failing anonymous bind request.
+     */
+    @Test
+    public void testAnonymousBindRequestNotAllowed() throws Exception
+    {
+        getLdapServer().getDirectoryService().setAllowAnonymousAccess( false );
+        
+        BindResponse bindResponse = connection.bind();
+        assertEquals( ResultCodeEnum.INVALID_CREDENTIALS, bindResponse.getLdapResult().getResultCode()
);
+        
+        getLdapServer().getDirectoryService().setAllowAnonymousAccess( true );
+
+        bindResponse = connection.bind();
+        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()
);
+    }
+
+
+    /**
      * Test an Anonymous BindRequest
      */
     @Test



Mime
View raw message