directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r890445 - in /directory/shared/branches/shared-schema/ldap-schema-loader/src: main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java test/java/org/apache/directory/server/schema/SchemaManagerDelTest.java
Date Mon, 14 Dec 2009 19:10:32 GMT
Author: elecharny
Date: Mon Dec 14 19:10:25 2009
New Revision: 890445

URL: http://svn.apache.org/viewvc?rev=890445&view=rev
Log:
o Fixed the deletion for C/N/SC schemaObject
o Enabled the associated test

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerDelTest.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java?rev=890445&r1=890444&r2=890445&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
Mon Dec 14 19:10:25 2009
@@ -1413,6 +1413,22 @@
 
         return false;
     }
+    
+    
+    /**
+     * Get the inner SchemaObject if it's not a C/N/SC
+     */
+    private SchemaObject getSchemaObject( SchemaObject schemaObject ) throws NamingException
+    {
+        if ( registries.getGlobalOidRegistry().hasOid( schemaObject.getOid() ) )
+        {
+            return registries.getGlobalOidRegistry().getSchemaObject( schemaObject.getOid()
);
+        }
+        else
+        {
+            return schemaObject;
+        }
+    }
 
 
     /**
@@ -1609,8 +1625,8 @@
                 return false;
             }
 
-            // Build the new AttributeType from the given entry
-            SchemaObject toDelete = registries.getGlobalOidRegistry().getSchemaObject( schemaObject.getOid()
);
+            // Get the SchemaObject to delete if it's not a LoadableSchemaObject
+            SchemaObject toDelete = getSchemaObject( schemaObject );
 
             // First check that this SchemaObject does not have any referencing SchemaObjects
             Set<SchemaObjectWrapper> referencing = registries.getReferencing( toDelete
);

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerDelTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerDelTest.java?rev=890445&r1=890444&r2=890445&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerDelTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerDelTest.java
Mon Dec 14 19:10:25 2009
@@ -42,7 +42,6 @@
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 
@@ -256,7 +255,7 @@
     // Comparator deletion tests
     //-------------------------------------------------------------------------
 
-    @Ignore("lookup of newly added comparator is failing")
+    //@Ignore("lookup of newly added comparator is failing")
     @Test
     public void testDeleteExistingComaparator() throws Exception
     {



Mime
View raw message