directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r818693 - /directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
Date Fri, 25 Sep 2009 01:46:34 GMT
Author: elecharny
Date: Fri Sep 25 01:46:34 2009
New Revision: 818693

URL: http://svn.apache.org/viewvc?rev=818693&view=rev
Log:
Fixed the isDisbaled() method which was only checking if the schema was loaded.

Modified:
    directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java?rev=818693&r1=818692&r2=818693&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
Fri Sep 25 01:46:34 2009
@@ -19,7 +19,7 @@
 package org.apache.directory.server.core.integ;
 
 
-import java.io.File; 
+import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
@@ -33,9 +33,11 @@
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
@@ -44,12 +46,10 @@
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.schema.registries.Schema;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.jndi.ServerLdapContext;
-
 
 /**
  * Integration test utility methods.
@@ -316,11 +316,21 @@
     
     
     /**
-     * A helper method which tells if a schema is disabled
+     * A helper method which tells if a schema is disabled.
      */
     public static boolean isDisabled( DirectoryService service, String schemaName )
     {
-    	return ! service.getRegistries().isSchemaLoaded( schemaName );
+        Schema schema = service.getRegistries().getLoadedSchema( schemaName );
+        
+        if ( schema != null )
+        {
+            return schema.isDisabled();
+        }
+        else
+        {
+            // If the schema is not loaded, it's disabled
+            return false;
+        }
     }
     
     



Mime
View raw message