directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r929933 - in /directory/clients/ldap/trunk: ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
Date Thu, 01 Apr 2010 11:26:05 GMT
Author: kayyagari
Date: Thu Apr  1 11:26:05 2010
New Revision: 929933

URL: http://svn.apache.org/viewvc?rev=929933&view=rev
Log:
o updated the loadSchema() method to load all schemas
o updated the testcase

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

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=929933&r1=929932&r2=929933&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Thu Apr  1 11:26:05 2010
@@ -26,6 +26,7 @@ import java.net.InetSocketAddress;
 import java.net.SocketAddress;
 import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -136,6 +137,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.parsers.OpenLdapSchemaParser;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
+import org.apache.directory.shared.ldap.schema.registries.Schema;
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.mina.core.filterchain.IoFilter;
@@ -3002,8 +3004,16 @@ public class LdapNetworkConnection exten
             JarLdifSchemaLoader jarSchemaLoader = new JarLdifSchemaLoader();
 
             schemaManager = new DefaultSchemaManager( jarSchemaLoader );
+            
+            // we enale all the schemas so that need not check with server for enabled schemas
+            Collection<Schema> schemas = schemaManager.getLoader().getAllSchemas();
+            for( Schema s : schemas )
+            {
+                s.enable();
+            }
+
             schemaManager.loadAllEnabled();
-            schemaManager.getLoader().getAllSchemas();
+            
             if( ! schemaManager.getErrors().isEmpty() )
             {
                 String msg = "there are errors while loading the schema";

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java?rev=929933&r1=929932&r2=929933&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
Thu Apr  1 11:26:05 2010
@@ -185,12 +185,14 @@ public class LdapConnectionTest extends 
 
     
     @Test
-    public void testLoadSchema() throws LdapException
+    public void testLoadSchema() throws Exception
     {
         connection.loadSchema();
         SchemaManager manager = connection.getSchemaManager();
         assertNotNull( manager );
         assertTrue( manager.isEnabled( "system" ) );
+        assertTrue( manager.isEnabled( "nis" ) );
+        assertEquals( manager.getLoader().getAllSchemas().size(), manager.getEnabled().size()
);
     }
     
 }



Mime
View raw message