You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2009/06/10 19:04:53 UTC

svn commit: r783427 - /directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java

Author: kayyagari
Date: Wed Jun 10 17:04:52 2009
New Revision: 783427

URL: http://svn.apache.org/viewvc?rev=783427&view=rev
Log:
added a test to check the newly added method

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

Modified: directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java?rev=783427&r1=783426&r2=783427&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java (original)
+++ directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java Wed Jun 10 17:04:52 2009
@@ -19,7 +19,12 @@
  */
 package org.apache.directory.shared.client.api;
 
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
+
 import java.io.IOException;
+import java.util.List;
 
 import org.apache.directory.server.core.integ.Level;
 import org.apache.directory.server.core.integ.annotations.CleanupLevel;
@@ -28,13 +33,10 @@
 import org.apache.directory.shared.ldap.client.api.LdapConnection;
 import org.apache.directory.shared.ldap.client.api.exception.LdapException;
 import org.apache.directory.shared.ldap.client.api.messages.BindResponse;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertNotNull;
-
 /**
  * Test the LdapConnection class
  *
@@ -83,4 +85,18 @@
             }
         }
     }
+    
+    
+    @Test
+    public void testGetSupportedControls() throws Exception
+    {
+        LdapConnection connection = new LdapConnection( "localhost", ldapService.getPort() );
+
+        LdapDN dn = new LdapDN( "uid=admin,ou=system" );
+        connection.bind( dn.getUpName(), "secret" );
+        
+        List<String> controlList = connection.getSupportedConrols();
+        assertNotNull( controlList );
+        assertFalse( controlList.isEmpty() );
+    }
 }