directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r886263 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Date Wed, 02 Dec 2009 19:10:05 GMT
Author: elecharny
Date: Wed Dec  2 19:10:04 2009
New Revision: 886263

URL: http://svn.apache.org/viewvc?rev=886263&view=rev
Log:
Created a new test for AT being collective and Operational

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=886263&r1=886262&r2=886263&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
Wed Dec  2 19:10:04 2009
@@ -38,6 +38,7 @@
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
+import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.schema.DefaultSchemaManager;
@@ -249,6 +250,9 @@
     }
 
 
+    //-------------------------------------------------------------------------
+    // AttributeType addition tests
+    //-------------------------------------------------------------------------
     /**
      * Try to inject an AttributeType without any superior nor Syntax : it's invalid
      */
@@ -263,6 +267,28 @@
         attributeType.setSubstringOid( null );
         attributeType.setSuperior( ( String ) null );
 
+        // It should fail
+        schemaManager.add( attributeType );
+    }
+
+
+    /**
+     * Try to inject an AttributeType which is Collective, but an operational AT
+     */
+    @Test(expected = LdapOperationNotSupportedException.class)
+    public void testAddAttributeTypeCollectiveOperational() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.DIRECTORY_OPERATION );
+        attributeType.setCollective( true );
+
+        // It should fail
         schemaManager.add( attributeType );
     }
 }



Mime
View raw message