You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2011/04/15 23:56:11 UTC
svn commit: r1092826 -
/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
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