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

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


            }

            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


       
        Entry original = connection.lookup( oldDn );
       
        assertNotNull( original );

        connection.rename( oldDn, "cn=TEST" );
       
        Entry renamed = connection.lookup( oldDn );
       
        assertNotNull( renamed );
        assertEquals( original.getDn(), renamed.getDn() );
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

        // tag after the addition before rename
        Tag t0 = getService().getChangeLog().tag();
        assertPresent( sysRoot, "ou=oldname,ou=system" );

        // rename the test entry and test that the rename occurred
        sysRoot.rename( "ou=oldname,ou=system", "ou=newname" );
        assertNotPresent( sysRoot, "ou=oldname,ou=system" );
        assertPresent( sysRoot, "ou=newname,ou=system" );

        // now revert and assert that the rename was reversed
        getService().revert( t0.getRevision() );
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

        assertNotNull( entry );
        assertEquals( 1, entry.get( "ou" ).size() );
        assertEquals( "users", entry.get( "ou" ).getString() );

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

        entry = connection.lookup( "ou=Users,ou=system" );

        assertNotNull( entry );
        assertEquals( 1, entry.get( "ou" ).size() );
View Full Code Here

    @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

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.