directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1817261 - /directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext
Date Wed, 06 Dec 2017 04:20:34 GMT
Author: elecharny
Date: Wed Dec  6 04:20:34 2017
New Revision: 1817261

URL: http://svn.apache.org/viewvc?rev=1817261&view=rev
Log:
Fixed the delete usage, which returns nothing, in the sample

Modified:
    directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext

Modified: directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext
URL: http://svn.apache.org/viewvc/directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext?rev=1817261&r1=1817260&r2=1817261&view=diff
==============================================================================
--- directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext (original)
+++ directory/site/trunk/content/api/user-guide/2.5-deleting.mdtext Wed Dec  6 04:20:34 2017
@@ -36,9 +36,14 @@ We request a deletion by providing the e
     {
         assertTrue( session.exists( "cn=child1,cn=parent,ou=system" ) );
 
-        DeleteResponse response = connection.delete( "cn=child1,cn=parent,ou=system" );
-        assertNotNull( response );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        try 
+        {
+            connection.delete( "cn=child1,cn=parent,ou=system" );
+        }
+        catch ( LdapException le )
+        {
+            fail( le.getMessage() );
+        }
 
         assertFalse( session.exists( "cn=child1,cn=parent,ou=system" ) );
     }
@@ -52,9 +57,14 @@ Trying to delete a parent node would res
     {
         assertTrue( session.exists( "cn=parent,ou=system" ) );
 
-        DeleteResponse response = connection.delete( "cn=parent,ou=system" );
-        assertNotNull( response );
-        assertEquals( ResultCodeEnum.NOT_ALLOWED_ON_NON_LEAF, response.getLdapResult().getResultCode()
);
+        try 
+        {
+            connection.delete( "cn=parent,ou=system" );
+        }
+        catch ( LdapException le )
+        {
+            fail( le.getMessage() );
+        }
 
         assertTrue( session.exists( "cn=parent,ou=system" ) );
     }
@@ -71,9 +81,14 @@ Usually, you can't delete an entry and a
         assertTrue( session.exists( "cn=parent,ou=system" ) );
 
 
-        DeleteResponse response = connection.deleteTree( "cn=parent,ou=system" );
-        assertNotNull( response );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        try
+        {
+            connection.deleteTree( "cn=parent,ou=system" );
+        }
+        catch ( LdapException le )
+        {
+            fail( le.getMessage() );
+        }
 
         assertFalse( session.exists( "cn=parent,ou=system" ) );
     }



Mime
View raw message