You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2016/02/27 08:12:03 UTC

svn commit: r1732609 - /directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/RdnTest.java

Author: elecharny
Date: Sat Feb 27 07:12:02 2016
New Revision: 1732609

URL: http://svn.apache.org/viewvc?rev=1732609&view=rev
Log:
Added some tests where the same AT is used twice in the RDN

Modified:
    directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/RdnTest.java

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/RdnTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/RdnTest.java?rev=1732609&r1=1732608&r2=1732609&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/RdnTest.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/RdnTest.java Sat Feb 27 07:12:02 2016
@@ -20,6 +20,7 @@
 package org.apache.directory.api.ldap.model.name;
 
 import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
 import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
 import org.junit.BeforeClass;
@@ -200,6 +201,31 @@ public class RdnTest
     }
     
     
+    /**
+     * test that a RDN with an attributeType used twice with the same value
+     * throws an exception
+     */
+    @Test( expected=LdapInvalidDnException.class )
+    public void testWrongRdnAtUsedTwiceSameValue() throws LdapException
+    {
+        new Rdn( schemaManager, " cn = b + cn = b " );
+    }
+    
+    
+    /**
+     * test that a RDN with an attributeType used twice but with different value
+     * is accepted
+     */
+    @Test
+    public void testRdnAtUsedTwiceDifferentValue() throws LdapException
+    {
+        Rdn rdn1 = new Rdn( schemaManager, " cn = c + cn = b " );
+        Rdn rdn2 = new Rdn( schemaManager, " cn = b + cn = c " );
+        
+        //assertEquals( rdn1, rdn2 );
+    }
+
+    
     @Test
     public void testRdnEscapedValue() throws Exception
     {