directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r675522 - /directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java
Date Thu, 10 Jul 2008 11:27:18 GMT
Author: elecharny
Date: Thu Jul 10 04:27:17 2008
New Revision: 675522

URL: http://svn.apache.org/viewvc?rev=675522&view=rev
Log:
Reactivated a test which was disabled by mistake.
Added a disabled test for NoSuchAttribute errors

Modified:
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java?rev=675522&r1=675521&r2=675522&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java
Thu Jul 10 04:27:17 2008
@@ -26,6 +26,7 @@
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getUserAddLdif;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
+import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
@@ -171,6 +172,7 @@
      * 
      * @throws NamingException on error
      */
+    @Test
     public void testIllegalModifyAdd() throws Exception
     {
         createData();
@@ -226,6 +228,34 @@
     }
 
 
+    /**
+     * Test that if we try to remove a non existing attribute,
+     * we get a correct LdapNoSuchAttributeException
+     * 
+     * The test is currently disabled
+     */
+    //@Test
+    public void testRemoveNonExistingValueException() throws Exception
+    {
+        createData();
+
+        LdapContext sysRoot = getSystemContext( service );
+        Attributes attributes = new AttributesImpl( true );
+        attributes.put( "ou", "testCases" );
+        
+        try
+        {
+            sysRoot.modifyAttributes( "ou=testing00", DirContext.REMOVE_ATTRIBUTE, attributes
);
+            fail();
+        }
+        catch ( LdapNoSuchAttributeException lnsae )
+        {
+            // Expected
+            assertTrue( true );
+        }
+    }
+
+    
     @Test
     public void testRemoveNonExistingValue() throws Exception
     {



Mime
View raw message