Package org.apache.directory.ldap.client.api.message

Examples of org.apache.directory.ldap.client.api.message.DeleteResponse


        assertTrue( session.exists( dn ) );

        Method deleteChildrenMethod = connection.getClass().getDeclaredMethod( "deleteRecursive", DN.class, Map.class, DeleteListener.class );
        deleteChildrenMethod.setAccessible( true );
       
        DeleteResponse response = ( DeleteResponse ) deleteChildrenMethod.invoke( connection, dn, null, null );
        assertNotNull( response );
        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
       
        assertFalse( session.exists( dn ) );
    }
View Full Code Here


       
        DeleteFuture deleteFuture = connection.deleteAsync( new DeleteRequest( dn ));
       
        try
        {
            DeleteResponse deleteResponse = deleteFuture.get( 1000, TimeUnit.MILLISECONDS );
           
            assertNotNull( deleteResponse );
            assertEquals( ResultCodeEnum.SUCCESS, deleteResponse.getLdapResult().getResultCode() );
            assertTrue( connection.isAuthenticated() );
            assertFalse( session.exists( dn ) );
        }
        catch ( TimeoutException toe )
        {
View Full Code Here

        LdapConnection connection = getAdminConnection( ldapServer );

        AddResponse resp = createSubContext( "ou", "blah" );
        resp = createSubContext( new DN( "ou=blah,ou=system" )"ou", "subctx" );

        DeleteResponse delResp = connection.delete( "ou=blah,ou=system" );
        assertEquals( ResultCodeEnum.NOT_ALLOWED_ON_NON_LEAF, delResp.getLdapResult().getResultCode() );
    }
View Full Code Here

    @Test
    public void testFailDeleteNoSuchObject() throws Exception
    {
        LdapConnection connection = getAdminConnection( ldapServer );

        DeleteResponse delResp = connection.delete( "ou=blah,ou=system" );
        assertEquals( ResultCodeEnum.NO_SUCH_OBJECT, delResp.getLdapResult().getResultCode() );
    }
View Full Code Here

    public void testNormalDeleteFailContextNotEmpty() throws Exception
    {
        LdapConnection conn = getClientApiConnection( ldapServer );
       
        // delete failure on non-leaf entry
        DeleteResponse resp = conn.delete( "uid=akarasulu,ou=users,ou=system" );
        assertEquals( ResultCodeEnum.NOT_ALLOWED_ON_NON_LEAF, resp.getLdapResult().getResultCode() );

        conn.unBind();
    }
View Full Code Here

       
        // delete success
        conn.delete( "ou=computers,uid=akarasulu,ou=users,ou=system" );

        // delete failure non-existant entry
        DeleteResponse resp = conn.delete( "uid=elecharny,ou=users,ou=system" );
        assertEquals( ResultCodeEnum.NO_SUCH_OBJECT, resp.getLdapResult().getResultCode() );
       
        conn.unBind();
    }
View Full Code Here

    public void testDeleteNonExistent() throws Exception
    {
        LdapConnection conn = getClientApiConnection( ldapServer );
       
        // delete failure non-existent entry
        DeleteResponse resp = conn.delete( "uid=elecharny,ou=users,ou=system" );
        assertEquals( ResultCodeEnum.NO_SUCH_OBJECT, resp.getLdapResult().getResultCode() );
       
        conn.unBind();
    }
View Full Code Here

       
        DN userName = new DN( "uid=" + uid + ",ou=users,ou=system" );
       
        // delete the newly created context as the user
        LdapConnection userConnection = getConnectionAs( userName, password );
        DeleteResponse resp = userConnection.delete( entryDN );

        if( resp.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
        {
            return true;
        }
        else
        {
View Full Code Here

     * @throws Exception if there are problems
     */
    @Test
    public void testNoDeleteOnAdminByAdmin() throws Exception
    {
        DeleteResponse delResp = getAdminConnection().delete( "uid=admin,ou=system" );
        assertEquals( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, delResp.getLdapResult().getResultCode() );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.ldap.client.api.message.DeleteResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.