directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r983092 - /directory/shared/branches/seelmann-ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
Date Fri, 06 Aug 2010 18:43:30 GMT
Author: seelmann
Date: Fri Aug  6 18:43:29 2010
New Revision: 983092

URL: http://svn.apache.org/viewvc?rev=983092&view=rev
Log:
Removed all non-failing tests

Modified:
    directory/shared/branches/seelmann-ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java

Modified: directory/shared/branches/seelmann-ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/seelmann-ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java?rev=983092&r1=983091&r2=983092&view=diff
==============================================================================
--- directory/shared/branches/seelmann-ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
(original)
+++ directory/shared/branches/seelmann-ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
Fri Aug  6 18:43:29 2010
@@ -208,447 +208,6 @@ public class SchemaManagerLoadTest
     }
 
 
-    //-------------------------------------------------------------------------
-    // Test the load( String... schemaName) method
-    //-------------------------------------------------------------------------
-    /**
-     * test loading the "system" schema 
-     */
-    @Test
-    public void testLoadSystem() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 38, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 9, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 141, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 1, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-    }
-
-
-    /**
-     * test loading the "core" schema, which depends on "system"
-     */
-    @Test
-    public void testLoadCore() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        // Check that we can't load a schema without its dependencies
-        assertFalse( schemaManager.load( "core" ) );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "core" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 92, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 36, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 222, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 2, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-    }
-
-
-    /**
-     * test loading the "apache" schema, which depends on "system" and "core"
-     */
-    @Test
-    public void testLoadApache() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "core" ) );
-        assertTrue( schemaManager.load( "apache" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 146, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 43, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 43, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 43, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 53, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 62, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 66, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 308, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "apache" ) );
-    }
-
-
-    /**
-     * test loading the "apacheMeta" schema, which depends on "system"
-     */
-    @Test
-    public void testLoadApacheMeta() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "apacheMeta" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 69, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 40, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 40, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 40, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 22, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 63, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 64, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 195, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 2, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "apachemeta" ) );
-    }
-
-
-    /**
-     * test loading the "java" schema, which depends on "system" and "core"
-     */
-    @Test
-    public void testLoadJava() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "core" ) );
-        assertTrue( schemaManager.load( "Java" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 99, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 41, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 234, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "Java" ) );
-    }
-
-
-    /**
-     * test loading the "other" schema, which depends on "system", "core",
-     * "apache" and "apacheMeta". As we don't have any cross dependencies
-     * with any of this other schemas, we can only load core and system
-     */
-    @Test
-    public void testLoadOther() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "core" ) );
-        assertTrue( schemaManager.load( "other" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 92, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 36, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 222, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "other" ) );
-    }
-
-
-    /**
-     * test loading the "cosine" schema, which depends on "system" and "core"
-     */
-    @Test
-    public void testLoadCosine() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "core" ) );
-        assertTrue( schemaManager.load( "cosine" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 133, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 49, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 276, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
-    }
-
-
-    /**
-     * test loading the "InetOrgPerson" schema, which depends on "system", "core"
-     * and "cosine"
-     */
-    @Test
-    public void testLoadInetOrgPerson() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "core" ) );
-        assertTrue( schemaManager.load( "cosine" ) );
-        assertTrue( schemaManager.load( "InetOrgPerson" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 286, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 4, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
-    }
-
-
-    /**
-     * test loading the "Collective" schema, which depends on "system" and "core"
-     */
-    @Test
-    public void testLoadCollective() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "core" ) );
-        assertTrue( schemaManager.load( "Collective" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 105, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 36, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 235, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "collective" ) );
-    }
-
-
-    /**
-     * test loading the "Krb5Kdc" schema, which depends on "system" and "core"
-     */
-    @Test
-    public void testLoadKrb5Kdc() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "core" ) );
-        assertTrue( schemaManager.load( "Krb5Kdc" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 107, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 39, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 240, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "Krb5Kdc" ) );
-    }
-
-
-    /**
-     * test loading the "nis" schema, which depends on "system", "core" and "cosine",
-     * but is disabled
-     */
-    @Test
-    public void testLoadNis() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "core" ) );
-        assertTrue( schemaManager.load( "cosine" ) );
-        assertTrue( schemaManager.load( "nis" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 133, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 49, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 276, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
-        assertNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );
-    }
-
-
-    /**
-     * Test loading a wrong schema
-     */
-    @Test
-    public void testLoadWrongSchema() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        try
-        {
-            schemaManager.loadWithDeps( "bad" );
-            fail();
-        }
-        catch ( LdapUnwillingToPerformException lonse )
-        {
-            // expected
-        }
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 38, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 9, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 141, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 1, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNull( schemaManager.getRegistries().getLoadedSchema( "bad" ) );
-    }
-
-
-    /**
-     * test loading the "InetOrgPerson" and "core" schema, which depends on "system" and
"cosine"
-     */
-    @Test
-    public void testLoadCoreAndInetOrgPerson() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-        assertTrue( schemaManager.load( "core", "cosine", "InetOrgPerson" ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 286, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 4, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
-    }
-
-
-    /**
-     * test loading the "InetOrgPerson", "core" and a bad schema
-     */
-    @Test
-    public void testLoadCoreInetOrgPersonAndBad() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        assertTrue( schemaManager.load( "system" ) );
-
-        try
-        {
-            assertFalse( schemaManager.load( "core", "bad", "cosine", "InetOrgPerson" ) );
-            fail();
-        }
-        catch ( LdapUnwillingToPerformException lonse )
-        {
-            // expected
-        }
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 38, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 9, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 141, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 1, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
-        assertNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
-    }
-
-
     /**
      * test loading the "InetOrgPerson", "core" and a disabled schema
      */
@@ -681,100 +240,4 @@ public class SchemaManagerLoadTest
         assertNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
     }
 
-
-    //---------------------------------------------------------------------------
-    // Test the load( Schema... ) method
-    //---------------------------------------------------------------------------
-    /**
-     * test loading the "InetOrgPerson", "core" and an empty schema. The empty schema
-     * should be present in the registries, as it's a vaid schema
-     */
-    @Test
-    public void testLoadSchemasWithDepsCoreInetOrgPersonAndBad() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        Schema system = loader.getSchema( "system" );
-        Schema core = loader.getSchema( "core" );
-        Schema empty = new DefaultSchema( "empty" );
-        Schema cosine = loader.getSchema( "cosine" );
-        Schema inetOrgPerson = loader.getSchema( "InetOrgPerson" );
-
-        assertTrue( schemaManager.load( system, core, empty, cosine, inetOrgPerson ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 286, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 5, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "empty" ) );
-    }
-    
-    
-    /**
-     * Test that we can load a new schema
-     */
-    @Test
-    public void loadNewSchema() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        Schema dummy = new DefaultSchema( "dummy" );
-
-        assertTrue( schemaManager.load( dummy ) );
-
-        assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 0, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 0, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 0, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 0, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 0, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 0, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 0, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 0, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 1, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "dummy" ) );
-    }
-    
-    
-    /**
-     * Test that we can't load a new schema with bad dependencies
-     */
-    @Test
-    public void loadNewSchemaBadDependencies() throws Exception
-    {
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        Schema dummy = new DefaultSchema( "dummy" );
-        dummy.addDependencies( "bad" );
-
-        assertFalse( schemaManager.load( dummy ) );
-
-        assertFalse( schemaManager.getErrors().isEmpty() );
-        assertEquals( 0, schemaManager.getAttributeTypeRegistry().size() );
-        assertEquals( 0, schemaManager.getComparatorRegistry().size() );
-        assertEquals( 0, schemaManager.getMatchingRuleRegistry().size() );
-        assertEquals( 0, schemaManager.getNormalizerRegistry().size() );
-        assertEquals( 0, schemaManager.getObjectClassRegistry().size() );
-        assertEquals( 0, schemaManager.getSyntaxCheckerRegistry().size() );
-        assertEquals( 0, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 0, schemaManager.getGlobalOidRegistry().size() );
-
-        assertEquals( 0, schemaManager.getRegistries().getLoadedSchemas().size() );
-        assertNull( schemaManager.getRegistries().getLoadedSchema( "dummy" ) );
-    }
 }



Mime
View raw message