directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r886868 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Date Thu, 03 Dec 2009 18:07:55 GMT
Author: elecharny
Date: Thu Dec  3 18:07:55 2009
New Revision: 886868

URL: http://svn.apache.org/viewvc?rev=886868&view=rev
Log:
Added an extra test for AT to check that the superior is existing

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

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=886868&r1=886867&r2=886868&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Thu Dec  3 18:07:55 2009
@@ -415,4 +415,30 @@
 
         assertTrue( error instanceof LdapSchemaViolationException );
     }
+
+
+    /**
+     * Try to inject an AttributeType with a bad superior
+     */
+    @Test
+    public void testAddAttributeTypeSupBadSup() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSuperiorOid( "0.0" );
+        attributeType.setUsage( UsageEnum.DISTRIBUTED_OPERATION );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List<Throwable> errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+    }
 }



Mime
View raw message