Examples of LdapName


Examples of javax.naming.ldap.LdapName

     * The expected result is an exception like indexoutofbounds.
     * </p>
     */
    public void testGet006() throws Exception {
        LinkedList<Rdn> test = new LinkedList<Rdn>();
        LdapName ln = null;

        test.add(0, new Rdn("t=test"));
        test.add(1, new Rdn("t1=test"));
        ln = new LdapName(test);

        try {
            ln.get(-1);// the range of this name is 0-1
            fail("Should raise an exception.");
        } catch (IndexOutOfBoundsException e) {}

        try {
            ln.get(2);// the range of this name is 0-1
            fail("Should raise an exception.");
        } catch (IndexOutOfBoundsException e) {}
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * variable wich we create the Name.
     * </p>
     */
    public void testGet007() throws Exception {
        String test1 = "t=\\ test\\ +t1=\\ test1";
        LdapName ln1 = new LdapName(test1);
        assertEquals(test1, ln1.get(0));
       
        String test2 = "t=\\20\\ te\\ s\\20t\\20\\20 + t2 = test1\\20\\ ";
        LdapName ln2 = new LdapName(test2);
        assertEquals("t=\\ \\ te s t\\ +t2=test1\\ \\ ", ln2.get(0));
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * </p>
     */
    public void testGetRdn001() throws Exception {
        LinkedList<Rdn> test = new LinkedList<Rdn>();
        test.add(new Rdn("t=test"));
        LdapName ln = new LdapName(test);
        assertNotNull(ln.getRdn(0));
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     */
    public void testGetRdn002() throws Exception {
        try {
            LinkedList<Rdn> test = new LinkedList<Rdn>();
            test.add(new Rdn("t=test"));
            LdapName ln = new LdapName(test);
            ln.getRdn(-1);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {}
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     */
    public void testGetRdn003() throws Exception {
        try {
            LinkedList<Rdn> test = new LinkedList<Rdn>();
            test.add(new Rdn("t=test"));
            LdapName ln = new LdapName(test);
            ln.getRdn(1);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {}
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * The expected result is an IndexOutOfBoundsException.
     * </p>
     */
    public void testGetRdn004() throws Exception {
        try {
            LdapName ln = new LdapName("");
            ln.getRdn(0);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {}
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * <p>
     * The expected result is the component RDNs returned in the correct order.
     * </p>
     */
    public void testGetRdn005() throws Exception {
        LdapName ln = new LdapName("o=other,t=test,uid=userid");
        assertEquals("uid=userid", ln.getRdn(0).toString());
        assertEquals("t=test", ln.getRdn(1).toString());
        assertEquals("o=other", ln.getRdn(2).toString());
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * The expected result is in the position zero an empty name and in the
     * position one another name like "t=test".
     * </p>
     */
    public void testGetPrefix001() throws Exception {
        LdapName ln = new LdapName("t=test");
        assertEquals("", ln.getPrefix(0).toString());
        assertEquals("t=test", ln.getPrefix(1).toString());
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * </p>
     */
    public void testGetPrefix003() throws Exception {
        String test = "t=test";
        try {
            LdapName ln = new LdapName(test);
            ln.getPrefix(-1);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {}

    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * </p>
     */
    public void testGetPrefix004() throws Exception {
        String test = "t=test";
        try {
            LdapName ln = new LdapName(test);
            ln.getPrefix(2);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {}
    }
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.