Package javax.naming.ldap

Examples of javax.naming.ldap.LdapName.addAll()


     * The expected result is the adding of the name in the especified order.
     * </p>
     */
    public void testAddAllIntName003() throws Exception {
        LdapName ln = new LdapName("t=test");
        ln.addAll(1, new LdapName("uid=userid"));
        assertEquals("uid=userid,t=test", ln.toString());
    }

    /**
     * <p>
 
View Full Code Here


     * The expected result is the adding of the name in the specified order.
     * </p>
     */
    public void testAddAllIntName005() throws Exception {
        LdapName ln = new LdapName("t=test");
        ln.addAll(0, new LdapName("uid=userid"));
        assertEquals("t=test,uid=userid", ln.toString());
    }

    /**
     * <p>
 
View Full Code Here

     */
    public void testAddAllIntListOfRdn001() throws Exception {
        LinkedList<Rdn> test = null;
        try {
            LdapName ln = new LdapName("t=test");
            ln.addAll(0, test);
            fail("NPE expected");
        } catch (NullPointerException e) {}
    }

    /**
 
View Full Code Here

        LinkedList<Rdn> test = new LinkedList<Rdn>();
        try {
            test.add(new Rdn("t=test"));
            test.add(new Rdn("cn=common"));
            LdapName ln = new LdapName("t=test");
            ln.addAll(-1, test);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {}
    }

    /**
 
View Full Code Here

        LinkedList<Rdn> test = new LinkedList<Rdn>();
        try {
            test.add(new Rdn("t=test"));
            test.add(new Rdn("cn=common"));
            LdapName ln = new LdapName("t=test");
            ln.addAll(2, test);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {}
    }

    /**
 
View Full Code Here

     * </p>
     */
    public void testAddAllIntListOfRdn004() throws Exception {
        LinkedList<Rdn> test = new LinkedList<Rdn>();
        LdapName ln = new LdapName("");
        ln.addAll(0, test);
        assertEquals("", ln.toString());
    }

    /**
     * <p>
 
View Full Code Here

     */
    public void testAddAllIntListOfRdn005() throws Exception {
        LinkedList<Rdn> test = new LinkedList<Rdn>();
        test.add(new Rdn("t=test"));
        LdapName ln = new LdapName("");
        ln.addAll(0, test);
        assertEquals("t=test", ln.toString());
    }

    /**
     * <p>
 
View Full Code Here

     * </p>
     */
    public void testAddAllIntListOfRdn006() throws Exception {
        LinkedList<Rdn> test = new LinkedList<Rdn>();
        LdapName ln = new LdapName("t=test");
        ln.addAll(0, test);
        assertEquals("t=test", ln.toString());
    }

    /**
     * <p>
 
View Full Code Here

    public void testAddAllName() throws LdapException, InvalidNameException
    {
        LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" );
        Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" );

        assertSame( jName, jName.addAll( new LdapName( "cn=seven,cn=six" ) ) );
        assertNotSame( aName, aName.add( new Dn( "cn=seven,cn=six" ) ) );
        assertNotSame( jName.toString(), aName.toString() );
    }

View Full Code Here

    public void testAddAllIntName() throws LdapException, InvalidNameException
    {
        LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" );
        Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" );

        assertSame( jName, jName.addAll( 0, new LdapName( "cn=zero,cn=zero.5" ) ) );
        assertNotSame( aName, aName.add( new Dn( "cn=zero,cn=zero.5" ) ) );
        assertNotSame( jName.toString(), aName.toString() );

        assertSame( jName, jName.addAll( 2, new LdapName( "cn=zero,cn=zero.5" ) ) );
        assertNotSame( aName, aName.add( new Dn( "cn=zero,cn=zero.5" ) ) );
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.