directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r433577 - /directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
Date Tue, 22 Aug 2006 10:11:57 GMT
Author: ersiner
Date: Tue Aug 22 03:11:54 2006
New Revision: 433577

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

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

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java?rev=433577&r1=433576&r2=433577&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
(original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
Tue Aug 22 03:11:54 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( "description exists?", null, entry.getAttribute( "description" ) );
+    }
 }



Mime
View raw message