Package javax.naming.ldap

Examples of javax.naming.ldap.LdapContext.rename()


    @Test
    public void testMoveControl() throws Exception
    {
        LdapContext sysRoot = getSystemContext( service );

        sysRoot.rename( "ou=users", "ou=users,ou=groups" );
        assertNotNull( sysRoot.lookup( "ou=users,ou=groups" ) );

        try
        {
            sysRoot.lookup( "ou=users" );
View Full Code Here


    {
        LdapContext sysRoot = getSystemContext( service );

        try
        {
            sysRoot.rename( "ou=users", "ou=groups" );
            fail( "Execution should never get here due to exception!" );
        }
        catch ( LdapNameAlreadyBoundException e )
        {
            assertEquals( "ou=groups,ou=system", e.getResolvedName().toString() );
View Full Code Here

    {
        LdapContext sysRoot = getSystemContext( service );

        try
        {
            sysRoot.rename( "ou=blah", "ou=asdf" );
            fail( "Execution should never get here due to exception!" );
        }
        catch ( LdapNameNotFoundException e )
        {
            assertEquals( "ou=blah,ou=system", e.getResolvedName().toString() );
View Full Code Here

    @Test
    public void testModifyRdnControl() throws Exception
    {
        LdapContext sysRoot = getSystemContext( service );

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

        try
        {
            sysRoot.lookup( "ou=users" );
View Full Code Here

       
        // -------------------------------------------------------------------
        // do rename and confirm
        // -------------------------------------------------------------------

        ctx.rename( "cn=foo bar,ou=system", "cn=fbar,ou=system" );
        try
        {
            ctx.getAttributes( "cn=foo bar,ou=system" );
            fail( "old name of renamed entry should not be found" );
        }
View Full Code Here

                    {
                        modCtx.addToEnvironment( JAVA_NAMING_LDAP_DELETE_RDN, "false" ); //$NON-NLS-1$
                    }

                    // rename entry
                    modCtx.rename( getSaveJndiName( oldDn ), getSaveJndiName( newDn ) );
                }
                catch ( ReferralException re )
                {
                    logModifycation = false;
                    try
View Full Code Here

        LdapContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );

        // ModifyDN referrals failure
        try
        {
            ctx.rename( "uid=akarasuluref,ou=users,ou=system", "uid=ref,ou=users,ou=system" );
            fail( "Should never get here due to ModifyDN failure on ReferralException" );
        }
        catch ( ReferralException e )
        {
            // seems JNDI only returns the first referral URL and not all so we test for it
View Full Code Here

        // -------------------------------------------------------------------
        // do rename and confirm
        // -------------------------------------------------------------------

        ctx.rename( "cn=foo bar,ou=system", "cn=fbar,ou=system" );
        try
        {
            ctx.getAttributes( "cn=foo bar,ou=system" );
            fail( "old name of renamed entry should not be found" );
        }
View Full Code Here

        LdapContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );

        // ModifyDN referrals failure
        try
        {
            ctx.rename( "uid=akarasuluref,ou=users,ou=system", "uid=ref,ou=users,ou=system" );
            fail( "Should never get here due to ModifyDN failure on ReferralException" );
        }
        catch ( ReferralException e )
        {
            // seems JNDI only returns the first referral URL and not all so we test for it
View Full Code Here

                    {
                        modCtx.addToEnvironment( "java.naming.ldap.deleteRDN", "false" ); //$NON-NLS-1$ //$NON-NLS-2$
                    }

                    // rename entry
                    modCtx.rename( new LdapName( oldDn ), new LdapName( newDn ) );
                }
                catch ( ReferralException re )
                {
                    try
                    {
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.