directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r433581 - /directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
Date Tue, 22 Aug 2006 10:47:29 GMT
Author: ersiner
Date: Tue Aug 22 03:47:28 2006
New Revision: 433581

URL: http://svn.apache.org/viewvc?rev=433581&view=rev
Log:
Added a test case to show DIRSERVER-630 has not been fixed yet.

Modified:
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java?rev=433581&r1=433580&r2=433581&view=diff
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
(original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
Tue Aug 22 03:47:28 2006
@@ -105,4 +105,29 @@
         LDAPEntry entry = con.read( DN );
         assertEquals( "description exists?", null, entry.getAttribute( "description" ) );
     }
+    
+    
+    public void testIllegalModification2() throws LDAPException
+    {
+        // first a valid attribute
+        LDAPAttribute attr = new LDAPAttribute( "description", "The description" );
+        LDAPModification mod = new LDAPModification( LDAPModification.ADD, attr );
+        // then an invalid one without any value
+        attr = new LDAPAttribute( "displayName" );
+        LDAPModification mod2 = new LDAPModification( LDAPModification.ADD, attr );
+
+        try
+        {
+            con.modify( "cn=Kate Bush,ou=system", new LDAPModification[] { mod, mod2 } );
+            fail( "error expected due to empty attribute value" );
+        }
+        catch ( LDAPException e )
+        {
+            // expected
+        }
+
+        // Check whether entry is unmodified, i.e. no description
+        LDAPEntry entry = con.read( DN );
+        assertEquals( "displayName exists?", null, entry.getAttribute( "displayName" ) );
+    }
 }



Mime
View raw message