directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r835320 - in /directory/apacheds/branches/apacheds-schema: core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ core-integ/src/test/java/org/apache/directory/server/core/schema/
Date Thu, 12 Nov 2009 10:03:53 GMT
Author: elecharny
Date: Thu Nov 12 10:03:47 2009
New Revision: 835320

URL: http://svn.apache.org/viewvc?rev=835320&view=rev
Log:
Fixed del operation for AttributeTypes

Modified:
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java?rev=835320&r1=835319&r2=835320&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
Thu Nov 12 10:03:47 2009
@@ -181,6 +181,7 @@
         
         // Get the AttributeType from the given entry ( it has been grabbed from the server
earlier)
         String schemaName = getSchemaName( entry.getDn() );
+        
         AttributeType attributeType = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
schemaName );
         
         // Applies the Registries to this AttributeType 

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java?rev=835320&r1=835319&r2=835320&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
Thu Nov 12 10:03:47 2009
@@ -113,8 +113,8 @@
     // ----------------------------------------------------------------------
     // Test all core methods with normal operational pathways
     // ----------------------------------------------------------------------
-
-    
+    // Test Add operation
+    // ----------------------------------------------------------------------
     @Test
     public void testAddAttributeTypeToEnabledSchema() throws Exception
     {
@@ -131,6 +131,10 @@
         
         LdapDN dn = getAttributeTypeContainer( "apachemeta" );
         dn.add( "m-oid=" + OID );
+        
+        assertFalse( isOnDisk( dn ) );
+        assertFalse( service.getSchemaManager().getAttributeTypeRegistry().contains( OID
) );
+
         getSchemaContext( service ).createSubcontext( dn, attrs );
         
         assertTrue( service.getSchemaManager().getAttributeTypeRegistry().contains( OID )
);
@@ -201,6 +205,9 @@
     }
 
     
+    // ----------------------------------------------------------------------
+    // Test Delete operation
+    // ----------------------------------------------------------------------
     @Test
     public void testDeleteAttributeTypeFromEnabledSchema() throws Exception
     {
@@ -227,7 +234,6 @@
     }
     
     
-    /*
     @Test
     public void testDeleteAttributeTypeFromDisabledSchema() throws Exception
     {
@@ -240,18 +246,11 @@
         assertFalse( "attributeType should be removed from the registry after being deleted",

             service.getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
 
-        // Check on disk that the added SchemaObject exist
-        assertFalse( isOnDisk( dn ) );
+        // Check on disk that the added SchemaObject exists
+        assertTrue( isOnDisk( dn ) );
         
-        try
-        {
-            getSchemaContext( service ).destroySubcontext( dn );
-            fail( "Should not be there" );
-        }
-        catch( NameNotFoundException nnfe )
-        {
-            // Expected result.
-        }
+        // Remove the AT
+        getSchemaContext( service ).destroySubcontext( dn );
 
         // Check in Registries
         assertFalse( "attributeType should be removed from the registry after being deleted",

@@ -260,7 +259,6 @@
         // Check on disk that the deleted SchemaObject does not exist anymore
         assertFalse( isOnDisk( dn ) );
     }
-    */
 
 
     @Test



Mime
View raw message