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

        // modify Rdn
        String newCn = "Tori Amos";
        String newRdn = "cn=" + newCn;
        String newDn = newRdn + "," + BASE;
       
        connection.rename( oldDn, newRdn, true );

        // Check, whether old Entry does not exists
        assertNull( connection.lookup( oldDn ) );

        // Check, whether new Entry exists
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

        // modify Rdn
        String newCn = "Tori Amos";
        String newRdn = "cn=" + newCn;
        String newDn = newRdn + "," + BASE;
       
        connection.rename( oldDn, newRdn, true );

        // Check, whether old Entry does not exists
        assertNull( connection.lookup( oldDn ) );

        // Check, whether new Entry exists
View Full Code Here

            "ObjectClass: OrganizationalUnit",
            "ou: users" );

        connection.add( entry );

        connection.rename( entry.getDn(), new Rdn( "ou=users" ) );

        Entry userzEntry = new DefaultEntry( "ou=userz,ou=groups,ou=system",
            "ObjectClass: top",
            "ObjectClass: OrganizationalUnit",
            "ou: userz" );
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

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.