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

Examples of org.apache.directory.ldap.client.api.LdapConnection.rename()


    @Test( expected = LdapEntryAlreadyExistsException.class )
    public void testFailModifyRdnEntryAlreadyExists() throws Exception
    {
        LdapConnection connection = getAdminConnection( getService() );

        connection.rename( "ou=users,ou=system", "ou=groups" );
    }


    /**
     * Test modifyRdn operation failure when the object renamed is non-existant.
View Full Code Here


    @Test( expected = LdapNoSuchObjectException.class )
    public void testFailModifyRdnNoSuchObject() throws Exception
    {
        LdapConnection connection = getAdminConnection( getService() );

        connection.rename( "ou=blah,ou=system", "ou=asdf" );
    }


    /**
     * Modify operation control to test if normal modify operations occur
View Full Code Here

    @Test
    public void testModifyRdnControl() throws Exception
    {
        LdapConnection connection = getAdminConnection( getService() );

        connection.rename( "ou=users,ou=system", "ou=asdf" );
        assertNotNull( connection.lookup( "ou=asdf,ou=system" ) );

        assertNull( connection.lookup( "ou=users,ou=system" ) );
    }
View Full Code Here

        Dn userName = new Dn( "uid=" + uid + ",ou=users,ou=system" );

        LdapConnection userConnection = getConnectionAs( userName, password );
        try
        {
            userConnection.rename( entryDn.getName(), newNameRdn );
            adminConnection.delete( newNameRdn + ",ou=system" );
            result = true;
        }
        catch ( LdapException le )
        {
View Full Code Here

        String renamedName = newNameRdn + ", " + newParentRdn + ",ou=system";
       
        try
        {
            userConnection.rename( movedName, newNameRdn );
            assertTrue( adminConnection.exists( renamedName ) );
            assertFalse( adminConnection.exists( movedName ) );
           
            adminConnection.delete( renamedName );
            result = true;
View Full Code Here

            }

            String newRdn = "cn=test" + i;
           
            long ttt0 = System.nanoTime();
            connection.rename( oldDn, newRdn, true );
            long ttt1 = System.nanoTime();

            oldDn = newRdn + ",ou=system";
            //System.out.println("added " + i + ", delta = " + (ttt1-ttt0)/1000);
        }
View Full Code Here

        connection.add( entry );
       
        try
        {
            connection.rename( entry.getDn(), new Rdn( "ou=users" ) );
            fail();
        }
        catch( LdapEntryAlreadyExistsException leaee )
        {
            assertTrue( true );
View Full Code Here

        connection.add( userzEntry );

        try
        {
            connection.rename( "ou=userz,ou=groups,ou=system", "ou=users", true );
            fail();
        }
        catch( LdapEntryAlreadyExistsException leaee )
        {
            assertTrue( true );
View Full Code Here

    {
        LdapConnection connection = getAdminConnection( getService() );

        try
        {
            connection.rename( "ou=blah,ou=groups,ou=system", "ou=blah1" );
            fail();
        }
        catch ( LdapNoSuchObjectException lnsoe )
        {
            assertTrue( true );
View Full Code Here

            assertTrue( true );
        }

        try
        {
            connection.rename( "ou=blah,ou=groups,ou=system", "ou=blah1" );
            fail();
        }
        catch ( LdapNoSuchObjectException lnsoe )
        {
            assertTrue( true );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.