directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1201778 - /directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/
Date Mon, 14 Nov 2011 16:31:12 GMT
Author: elecharny
Date: Mon Nov 14 16:31:12 2011
New Revision: 1201778

URL: http://svn.apache.org/viewvc?rev=1201778&view=rev
Log:
Get rid of some more JNDI constructions

Modified:
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java?rev=1201778&r1=1201777&r2=1201778&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java Mon Nov 14 16:31:12 2011
@@ -37,7 +37,7 @@ public abstract class AbstractMetaSchema
     protected static String workingDir;
 
     @Before
-    public final void init()
+    public void init() throws Exception
     {
         workingDir = getService().getInstanceLayout().getPartitionsDirectory().getAbsolutePath();
     }
@@ -52,6 +52,29 @@ public abstract class AbstractMetaSchema
     {
         StringBuilder sb = new StringBuilder();
 
+        sb.append( workingDir ).append( '/' ).append( getService().getSchemaPartition().getId() );
+
+        for ( Rdn rdn : dn )
+        {
+            sb.append( '/' );
+            sb.append( Strings.toLowerCase( rdn.getName() ) );
+        }
+
+        sb.append( ".ldif" );
+
+        return sb.toString();
+    }
+
+
+    /**
+     * Get the path on disk where a specific SchemaObject is stored
+     *
+     * @param dn the SchemaObject Dn
+     */
+    protected String getSchemaPath0( Dn dn )
+    {
+        StringBuilder sb = new StringBuilder();
+
         sb.append( workingDir ).append( '/' ).append( getService().getSchemaPartition().getId() ).append( '/' ).append( "ou=schema" );
 
         for ( Rdn rdn : dn )
@@ -74,7 +97,7 @@ public abstract class AbstractMetaSchema
      */
     protected boolean isOnDisk( Dn dn )
     {
-        // donot change the value of getSchemaPath to lowercase
+        // do not change the value of getSchemaPath to lowercase
         // on Linux this gives a wrong path
         String schemaObjectFileName = getSchemaPath( dn );
 
@@ -85,6 +108,24 @@ public abstract class AbstractMetaSchema
 
 
     /**
+     * Check that a specific SchemaObject is stored on the disk at the
+     * correct position in the Ldif partition
+     *
+     * @param dn The SchemaObject Dn
+     */
+    protected boolean isOnDisk0( Dn dn )
+    {
+        // do not change the value of getSchemaPath to lowercase
+        // on Linux this gives a wrong path
+        String schemaObjectFileName = getSchemaPath0( dn );
+
+        File file = new File( schemaObjectFileName );
+
+        return file.exists();
+    }
+
+
+    /**
      * Gets relative Dn to ou=schema.
      *
      * @param schemaName the name of the schema
@@ -103,7 +144,7 @@ public abstract class AbstractMetaSchema
      * @param schemaName the name of the schema
      * @return the dn of the a schema's attributeType entity container
      * @throws Exception on failure
-     */
+     *
     protected Dn getAttributeTypeContainer( String schemaName ) throws Exception
     {
         return new Dn( "ou=attributeTypes,cn=" + schemaName );

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java?rev=1201778&r1=1201777&r2=1201778&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java Mon Nov 14 16:31:12 2011
@@ -20,32 +20,32 @@
 package org.apache.directory.server.core.schema;
 
 
-import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import javax.naming.NameNotFoundException;
-import javax.naming.OperationNotSupportedException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
-import javax.naming.ldap.LdapContext;
-
+import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.server.core.integ.IntegrationUtils;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
+import org.apache.directory.shared.ldap.model.entry.DefaultAttribute;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.model.entry.DefaultModification;
+import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.apache.directory.shared.ldap.model.entry.Modification;
+import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.exception.LdapUnwillingToPerformException;
-import org.apache.directory.shared.ldap.model.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.name.Dn;
+import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
-import org.apache.directory.shared.ldap.util.JndiUtils;
+import org.apache.directory.shared.ldap.model.schema.SchemaManager;
+import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -68,6 +68,18 @@ public class MetaAttributeTypeHandlerIT 
     private static final String NEW_OID = "1.3.6.1.4.1.18060.0.4.0.2.100001";
     private static final String DEPENDEE_OID = "1.3.6.1.4.1.18060.0.4.0.2.100002";
 
+    private static LdapConnection connection;
+    private SchemaManager schemaManager;
+
+    
+    @Before
+    public void init() throws Exception
+    {
+        super.init();
+        connection = IntegrationUtils.getAdminConnection( getService() );
+        schemaManager = getService().getSchemaManager();
+    }
+
     // ----------------------------------------------------------------------
     // Test all core methods with normal operational pathways
     // ----------------------------------------------------------------------
@@ -81,7 +93,9 @@ public class MetaAttributeTypeHandlerIT 
     @Test
     public void testAddAttributeTypeWithoutMatchingRule() throws Exception
     {
-        Attributes attrs = LdifUtils.createJndiAttributes(
+        Dn dn = new Dn( "m-oid=2.5.4.58,ou=attributeTypes,cn=apachemeta,ou=schema" );
+        Entry entry = new DefaultEntry(
+            dn,
             "objectClass: top",
             "objectClass: metaTop",
             "objectClass: metaAttributeType",
@@ -91,19 +105,16 @@ public class MetaAttributeTypeHandlerIT 
             "m-description: attribute certificate use ;binary"
          );
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=2.5.4.58" );
-
         // Pre-checks
         assertFalse( isOnDisk( dn ) );
-        assertFalse( getService().getSchemaManager().getAttributeTypeRegistry().contains( "2.5.4.58" ) );
+        assertFalse( schemaManager.getAttributeTypeRegistry().contains( "2.5.4.58" ) );
 
         // Addition
-        getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( dn ), attrs );
+        connection.add( entry );
 
         // Post-checks
-        assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( "2.5.4.58" ) );
-        assertEquals( getService().getSchemaManager().getAttributeTypeRegistry().getSchemaName( "2.5.4.58" ), "apachemeta" );
+        assertTrue( schemaManager.getAttributeTypeRegistry().contains( "2.5.4.58" ) );
+        assertEquals( schemaManager.getAttributeTypeRegistry().getSchemaName( "2.5.4.58" ), "apachemeta" );
         assertTrue( isOnDisk( dn ) );
     }
 
@@ -111,30 +122,29 @@ public class MetaAttributeTypeHandlerIT 
     @Test
     public void testAddAttributeTypeToEnabledSchema() throws Exception
     {
-        Attributes attrs = LdifUtils.createJndiAttributes(
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
+        Entry entry = new DefaultEntry(
+            dn,
             "objectClass: top",
             "objectClass: metaTop",
             "objectClass: metaAttributeType",
-            "m-oid:" + OID,
-            "m-syntax:" + SchemaConstants.INTEGER_SYNTAX,
-            "m-description:" + DESCRIPTION0,
+            "m-oid", OID,
+            "m-syntax", SchemaConstants.INTEGER_SYNTAX,
+            "m-description", DESCRIPTION0,
             "m-equality: caseIgnoreMatch",
             "m-singleValue: FALSE",
             "m-usage: directoryOperation" );
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
-
         // Pre-checks
         assertFalse( isOnDisk( dn ) );
-        assertFalse( getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+        assertFalse( schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         // Addition
-        getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( dn ), attrs );
+        connection.add( entry );
 
         // Post-checks
-        assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
-        assertEquals( getService().getSchemaManager().getAttributeTypeRegistry().getSchemaName( OID ), "apachemeta" );
+        assertTrue( schemaManager.getAttributeTypeRegistry().contains( OID ) );
+        assertEquals( schemaManager.getAttributeTypeRegistry().getSchemaName( OID ), "apachemeta" );
         assertTrue( isOnDisk( dn ) );
     }
 
@@ -142,32 +152,31 @@ public class MetaAttributeTypeHandlerIT 
     @Test
     public void testAddAttributeTypeToUnLoadedSchema() throws Exception
     {
-        Attributes attrs = LdifUtils.createJndiAttributes(
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=notloaded,ou=schema" );
+        Entry entry = new DefaultEntry(
+            dn,
             "objectClass: top",
             "objectClass: metaTop",
             "objectClass: metaAttributeType",
-            "m-oid:" + OID,
-            "m-syntax:" + SchemaConstants.INTEGER_SYNTAX,
-            "m-description:" + DESCRIPTION0,
+            "m-oid", OID,
+            "m-syntax", SchemaConstants.INTEGER_SYNTAX,
+            "m-description", DESCRIPTION0,
             "m-equality: caseIgnoreMatch",
             "m-singleValue: FALSE",
             "m-usage: directoryOperation" );
 
-        Dn dn = getAttributeTypeContainer( "notloaded" );
-        dn = dn.add( "m-oid=" + OID );
-
         try
         {
-            getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( dn ), attrs );
+            connection.add( entry );
             fail( "Should not be there" );
         }
-        catch( NameNotFoundException nnfe )
+        catch( LdapException nnfe )
         {
             // Expected result.
         }
 
         assertFalse( "adding new attributeType to disabled schema should not register it into the registries",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         // The added entry must not be present on disk
         assertFalse( isOnDisk( dn ) );
@@ -177,27 +186,26 @@ public class MetaAttributeTypeHandlerIT 
     @Test
     public void testAddAttributeTypeToDisabledSchema() throws Exception
     {
-        Attributes attrs = LdifUtils.createJndiAttributes(
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=nis,ou=schema" );
+        Entry entry = new DefaultEntry(
+            dn,
             "objectClass: top",
             "objectClass: metaTop",
             "objectClass: metaAttributeType",
-            "m-oid:" + OID,
-            "m-syntax:" + SchemaConstants.INTEGER_SYNTAX,
-            "m-description:" + DESCRIPTION0,
+            "m-oid", OID,
+            "m-syntax", SchemaConstants.INTEGER_SYNTAX,
+            "m-description", DESCRIPTION0,
             "m-equality: caseIgnoreMatch",
             "m-singleValue: FALSE",
             "m-usage: directoryOperation" );
 
-        Dn dn = getAttributeTypeContainer( "nis" );
-        dn = dn.add( "m-oid=" + OID );
-
-        getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( dn ), attrs );
+        connection.add( entry );
 
         assertFalse( "adding new attributeType to disabled schema should not register it into the registries",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         // The GlobalOidRegistries must not contain the AT
-        assertFalse( getService().getSchemaManager().getGlobalOidRegistry().contains( OID ) );
+        assertFalse( schemaManager.getGlobalOidRegistry().contains( OID ) );
 
         // The added entry must be present on disk
         assertTrue( isOnDisk( dn ) );
@@ -211,7 +219,9 @@ public class MetaAttributeTypeHandlerIT 
     @Test
     public void testAddAttributeTypeDescWithEndingSpace() throws Exception
     {
-        Attributes attrs = LdifUtils.createJndiAttributes(
+        Dn dn = new Dn( "m-oid=1.3.6.1.4.1.8104.1.1.37,ou=attributeTypes,cn=apachemeta,ou=schema" );
+        Entry entry = new DefaultEntry(
+            dn,
             "objectClass: top",
             "objectClass: metaTop",
             "objectClass: metaAttributeType",
@@ -225,19 +235,16 @@ public class MetaAttributeTypeHandlerIT 
             "m-singleValue: TRUE"
          );
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=1.3.6.1.4.1.8104.1.1.37" );
-
         // Pre-checks
         assertFalse( isOnDisk( dn ) );
-        assertFalse( getService().getSchemaManager().getAttributeTypeRegistry().contains( "1.3.6.1.4.1.8104.1.1.37" ) );
+        assertFalse( schemaManager.getAttributeTypeRegistry().contains( "1.3.6.1.4.1.8104.1.1.37" ) );
 
         // Addition
-        getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( dn ), attrs );
+        connection.add( entry );
 
         // Post-checks
-        assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( "1.3.6.1.4.1.8104.1.1.37" ) );
-        assertEquals( getService().getSchemaManager().getAttributeTypeRegistry().getSchemaName( "1.3.6.1.4.1.8104.1.1.37" ), "apachemeta" );
+        assertTrue( schemaManager.getAttributeTypeRegistry().contains( "1.3.6.1.4.1.8104.1.1.37" ) );
+        assertEquals( schemaManager.getAttributeTypeRegistry().getSchemaName( "1.3.6.1.4.1.8104.1.1.37" ), "apachemeta" );
         assertTrue( isOnDisk( dn ) );
     }
 
@@ -250,21 +257,20 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
 
         // Check in Registries
         assertTrue( "attributeType should be removed from the registry after being deleted",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         // Check on disk that the added SchemaObject exist
         assertTrue( isOnDisk( dn ) );
 
-        getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
+        connection.delete( dn );
 
         // Check in Registries
         assertFalse( "attributeType should be removed from the registry after being deleted",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         // Check on disk that the deleted SchemaObject does not exist anymore
         assertFalse( isOnDisk( dn ) );
@@ -282,23 +288,22 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToDisabledSchema();
 
-        Dn dn = getAttributeTypeContainer( "nis" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=nis,ou=schema" );
 
         // Check in Registries
         assertFalse( "attributeType should be removed from the registry after being deleted",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         // Check on disk that the added SchemaObject exists
         assertTrue( isOnDisk( dn ) );
 
         // Remove the AT
-        getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
+        connection.delete( dn );
 
         // Check in Registries
         assertFalse( "attributeType should be removed from the registry after being deleted",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
-        assertFalse( getService().getSchemaManager().getGlobalOidRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
+        assertFalse( schemaManager.getGlobalOidRegistry().contains( OID ) );
 
         // Check on disk that the deleted SchemaObject does not exist anymore
         assertFalse( isOnDisk( dn ) );
@@ -310,21 +315,20 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
         addDependeeAttributeType();
 
         try
         {
-            getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
+            connection.delete( dn );
             fail( "should not be able to delete a attributeType in use" );
         }
-        catch( OperationNotSupportedException e )
+        catch( LdapException e )
         {
         }
 
         assertTrue( "attributeType should still be in the registry after delete failure",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
     }
 
 
@@ -337,27 +341,26 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        AttributeType at = getService().getSchemaManager().lookupAttributeTypeRegistry( OID );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( OID );
         assertEquals( at.getDescription(), DESCRIPTION0 );
         assertEquals( at.getSyntax().getOid(), SchemaConstants.INTEGER_SYNTAX );
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
 
-        ModificationItem[] mods = new ModificationItem[2];
-        Attribute attr = new BasicAttribute( "m-description", DESCRIPTION1 );
-        mods[0] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
-        attr = new BasicAttribute( "m-syntax", SchemaConstants.DIRECTORY_STRING_SYNTAX );
-        mods[1] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
-        getSchemaContext( getService() ).modifyAttributes( JndiUtils.toName( dn ), mods );
+        Attribute attr = new DefaultAttribute( "m-description", DESCRIPTION1 );
+        Modification mod1 = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attr );
+        attr = new DefaultAttribute( "m-syntax", SchemaConstants.DIRECTORY_STRING_SYNTAX );
+        Modification mod2 = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attr );
+
+        connection.modify( dn, mod1, mod2 );
 
         assertTrue( "attributeType OID should still be present",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         assertEquals( "attributeType schema should be set to apachemeta",
-            getService().getSchemaManager().getAttributeTypeRegistry().getSchemaName( OID ), "apachemeta" );
+            schemaManager.getAttributeTypeRegistry().getSchemaName( OID ), "apachemeta" );
 
-        at = getService().getSchemaManager().lookupAttributeTypeRegistry( OID );
+        at = schemaManager.lookupAttributeTypeRegistry( OID );
         assertEquals( at.getDescription(), DESCRIPTION1 );
         assertEquals( at.getSyntax().getOid(), SchemaConstants.DIRECTORY_STRING_SYNTAX );
     }
@@ -369,25 +372,27 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        AttributeType at = getService().getSchemaManager().lookupAttributeTypeRegistry( OID );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( OID );
         assertEquals( at.getDescription(), DESCRIPTION0 );
         assertEquals( at.getSyntax().getOid(), SchemaConstants.INTEGER_SYNTAX );
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
+
+        Modification mod1 = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
+            new DefaultAttribute( "m-description", DESCRIPTION1 ) );
+
+        Modification mod2 = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
+            new DefaultAttribute( "m-syntax", SchemaConstants.DIRECTORY_STRING_SYNTAX  ) );
 
-        Attributes mods = new BasicAttributes( true );
-        mods.put( "m-description", DESCRIPTION1 );
-        mods.put( "m-syntax", SchemaConstants.DIRECTORY_STRING_SYNTAX );
-        getSchemaContext( getService() ).modifyAttributes( JndiUtils.toName( dn ), DirContext.REPLACE_ATTRIBUTE, mods );
+        connection.modify( dn, mod1, mod2 );
 
         assertTrue( "attributeType OID should still be present",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         assertEquals( "attributeType schema should be set to apachemeta",
-            getService().getSchemaManager().getAttributeTypeRegistry().getSchemaName( OID ), "apachemeta" );
+            schemaManager.getAttributeTypeRegistry().getSchemaName( OID ), "apachemeta" );
 
-        at = getService().getSchemaManager().lookupAttributeTypeRegistry( OID );
+        at = schemaManager.lookupAttributeTypeRegistry( OID );
         assertEquals( at.getDescription(), DESCRIPTION1 );
         assertEquals( at.getSyntax().getOid(), SchemaConstants.DIRECTORY_STRING_SYNTAX );
     }
@@ -402,21 +407,19 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        LdapContext schemaRoot = getSchemaContext( getService() );
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
 
-        Dn newdn = getAttributeTypeContainer( "apachemeta" );
-        dn = newdn.add( "m-oid=" + NEW_OID );
-        schemaRoot.rename( JndiUtils.toName( dn ), JndiUtils.toName( newdn ) );
+        Rdn rdn = new Rdn( "m-oid=" + NEW_OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
+        
+        connection.rename( dn, rdn );
 
         assertFalse( "old attributeType OID should be removed from the registry after being renamed",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
-        getService().getSchemaManager().lookupAttributeTypeRegistry( OID );
+        schemaManager.lookupAttributeTypeRegistry( OID );
         fail( "attributeType lookup should fail after renaming the attributeType" );
 
-        assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( NEW_OID ) );
+        assertTrue( schemaManager.getAttributeTypeRegistry().contains( NEW_OID ) );
     }
 
 
@@ -426,16 +429,14 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
         addDependeeAttributeType();
 
-        Dn newdn = getAttributeTypeContainer( "apachemeta" );
-        newdn = newdn.add( "m-oid=" + NEW_OID );
+        Rdn rdn = new Rdn( "m-oid=" + NEW_OID );
 
         try
         {
-            getSchemaContext( getService() ).rename( JndiUtils.toName( dn ), JndiUtils.toName( newdn ) );
+            connection.rename( dn, rdn );
             fail( "should not be able to rename a attributeType in use" );
         }
         catch( LdapUnwillingToPerformException e )
@@ -444,7 +445,7 @@ public class MetaAttributeTypeHandlerIT 
         }
 
         assertTrue( "attributeType should still be in the registry after rename failure",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
     }
 
 
@@ -457,19 +458,17 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
 
-        Dn newdn = getAttributeTypeContainer( "apache" );
-        newdn = newdn.add( "m-oid=" + OID );
+        Dn newDn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apache,ou=schema" );
 
-        getSchemaContext( getService() ).rename( JndiUtils.toName( dn ), JndiUtils.toName(newdn) );
+        connection.move( dn, newDn );
 
         assertTrue( "attributeType OID should still be present",
-                getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+                schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         assertEquals( "attributeType schema should be set to apache not apachemeta",
-            getService().getSchemaManager().getAttributeTypeRegistry().getSchemaName( OID ), "apache" );
+            schemaManager.getAttributeTypeRegistry().getSchemaName( OID ), "apache" );
     }
 
 
@@ -479,22 +478,20 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
 
-        Dn newdn = getAttributeTypeContainer( "apache" );
-        newdn = newdn.add( "m-oid=" + NEW_OID );
+        Dn newDn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apache,ou=schema" );
 
-        getSchemaContext( getService() ).rename( JndiUtils.toName( dn ), JndiUtils.toName( newdn ) );
+        connection.move( dn, newDn );
 
         assertFalse( "old attributeType OID should NOT be present",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         assertTrue( "new attributeType OID should be present",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( NEW_OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( NEW_OID ) );
 
         assertEquals( "attributeType with new oid should have schema set to apache NOT apachemeta",
-            getService().getSchemaManager().getAttributeTypeRegistry().getSchemaName( NEW_OID ), "apache" );
+            schemaManager.getAttributeTypeRegistry().getSchemaName( NEW_OID ), "apache" );
     }
 
 
@@ -504,15 +501,14 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
 
         Dn top = new Dn();
         top = top.add( "m-oid=" + OID );
 
         try
         {
-            getSchemaContext( getService() ).rename( JndiUtils.toName( dn ), JndiUtils.toName( top ) );
+            connection.move( dn, top );
             fail( "should not be able to move a attributeType up to ou=schema" );
         }
         catch( LdapInvalidDnException e )
@@ -521,7 +517,7 @@ public class MetaAttributeTypeHandlerIT 
         }
 
         assertTrue( "attributeType should still be in the registry after move failure",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
     }
 
 
@@ -531,15 +527,13 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
 
-        Dn newdn = new Dn( "ou=comparators,cn=apachemeta" );
-        newdn = newdn.add( "m-oid=" + OID );
+        Dn newDn = new Dn( "m-oid=" + OID + ",ou=comparators,cn=apachemeta,ou=schema" );
 
         try
         {
-            getSchemaContext( getService() ).rename( JndiUtils.toName( dn ), JndiUtils.toName( newdn ) );
+            connection.move( dn, newDn );
             fail( "should not be able to move a attributeType into comparators container" );
         }
         catch( LdapInvalidDnException e )
@@ -548,7 +542,7 @@ public class MetaAttributeTypeHandlerIT 
         }
 
         assertTrue( "attributeType should still be in the registry after move failure",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
     }
 
 
@@ -558,17 +552,15 @@ public class MetaAttributeTypeHandlerIT 
     {
         testAddAttributeTypeToEnabledSchema();
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
 
         // nis is inactive by default
-        Dn newdn = getAttributeTypeContainer( "nis" );
-        newdn = newdn.add( "m-oid=" + OID );
+        Dn newDn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=nis,ou=schema" );
 
-        getSchemaContext( getService() ).rename( JndiUtils.toName( dn ), JndiUtils.toName( newdn ) );
+        connection.move( dn, newDn );
 
         assertFalse( "attributeType OID should no longer be present",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
     }
 
 
@@ -579,15 +571,13 @@ public class MetaAttributeTypeHandlerIT 
         testAddAttributeTypeToEnabledSchema();
         addDependeeAttributeType();
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
 
-        Dn newdn = getAttributeTypeContainer( "apache" );
-        newdn = newdn.add( "m-oid=" + OID );
+        Dn newDn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apache,ou=schema" );
 
         try
         {
-            getSchemaContext( getService() ).rename( JndiUtils.toName( dn ), JndiUtils.toName( newdn ) );
+            connection.move( dn, newDn );
             fail( "should not be able to move a attributeType in use" );
         }
         catch( LdapUnwillingToPerformException e )
@@ -596,7 +586,7 @@ public class MetaAttributeTypeHandlerIT 
         }
 
         assertTrue( "attributeType should still be in the registry after move failure",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
     }
 
 
@@ -607,15 +597,13 @@ public class MetaAttributeTypeHandlerIT 
         testAddAttributeTypeToEnabledSchema();
         addDependeeAttributeType();
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + OID );
+        Dn dn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
 
-        Dn newdn = getAttributeTypeContainer( "apache" );
-        newdn = newdn.add( "m-oid=" + NEW_OID );
+        Dn newDn = new Dn( "m-oid=" + OID + ",ou=attributeTypes,cn=apache,ou=schema" );
 
         try
         {
-            getSchemaContext( getService() ).rename( JndiUtils.toName( dn ), JndiUtils.toName( newdn ) );
+            connection.move( dn, newDn );
             fail( "should not be able to move a attributeType in use" );
         }
         catch( LdapUnwillingToPerformException e )
@@ -624,7 +612,7 @@ public class MetaAttributeTypeHandlerIT 
         }
 
         assertTrue( "attributeType should still be in the registry after move failure",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
     }
 
 
@@ -633,7 +621,9 @@ public class MetaAttributeTypeHandlerIT 
     // ----------------------------------------------------------------------
     private void addDependeeAttributeType() throws Exception
     {
-        Attributes attrs = LdifUtils.createJndiAttributes(
+        Dn dn = new Dn( "m-oid=" + DEPENDEE_OID + ",ou=attributeTypes,cn=apachemeta,ou=schema" );
+        Entry entry = new DefaultEntry(
+            dn,
             "objectClass: top",
             "objectClass: metaTop",
             "objectClass: metaAttributeType",
@@ -645,12 +635,10 @@ public class MetaAttributeTypeHandlerIT 
             "m-usage: directoryOperation",
             "m-supAttributeType", OID );
 
-        Dn dn = getAttributeTypeContainer( "apachemeta" );
-        dn = dn.add( "m-oid=" + DEPENDEE_OID );
-        getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( dn ), attrs );
+        connection.add( entry );
 
-        assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( DEPENDEE_OID ) );
-        assertEquals( getService().getSchemaManager().getAttributeTypeRegistry().getSchemaName( DEPENDEE_OID ), "apachemeta" );
+        assertTrue( schemaManager.getAttributeTypeRegistry().contains( DEPENDEE_OID ) );
+        assertEquals( schemaManager.getAttributeTypeRegistry().getSchemaName( DEPENDEE_OID ), "apachemeta" );
     }
 
 
@@ -669,18 +657,18 @@ public class MetaAttributeTypeHandlerIT 
         dn.add( "m-oid=" + OID );
 
         assertFalse( "attributeType OID should NOT be present when added to disabled nis schema",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         Dn newdn = getAttributeTypeContainer( "apachemeta" );
         newdn.add( "m-oid=" + OID );
 
-        getSchemaContext( getService() ).rename( dn, newdn );
+        connection.rename( dn, newdn );
 
         assertTrue( "attributeType OID should be present when moved to enabled schema",
-            getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+            schemaManager.getAttributeTypeRegistry().contains( OID ) );
 
         assertEquals( "attributeType should be in apachemeta schema after move",
-            getService().getSchemaManager().getAttributeTypeRegistry().getSchemaName( OID ), "apachemeta" );
+            schemaManager.getAttributeTypeRegistry().getSchemaName( OID ), "apachemeta" );
     }
     */
 }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java?rev=1201778&r1=1201777&r2=1201778&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java Mon Nov 14 16:31:12 2011
@@ -106,7 +106,7 @@ public class MetaComparatorHandlerIT ext
         dn = dn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
         assertFalse( getService().getSchemaManager().getComparatorRegistry().contains( OID ) );
 
         // Addition
@@ -117,7 +117,7 @@ public class MetaComparatorHandlerIT ext
         assertEquals( schemaManager.getComparatorRegistry().getSchemaName( OID ), "apachemeta" );
         Class<?> clazz = schemaManager.getComparatorRegistry().lookup( OID ).getClass();
         assertEquals( clazz, StringComparator.class );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -133,7 +133,7 @@ public class MetaComparatorHandlerIT ext
         dn = dn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
         assertFalse( getService().getSchemaManager().getComparatorRegistry().contains( OID ) );
 
         // Addition
@@ -142,7 +142,7 @@ public class MetaComparatorHandlerIT ext
         // Post-checks
         assertFalse( "adding new comparator to disabled schema should not register it into the registries",
             schemaManager.getComparatorRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -158,7 +158,7 @@ public class MetaComparatorHandlerIT ext
         dn = dn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
         assertFalse( getService().getSchemaManager().getComparatorRegistry().contains( OID ) );
 
         // Addition
@@ -175,7 +175,7 @@ public class MetaComparatorHandlerIT ext
         // Post-checks
         assertFalse( "adding new comparator to disabled schema should not register it into the registries",
             schemaManager.getComparatorRegistry().contains( OID ) );
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -199,7 +199,7 @@ public class MetaComparatorHandlerIT ext
         dn = dn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
         assertFalse( getService().getSchemaManager().getComparatorRegistry().contains( OID ) );
 
         // Addition
@@ -210,7 +210,7 @@ public class MetaComparatorHandlerIT ext
         assertEquals( schemaManager.getComparatorRegistry().getSchemaName( OID ), "apachemeta" );
         Class<?> clazz = schemaManager.getComparatorRegistry().lookup( OID ).getClass();
         assertEquals( clazz.getName(), "org.apache.directory.shared.ldap.model.schema.comparators.DummyComparator" );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -235,7 +235,7 @@ public class MetaComparatorHandlerIT ext
         dn = dn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
         assertFalse( getService().getSchemaManager().getComparatorRegistry().contains( OID ) );
 
         // Addition
@@ -245,7 +245,7 @@ public class MetaComparatorHandlerIT ext
         assertFalse( "adding new comparator to disabled schema should not register it into the registries",
             schemaManager.getComparatorRegistry().contains( OID ) );
 
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -262,7 +262,7 @@ public class MetaComparatorHandlerIT ext
 
         // Pre-checks
         assertTrue( schemaManager.getComparatorRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
 
         // Deletion
         getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
@@ -280,7 +280,7 @@ public class MetaComparatorHandlerIT ext
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -294,7 +294,7 @@ public class MetaComparatorHandlerIT ext
         // Pre-checks
         assertFalse( "comparator should be removed from the registry after being deleted", schemaManager
             .getComparatorRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
 
         // Deletion
         getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
@@ -312,7 +312,7 @@ public class MetaComparatorHandlerIT ext
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -324,7 +324,7 @@ public class MetaComparatorHandlerIT ext
 
         // Create a new Comparator
         testAddComparatorToEnabledSchema();
-        assertTrue( isOnDisk( cDn ) );
+        assertTrue( isOnDisk0( cDn ) );
         assertTrue( getService().getSchemaManager().getComparatorRegistry().contains( OID ) );
 
         // Create a MR using this comparator
@@ -340,14 +340,14 @@ public class MetaComparatorHandlerIT ext
         mrDn = mrDn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
-        assertFalse( isOnDisk( mrDn ) );
+        assertFalse( isOnDisk0( mrDn ) );
         assertFalse( getService().getSchemaManager().getMatchingRuleRegistry().contains( OID ) );
 
         // MatchingRule Addition
         getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( mrDn ), attrs );
 
         // Post-checks
-        assertTrue( isOnDisk( mrDn ) );
+        assertTrue( isOnDisk0( mrDn ) );
         assertTrue( getService().getSchemaManager().getMatchingRuleRegistry().contains( OID ) );
 
         try

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandlerIT.java?rev=1201778&r1=1201777&r2=1201778&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandlerIT.java Mon Nov 14 16:31:12 2011
@@ -95,7 +95,7 @@ public class MetaMatchingRuleHandlerIT e
         // Addition
         getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( dn ), attrs );
 
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
         assertTrue( getService().getSchemaManager().getComparatorRegistry().contains( OID ) );
     }
 
@@ -122,7 +122,7 @@ public class MetaMatchingRuleHandlerIT e
         dn = dn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
         assertFalse( getService().getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
 
         // Addition
@@ -131,7 +131,7 @@ public class MetaMatchingRuleHandlerIT e
         // Post-checks
         assertTrue( getService().getSchemaManager().getMatchingRuleRegistry().contains( OID ) );
         assertEquals( getService().getSchemaManager().getMatchingRuleRegistry().getSchemaName( OID ), "apachemeta" );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -154,7 +154,7 @@ public class MetaMatchingRuleHandlerIT e
 
         assertFalse( "adding new matchingRule to disabled schema should not register it into the registries",
             schemaManager.getMatchingRuleRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -186,7 +186,7 @@ public class MetaMatchingRuleHandlerIT e
 
         assertFalse( "adding new matchingRule to disabled schema should not register it into the registries",
             schemaManager.getMatchingRuleRegistry().contains( OID ) );
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -202,7 +202,7 @@ public class MetaMatchingRuleHandlerIT e
 
         assertTrue( "matchingRule should be removed from the registry after being deleted",
             schemaManager.getMatchingRuleRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
 
         getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
 
@@ -218,7 +218,7 @@ public class MetaMatchingRuleHandlerIT e
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -231,13 +231,13 @@ public class MetaMatchingRuleHandlerIT e
 
         assertFalse( "matchingRule should be removed from the registry after being deleted",
             schemaManager.getMatchingRuleRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
 
         getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
 
         assertFalse( "matchingRule should be removed from the registry after being deleted",
             schemaManager.getMatchingRuleRegistry().contains( OID ) );
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java?rev=1201778&r1=1201777&r2=1201778&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java Mon Nov 14 16:31:12 2011
@@ -102,7 +102,7 @@ public class MetaNormalizerHandlerIT ext
         assertEquals( schemaManager.getNormalizerRegistry().getSchemaName( OID ), "apachemeta" );
         Class<?> clazz = schemaManager.getNormalizerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, NoOpNormalizer.class );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -124,7 +124,7 @@ public class MetaNormalizerHandlerIT ext
 
         assertFalse( "adding new normalizer to disabled schema should not register it into the registries",
             schemaManager.getNormalizerRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -155,7 +155,7 @@ public class MetaNormalizerHandlerIT ext
 
         assertFalse( "adding new normalizer to disabled schema should not register it into the registries",
             schemaManager.getNormalizerRegistry().contains( OID ) );
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -187,7 +187,7 @@ public class MetaNormalizerHandlerIT ext
         assertEquals( schemaManager.getNormalizerRegistry().getSchemaName( OID ), "apachemeta" );
         Class<?> clazz = schemaManager.getNormalizerRegistry().lookup( OID ).getClass();
         assertEquals( clazz.getName(), "org.apache.directory.shared.ldap.model.schema.normalizers.DummyNormalizer" );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -216,7 +216,7 @@ public class MetaNormalizerHandlerIT ext
         getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( dn ), attrs );
 
         assertFalse( schemaManager.getNormalizerRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -229,7 +229,7 @@ public class MetaNormalizerHandlerIT ext
 
         assertTrue( "normalizer should be removed from the registry after being deleted",
             schemaManager.getNormalizerRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
 
         getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
 
@@ -245,7 +245,7 @@ public class MetaNormalizerHandlerIT ext
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -258,7 +258,7 @@ public class MetaNormalizerHandlerIT ext
 
         assertTrue( "normalizer should be removed from the registry after being deleted",
             schemaManager.getNormalizerRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
 
         getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
 
@@ -274,7 +274,7 @@ public class MetaNormalizerHandlerIT ext
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -422,7 +422,7 @@ public class MetaNormalizerHandlerIT ext
 
         // Create a new Normalizer
         testAddNormalizerToEnabledSchema();
-        assertTrue( isOnDisk( nDn ) );
+        assertTrue( isOnDisk0( nDn ) );
         assertTrue( getService().getSchemaManager().getNormalizerRegistry().contains( OID ) );
 
         // Create a MR using this Normalizer
@@ -438,14 +438,14 @@ public class MetaNormalizerHandlerIT ext
         mrDn = mrDn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
-        assertFalse( isOnDisk( mrDn ) );
+        assertFalse( isOnDisk0( mrDn ) );
         assertFalse( getService().getSchemaManager().getMatchingRuleRegistry().contains( OID ) );
 
         // MatchingRule Addition
         getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( mrDn ), attrs );
 
         // Post-checks
-        assertTrue( isOnDisk( mrDn ) );
+        assertTrue( isOnDisk0( mrDn ) );
         assertTrue( getService().getSchemaManager().getMatchingRuleRegistry().contains( OID ) );
 
         try

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java?rev=1201778&r1=1201777&r2=1201778&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java Mon Nov 14 16:31:12 2011
@@ -109,7 +109,7 @@ public class MetaObjectClassHandlerIT ex
 
         assertTrue( getObjectClassRegistry().contains( OID ) );
         assertEquals( getObjectClassRegistry().getSchemaName( OID ), "apachemeta" );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -120,7 +120,7 @@ public class MetaObjectClassHandlerIT ex
 
         assertFalse( "adding new objectClass to disabled schema should not register it into the registries",
             getObjectClassRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -153,7 +153,7 @@ public class MetaObjectClassHandlerIT ex
 
         assertFalse( "adding new objectClass to disabled schema should not register it into the registries",
             getObjectClassRegistry().contains( OID ) );
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -166,7 +166,7 @@ public class MetaObjectClassHandlerIT ex
 
         assertTrue( "objectClass should be removed from the registry after being deleted",
             getObjectClassRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
 
         getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
 
@@ -182,7 +182,7 @@ public class MetaObjectClassHandlerIT ex
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -195,7 +195,7 @@ public class MetaObjectClassHandlerIT ex
 
         assertFalse( "objectClass should be removed from the registry after being deleted",
             getObjectClassRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
 
         getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
 
@@ -211,7 +211,7 @@ public class MetaObjectClassHandlerIT ex
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java?rev=1201778&r1=1201777&r2=1201778&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java Mon Nov 14 16:31:12 2011
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ * 
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ * 
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.core.schema;
 
@@ -128,7 +128,7 @@ public class MetaSchemaHandlerIT extends
         LdapContext schemaRoot = getSchemaContext( getService() );
 
         // Create the schema
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
             "cn: broken",
@@ -143,7 +143,7 @@ public class MetaSchemaHandlerIT extends
         LdapContext schemaRoot = getSchemaContext( getService() );
 
         // Create the schema
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
             "cn", schemaName );
@@ -170,17 +170,17 @@ public class MetaSchemaHandlerIT extends
         // check that the nis schema is not enabled
         assertTrue( IntegrationUtils.isDisabled( getService(), "nis" ) );
         
-        // double check and make sure an attribute from that schema is 
+        // double check and make sure an attribute from that schema is
         // not in the AttributeTypeRegistry
         assertFalse( getService().getSchemaManager().getAttributeTypeRegistry().contains( UID_NUMBER_ATTR ) );
         
         // now enable the test schema
         IntegrationUtils.enableSchema( getService(), "nis" );
         
-        // now test that the schema is loaded 
+        // now test that the schema is loaded
         assertTrue( IntegrationUtils.isEnabled( getService(), "nis" ) );
         
-        // double check and make sure the test attribute from the 
+        // double check and make sure the test attribute from the
         // test schema is now loaded and present within the attr registry
         assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( UID_NUMBER_ATTR ) );
     }
@@ -209,7 +209,7 @@ public class MetaSchemaHandlerIT extends
             assertTrue( true );
         }
         
-        // Test again that the schema is not loaded 
+        // Test again that the schema is not loaded
         assertFalse( IntegrationUtils.isLoaded( getService(), "wrong" ) );
     }
 
@@ -229,7 +229,7 @@ public class MetaSchemaHandlerIT extends
         // Ceck that it's not enabled
         assertTrue( IntegrationUtils.isDisabled( getService(), "nis" ) );
         
-        // double check and make sure an attribute from that schema is 
+        // double check and make sure an attribute from that schema is
         // not in the AttributeTypeRegistry
         assertFalse( getService().getSchemaManager().getAttributeTypeRegistry().contains( UID_NUMBER_ATTR ) );
         
@@ -239,18 +239,18 @@ public class MetaSchemaHandlerIT extends
         // and enable it again (it should not do anything)
         IntegrationUtils.enableSchema( getService(), "nis" );
         
-        // now test that the schema is loaded 
+        // now test that the schema is loaded
         assertTrue( IntegrationUtils.isEnabled( getService(), "nis" ) );
         
-        // double check and make sure the test attribute from the 
+        // double check and make sure the test attribute from the
         // test schema is now loaded and present within the attr registry
         assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( UID_NUMBER_ATTR ) );
     }
 
     
     /**
-     * Checks that if we enable a schema which will break the registries, we get 
-     * an error. 
+     * Checks that if we enable a schema which will break the registries, we get
+     * an error.
      *
      * @throws Exception on error
      */
@@ -280,17 +280,17 @@ public class MetaSchemaHandlerIT extends
         // check that the krb5kdc schema is enabled
         assertTrue( IntegrationUtils.isEnabled( getService(), "krb5kdc" ) );
         
-        // double check and make sure an attribute from that schema is 
+        // double check and make sure an attribute from that schema is
         // in the AttributeTypeRegistry
         assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( KRB5_PRINCIPAL_NAME_ATTR ) );
         
         // now disable the krb5kdc schema
         IntegrationUtils.disableSchema( getService(), "krb5kdc" );
         
-        // now test that the schema is not enabled 
+        // now test that the schema is not enabled
         assertTrue( IntegrationUtils.isDisabled( getService(), "krb5kdc" ) );
         
-        // double check and make sure the test attribute from the 
+        // double check and make sure the test attribute from the
         // test schema is now loaded and present within the attr registry
         assertFalse( getService().getSchemaManager().getAttributeTypeRegistry().contains( KRB5_PRINCIPAL_NAME_ATTR ) );
     }
@@ -319,7 +319,7 @@ public class MetaSchemaHandlerIT extends
             assertTrue( true );
         }
         
-        // Test again that the schema is not loaded 
+        // Test again that the schema is not loaded
         assertFalse( IntegrationUtils.isLoaded( getService(), "wrong" ) );
     }
 
@@ -339,25 +339,25 @@ public class MetaSchemaHandlerIT extends
         // Check that it's not enabled
         assertTrue( IntegrationUtils.isDisabled( getService(), "nis" ) );
         
-        // double check and make sure an attribute from that schema is 
+        // double check and make sure an attribute from that schema is
         // not in the AttributeTypeRegistry
         assertFalse( getService().getSchemaManager().getAttributeTypeRegistry().contains( UID_NUMBER_ATTR ) );
         
         // now disable the test schema again
         IntegrationUtils.disableSchema( getService(), "nis" );
 
-        // now test that the schema is not loaded 
+        // now test that the schema is not loaded
         assertTrue( IntegrationUtils.isDisabled( getService(), "nis" ) );
         
-        // double check and make sure the test attribute from the 
+        // double check and make sure the test attribute from the
         // test schema is not loaded and present within the attr registry
         assertFalse( getService().getSchemaManager().getAttributeTypeRegistry().contains( UID_NUMBER_ATTR ) );
     }
 
     
     /**
-     * Checks that if we disable a schema which will break the registries, we get 
-     * an error. 
+     * Checks that if we disable a schema which will break the registries, we get
+     * an error.
      *
      * @throws Exception on error
      */
@@ -370,17 +370,17 @@ public class MetaSchemaHandlerIT extends
         // Check that it's enabled
         assertTrue( IntegrationUtils.isEnabled( getService(), "system" ) );
         
-        // double check and make sure an attribute from that schema is 
+        // double check and make sure an attribute from that schema is
         // in the AttributeTypeRegistry
         assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( "cn" ) );
         
         // now disable the system schema : it should break the registries, thus being rejected
         IntegrationUtils.disableSchema( getService(), "system" );
 
-        // now test that the schema is not loaded 
+        // now test that the schema is not loaded
         assertTrue( IntegrationUtils.isEnabled( getService(), "system" ) );
         
-        // double check and make sure the test attribute from the 
+        // double check and make sure the test attribute from the
         // test schema is loaded and present within the attr registry
         assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( "cn" ) );
     }
@@ -396,7 +396,7 @@ public class MetaSchemaHandlerIT extends
     {
         Dn dn = getSchemaContainer( "dummy" );
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
 
         LdapContext schemaRoot = getSchemaContext( getService() );
         
@@ -405,7 +405,7 @@ public class MetaSchemaHandlerIT extends
         assertTrue( IntegrationUtils.isEnabled( getService(), "dummy" ) );
         assertNotNull( schemaRoot.lookup( "cn=dummy" ) );
         
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
     
     
@@ -417,7 +417,7 @@ public class MetaSchemaHandlerIT extends
     {
         Dn dn = getSchemaContainer( "dummy" );
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
 
         LdapContext schemaRoot = getSchemaContext( getService() );
         Attributes dummySchema = LdifUtils.createJndiAttributes(
@@ -433,7 +433,7 @@ public class MetaSchemaHandlerIT extends
         assertTrue( IntegrationUtils.isEnabled( getService(), "dummy" ) );
         assertNotNull( schemaRoot.lookup( "cn=dummy" ) );
         
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
     
     
@@ -445,10 +445,10 @@ public class MetaSchemaHandlerIT extends
     {
         Dn dn = getSchemaContainer( "dummy" );
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
 
         LdapContext schemaRoot = getSchemaContext( getService() );
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
             "cn: dummy",
@@ -463,11 +463,11 @@ public class MetaSchemaHandlerIT extends
         }
         catch ( OperationNotSupportedException lonse )
         {
-            // expected        
+            // expected
         }
         
         assertFalse( IntegrationUtils.isLoaded( getService(), "dummy" ) );
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
     
     
@@ -479,10 +479,10 @@ public class MetaSchemaHandlerIT extends
     {
         Dn dn = getSchemaContainer( "dummy" );
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
 
         LdapContext schemaRoot = getSchemaContext( getService() );
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
             "cn: dummy",
@@ -497,11 +497,11 @@ public class MetaSchemaHandlerIT extends
         }
         catch ( OperationNotSupportedException lonse )
         {
-            // expected       
+            // expected
         }
         
         assertFalse( IntegrationUtils.isLoaded( getService(), "dummy" ) );
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
     
@@ -519,13 +519,13 @@ public class MetaSchemaHandlerIT extends
         
         // Create a schema we will delete
         createEnabledValidSchema( "dummy" );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
         assertTrue( IntegrationUtils.isLoaded( getService(), "dummy" ) );
 
         // Delete the schema
         schemaRoot.destroySubcontext( "cn=dummy" );
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
         assertFalse( IntegrationUtils.isLoaded( getService(), "dummy" ) );
     }
 
@@ -534,7 +534,7 @@ public class MetaSchemaHandlerIT extends
     
     
     /**
-     * Tests the addition of a new metaSchema object that is disabled 
+     * Tests the addition of a new metaSchema object that is disabled
      * on addition and has no dependencies.
      *
      * @throws Exception on error
@@ -544,7 +544,7 @@ public class MetaSchemaHandlerIT extends
     public void testAddDisabledSchemaNoDeps() throws Exception
     {
         LdapContext schemaRoot = getSchemaContext( getService() );
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
             "cn: dummy",
@@ -558,7 +558,7 @@ public class MetaSchemaHandlerIT extends
     
     
     /**
-     * Tests the addition of a new metaSchema object that is disabled 
+     * Tests the addition of a new metaSchema object that is disabled
      * on addition and has dependencies.
      *
      * @throws Exception on error
@@ -568,7 +568,7 @@ public class MetaSchemaHandlerIT extends
     public void testAddDisabledSchemaWithDeps() throws Exception
     {
         LdapContext schemaRoot = getSchemaContext( getService() );
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
             "cn: dummy",
@@ -584,7 +584,7 @@ public class MetaSchemaHandlerIT extends
     
     
     /**
-     * Tests the rejection of a new metaSchema object that is disabled 
+     * Tests the rejection of a new metaSchema object that is disabled
      * on addition and has missing dependencies.
      *
      * @throws Exception on error
@@ -594,7 +594,7 @@ public class MetaSchemaHandlerIT extends
     public void testRejectDisabledSchemaAddWithMissingDeps() throws Exception
     {
         LdapContext schemaRoot = getSchemaContext( getService() );
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
             "cn: dummy",
@@ -605,10 +605,10 @@ public class MetaSchemaHandlerIT extends
         try
         {
             schemaRoot.createSubcontext( "cn=dummy", dummySchema );
-        } 
+        }
         catch( OperationNotSupportedException e )
         {
-            // expected        
+            // expected
         }
         
         assertFalse( IntegrationUtils.isEnabled( getService(), "dummy" ) );
@@ -625,7 +625,7 @@ public class MetaSchemaHandlerIT extends
     }
     
     /**
-     * Tests the addition of a new metaSchema object that is enabled 
+     * Tests the addition of a new metaSchema object that is enabled
      * on addition and has no dependencies.
      *
      * @throws Exception on error
@@ -635,7 +635,7 @@ public class MetaSchemaHandlerIT extends
     public void testAddEnabledSchemaNoDeps() throws Exception
     {
         LdapContext schemaRoot = getSchemaContext( getService() );
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass: metaSchema",
             "cn: dummy"
@@ -649,7 +649,7 @@ public class MetaSchemaHandlerIT extends
     
     
     /**
-     * Tests the rejection of a metaSchema object add that is enabled 
+     * Tests the rejection of a metaSchema object add that is enabled
      * on addition yet has disabled dependencies.
      *
      * @throws Exception on error
@@ -659,7 +659,7 @@ public class MetaSchemaHandlerIT extends
     public void testRejectEnabledSchemaAddWithDisabledDeps() throws Exception
     {
         LdapContext schemaRoot = getSchemaContext( getService() );
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
             "cn: dummy",
@@ -672,7 +672,7 @@ public class MetaSchemaHandlerIT extends
         }
         catch( OperationNotSupportedException e )
         {
-            // expected        
+            // expected
         }
         
         assertFalse( IntegrationUtils.isEnabled( getService(), "dummy" ) );
@@ -705,7 +705,7 @@ public class MetaSchemaHandlerIT extends
     {
         LdapContext schemaRoot = getSchemaContext( getService() );
 
-        // add the dummy schema enabled 
+        // add the dummy schema enabled
         testAddEnabledSchemaNoDeps();
         assertTrue( IntegrationUtils.isEnabled( getService(), "dummy" ) );
         
@@ -744,7 +744,7 @@ public class MetaSchemaHandlerIT extends
         }
         catch ( OperationNotSupportedException e )
         {
-            // expected        
+            // expected
         }
 
         assertTrue( IntegrationUtils.isEnabled( getService(), "dummy" ) );
@@ -752,7 +752,7 @@ public class MetaSchemaHandlerIT extends
     
     
     /**
-     * Tests the rejection of a new metaSchema object that is enabled 
+     * Tests the rejection of a new metaSchema object that is enabled
      * on addition and missing dependencies.
      *
      * @throws Exception on error
@@ -763,7 +763,7 @@ public class MetaSchemaHandlerIT extends
     {
         LdapContext schemaRoot = getSchemaContext( getService() );
 
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
             "cn: dummy",
@@ -776,7 +776,7 @@ public class MetaSchemaHandlerIT extends
         }
         catch( OperationNotSupportedException e )
         {
-            // expected        
+            // expected
         }
         
         assertFalse( IntegrationUtils.isEnabled( getService(), "dummy" ) );
@@ -810,11 +810,11 @@ public class MetaSchemaHandlerIT extends
         // as enabled by default and dependends on the test schema
         
         // enables the test schema and samba
-        testEnableExistingSchema(); 
+        testEnableExistingSchema();
         
-        // adds enabled dummy schema that depends on the test schema  
-        Attributes dummySchema = LdifUtils.createJndiAttributes( 
-            "objectClass: top", 
+        // adds enabled dummy schema that depends on the test schema
+        Attributes dummySchema = LdifUtils.createJndiAttributes(
+            "objectClass: top",
             "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
             "cn: dummy",
             "m-dependencies: nis" );
@@ -825,11 +825,11 @@ public class MetaSchemaHandlerIT extends
         assertTrue( IntegrationUtils.isEnabled( getService(), "nis" ) );
         assertTrue( IntegrationUtils.isEnabled( getService(), "dummy" ) );
         
-        // double check and make sure an attribute from that schema is 
+        // double check and make sure an attribute from that schema is
         // in the AttributeTypeRegistry
         assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( UID_NUMBER_ATTR ) );
         
-        // now try to disable the test schema which should fail 
+        // now try to disable the test schema which should fail
         // since it's dependent, the dummy schema, is enabled
         ModificationItem[] mods = new ModificationItem[1];
         Attribute attr = new BasicAttribute( "m-disabled", "TRUE" );
@@ -842,14 +842,14 @@ public class MetaSchemaHandlerIT extends
         }
         catch ( OperationNotSupportedException e )
         {
-            // expected        
+            // expected
         }
         
-        // now test that both schema are still loaded 
+        // now test that both schema are still loaded
         assertTrue( IntegrationUtils.isEnabled( getService(), "nis" ) );
         assertTrue( IntegrationUtils.isEnabled( getService(), "dummy" ) );
         
-        // double check and make sure the test attribute from the test  
+        // double check and make sure the test attribute from the test
         // schema is still loaded and present within the attr registry
         assertTrue( getService().getSchemaManager().getAttributeTypeRegistry().contains( UID_NUMBER_ATTR ) );
     }
@@ -860,7 +860,7 @@ public class MetaSchemaHandlerIT extends
     // -----------------------------------------------------------------------
     /**
      * Makes sure we can change the name of a schema with entities in it.
-     * Will use the samba schema which comes out of the box and nothing 
+     * Will use the samba schema which comes out of the box and nothing
      * depends on.
      *
      * @throws Exception on error
@@ -912,7 +912,7 @@ public class MetaSchemaHandlerIT extends
         }
         catch ( OperationNotSupportedException onse )
         {
-            // expected        
+            // expected
         }
         
         assertNotNull( schemaRoot.lookup( "cn=nis" ) );
@@ -931,7 +931,7 @@ public class MetaSchemaHandlerIT extends
 
     /**
      * Makes sure we can change the name of a schema with entities in it.
-     * Will use the samba schema which comes out of the box and nothing 
+     * Will use the samba schema which comes out of the box and nothing
      * depends on.
      *
      * @throws Exception on error
@@ -967,7 +967,7 @@ public class MetaSchemaHandlerIT extends
     // Dependency Modify Tests
     // -----------------------------------------------------------------------
     /**
-     * Checks to make sure the addition of an undefined schema to the dependencies 
+     * Checks to make sure the addition of an undefined schema to the dependencies
      * of an existing schema fail with an UNWILLING_TO_PERFORM result code.
      *
      * @throws Exception on error
@@ -989,15 +989,15 @@ public class MetaSchemaHandlerIT extends
         }
         catch ( OperationNotSupportedException onse )
         {
-            // expected        
+            // expected
         }
     }
 
 
     /**
-     * Checks to make sure the addition of an defined yet disabled schema to the 
-     * dependencies of an existing enabled schema fails with an UNWILLING_TO_PERFORM 
-     * result code.  You must enable the dependency to add it or disable the schema 
+     * Checks to make sure the addition of an defined yet disabled schema to the
+     * dependencies of an existing enabled schema fails with an UNWILLING_TO_PERFORM
+     * result code.  You must enable the dependency to add it or disable the schema
      * depending on it to add it.
      *
      * @throws Exception on error
@@ -1019,14 +1019,14 @@ public class MetaSchemaHandlerIT extends
         }
         catch ( OperationNotSupportedException onse )
         {
-            // expected        
+            // expected
         }
     }
 
 
     /**
-     * Checks to make sure the addition of an defined yet disabled schema to the 
-     * dependencies of an existing disabled schema succeeds. 
+     * Checks to make sure the addition of an defined yet disabled schema to the
+     * dependencies of an existing disabled schema succeeds.
      *
      * @throws Exception on error
      */
@@ -1046,7 +1046,7 @@ public class MetaSchemaHandlerIT extends
 
 
     /**
-     * Checks to make sure the addition of an defined yet enabled schema to the 
+     * Checks to make sure the addition of an defined yet enabled schema to the
      * dependencies of an existing disabled schema succeeds.
      *
      * @throws Exception on error

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java?rev=1201778&r1=1201777&r2=1201778&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java Mon Nov 14 16:31:12 2011
@@ -96,7 +96,7 @@ public class MetaSyntaxCheckerHandlerIT 
         assertEquals( schemaManager.getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
         Class<?> clazz = schemaManager.getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, OctetStringSyntaxChecker.class );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -114,7 +114,7 @@ public class MetaSyntaxCheckerHandlerIT 
 
         assertFalse( "adding new syntaxChecker to disabled schema should not register it into the registries",
             schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -141,7 +141,7 @@ public class MetaSyntaxCheckerHandlerIT 
 
         assertFalse( "adding new syntaxChecker to disabled schema should not register it into the registries",
             schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -169,7 +169,7 @@ public class MetaSyntaxCheckerHandlerIT 
         assertEquals( schemaManager.getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
         Class<?> clazz = schemaManager.getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz.getName(), "org.apache.directory.shared.ldap.model.schema.syntaxCheckers.DummySyntaxChecker" );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -194,7 +194,7 @@ public class MetaSyntaxCheckerHandlerIT 
         getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( dn ), attrs );
 
         assertFalse( schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -207,7 +207,7 @@ public class MetaSyntaxCheckerHandlerIT 
 
         assertTrue( "syntaxChecker should be removed from the registry after being deleted", schemaManager
             .getSyntaxCheckerRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
 
         getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
 
@@ -223,7 +223,7 @@ public class MetaSyntaxCheckerHandlerIT 
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -236,7 +236,7 @@ public class MetaSyntaxCheckerHandlerIT 
 
         assertTrue( "syntaxChecker should be removed from the registry after being deleted", schemaManager
             .getSyntaxCheckerRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
 
         getSchemaContext( getService() ).destroySubcontext( JndiUtils.toName( dn ) );
 
@@ -252,7 +252,7 @@ public class MetaSyntaxCheckerHandlerIT 
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -400,7 +400,7 @@ public class MetaSyntaxCheckerHandlerIT 
 
         // Create a new SyntaxChecker
         testAddSyntaxCheckerToEnabledSchema();
-        assertTrue( isOnDisk( scDn ) );
+        assertTrue( isOnDisk0( scDn ) );
         assertTrue( getService().getSchemaManager().getSyntaxCheckerRegistry().contains( OID ) );
 
         // Create a Syntax using this comparator
@@ -411,14 +411,14 @@ public class MetaSyntaxCheckerHandlerIT 
         sDn = sDn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
-        assertFalse( isOnDisk( sDn ) );
+        assertFalse( isOnDisk0( sDn ) );
         assertFalse( getService().getSchemaManager().getLdapSyntaxRegistry().contains( OID ) );
 
         // Syntax Addition
         getSchemaContext( getService() ).createSubcontext( JndiUtils.toName( sDn ), attrs );
 
         // Post-checks
-        assertTrue( isOnDisk( sDn ) );
+        assertTrue( isOnDisk0( sDn ) );
         assertTrue( getService().getSchemaManager().getLdapSyntaxRegistry().contains( OID ) );
 
         try

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java?rev=1201778&r1=1201777&r2=1201778&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java Mon Nov 14 16:31:12 2011
@@ -112,7 +112,7 @@ public class MetaSyntaxHandlerIT extends
 
         assertTrue( schemaManager.getLdapSyntaxRegistry().contains( OID ) );
         assertEquals( schemaManager.getLdapSyntaxRegistry().getSchemaName( OID ), "apachemeta" );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -134,7 +134,7 @@ public class MetaSyntaxHandlerIT extends
 
         assertFalse( "adding new syntax to disabled schema should not register it into the registries",
             schemaManager.getLdapSyntaxRegistry().contains( OID ) );
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
     }
 
 
@@ -165,7 +165,7 @@ public class MetaSyntaxHandlerIT extends
 
         assertFalse( "adding new syntax to disabled schema should not register it into the registries",
             schemaManager.getLdapSyntaxRegistry().contains( OID ) );
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -176,7 +176,7 @@ public class MetaSyntaxHandlerIT extends
         dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToEnabledSchema();
 
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
         assertTrue( "syntax should be removed from the registry after being deleted",
             schemaManager.getLdapSyntaxRegistry().contains( OID ) );
 
@@ -194,7 +194,7 @@ public class MetaSyntaxHandlerIT extends
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 
@@ -205,7 +205,7 @@ public class MetaSyntaxHandlerIT extends
         dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToDisabledSchema();
 
-        assertTrue( isOnDisk( dn ) );
+        assertTrue( isOnDisk0( dn ) );
         assertFalse( "syntax should be removed from the registry after being deleted",
             schemaManager.getLdapSyntaxRegistry().contains( OID ) );
 
@@ -223,7 +223,7 @@ public class MetaSyntaxHandlerIT extends
         {
         }
 
-        assertFalse( isOnDisk( dn ) );
+        assertFalse( isOnDisk0( dn ) );
     }
 
 



Mime
View raw message