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

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


        assertNotNull( connection.lookup( "cn=test1,ou=system" ) );
        assertNotNull( connection.lookup( "cn=test2,ou=system" ) );
        assertNotNull( connection.lookup( "cn=childTest1,cn=test1,ou=system" ) );
        assertNotNull( connection.lookup( "cn=childTest2,cn=test2,ou=system" ) );

        connection.move( "cn=test1,ou=system", "cn=test2,ou=system" );

        assertNull( connection.lookup( "cn=test1,ou=system" ) );
        assertNull( connection.lookup( "cn=childTest1,cn=test1,ou=system" ) );
        assertNotNull( connection.lookup( "cn=test2,ou=system" ) );
        assertNotNull( connection.lookup( "cn=childTest2,cn=test2,ou=system" ) );
View Full Code Here


        boolean isMoved = false;
        String movedName = entryRdn + "," + newParentRdn + ",ou=system";

        try
        {
            userConnection.move( entryDn.getName(), newParentRdn + ",ou=system" );
            isMoved = true;
            assertTrue( adminConnection.exists( movedName ) );
            assertFalse( userConnection.exists( entryDn ) );
        }
        catch ( LdapNoPermissionException lnpe )
View Full Code Here

        LdapConnection con = getAdminConnection( getLdapServer() );

        //now do something bad: make the parent a child of its own child
        try
        {
            con.move( "ou=parent,ou=system", "ou=child,ou=parent,ou=system" );
            fail();
        }
        catch ( LdapUnwillingToPerformException lutpe )
        {
            assertTrue( true );
View Full Code Here

        LdapConnection con = getAdminConnection( getLdapServer() );

        //now do something bad: try to move the entry to the same Dn
        try
        {
            con.move( "ou=parent,ou=system", "ou=parent,ou=system" );
            fail();
        }
        catch ( LdapUnwillingToPerformException lutpe )
        {
            assertTrue( true );
View Full Code Here

        assertNotNull( connection.lookup( "cn=test1,ou=system" ) );
        assertNotNull( connection.lookup( "cn=test2,ou=system" ) );
        assertNotNull( connection.lookup( "cn=childTest1,cn=test1,ou=system" ) );
        assertNotNull( connection.lookup( "cn=childTest2,cn=test2,ou=system" ) );

        connection.move( "cn=test1,ou=system", "cn=test2,ou=system" );

        assertNull( connection.lookup( "cn=test1,ou=system" ) );
        assertNull( connection.lookup( "cn=childTest1,cn=test1,ou=system" ) );
        assertNotNull( connection.lookup( "cn=test2,ou=system" ) );
        assertNotNull( connection.lookup( "cn=childTest2,cn=test2,ou=system" ) );
View Full Code Here

            }

            String newRdn = "cn=test" + i;
           
            long ttt0 = System.nanoTime();
            connection.move( oldDn, newSuperior );
           
            //SearchResponse oldEntry = connection.lookup( oldDn );
            //SearchResponse newEntry = connection.lookup( newDn );
           
            //assertNull( oldEntry );
View Full Code Here

        connection.add( entry );

        assertNull( connection.lookup( newDn ) );
        assertNotNull( connection.lookup( oldDn ) );

        connection.move( oldDn, newSuperior );

        assertNotNull( connection.lookup( newDn ) );
        assertNull( connection.lookup( oldDn ) );
       
        connection.close();
View Full Code Here

        boolean isMoved = false;
        String movedName = entryRdn + "," + newParentRdn + ",ou=system";

        try
        {
            userConnection.move( entryDn.getName(), newParentRdn + ",ou=system" );
            isMoved = true;
            assertTrue( adminConnection.exists( movedName ) );
            assertFalse( userConnection.exists( entryDn ) );
        }
        catch ( LdapNoPermissionException lnpe )
View Full Code Here

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

        connection.move( "ou=users,ou=system", "ou=groups,ou=system" );
        Entry entry = connection.lookup( "ou=users,ou=groups,ou=system" );
        assertNotNull( entry );

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

        LdapConnection con = getClientApiConnection( getLdapServer() );

        //now do something bad: make the parent a child of its own child
        try
        {
            con.move( "ou=parent,ou=system", "ou=child,ou=parent,ou=system" );
            fail();
        }
        catch ( LdapUnwillingToPerformException lutpe )
        {
            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.