directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1496654 - /directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
Date Tue, 25 Jun 2013 22:05:36 GMT
Author: elecharny
Date: Tue Jun 25 22:05:36 2013
New Revision: 1496654

URL: http://svn.apache.org/r1496654
Log:
Added a test to check that we can't add an attribute with a null value when the syntax does
not allow it

Modified:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java?rev=1496654&r1=1496653&r2=1496654&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
Tue Jun 25 22:05:36 2013
@@ -66,6 +66,7 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.entry.Modification;
 import org.apache.directory.api.ldap.model.entry.ModificationOperation;
 import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException;
 import org.apache.directory.api.ldap.model.exception.LdapOperationException;
 import org.apache.directory.api.ldap.model.ldif.LdifUtils;
@@ -1563,4 +1564,38 @@ public class AddIT extends AbstractLdapT
 
         connection.close();
     }
+
+
+    @Test
+    public void testAddNullValueDirectoryString() throws LdapException, IOException
+    {
+        LdapConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort()
);
+        connection.setTimeOut( 0L );
+
+        // Use the client API
+        connection.bind( "uid=admin,ou=system", "secret" );
+
+        // Add a new entry with some null values
+        Entry entry = new DefaultEntry( "cn=test,ou=system",
+            "ObjectClass: top",
+            "ObjectClass: person",
+            "ObjectClass: person",
+            "ObjectClass: OrganizationalPerson",
+            "ObjectClass: inetOrgPerson",
+            "cn: test",
+            "sn: Test",
+            "displayName:" ); // The DisplayName must contain a value
+
+        try
+        {
+            connection.add( entry );
+            fail();
+        }
+        catch ( LdapInvalidAttributeValueException liave )
+        {
+            // Expected
+        }
+
+        connection.close();
+    }
 }



Mime
View raw message