Examples of LdapName


Examples of javax.naming.ldap.LdapName

     * <p>
     * The expected result is a true.
     * </p>
     */
    public void testIsEmpty002() throws Exception {
        LdapName ln = new LdapName("t=test");
        ln.remove(0);
        assertTrue(ln.isEmpty());
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * <p>
     * The expected result is a true.
     * </p>
     */
    public void testIsEmpty003() throws Exception {
        LdapName ln = new LdapName("");
        assertTrue(ln.isEmpty());
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * <p>
     * The expected result is if an empty name returns a non-null enumeration.
     * </p>
     */
    public void testGetAll001() throws Exception {
        LdapName ln = new LdapName("");
        Enumeration<String> x = ln.getAll();
        assertNotNull(x);
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * The expected result is if a non empty name returns a non-null
     * enumeration, and ordered like it should be.
     * </p>
     */
    public void testGetAll002() throws Exception {
        LdapName ln = new LdapName("t=test");
        Enumeration<String> e = ln.getAll();
        assertEquals("t=test", e.nextElement());
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

        Rdn d = new Rdn("st", "test");
        test.add(0, a);
        test.add(1, b);
        test.add(2, c);
        test.add(3, d);
        LdapName ln = new LdapName(test);
        Enumeration<String> e = ln.getAll();
        for (Rdn rdn : test) {
            assertEquals(rdn.toString(), e.nextElement());
        }
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * variable wich we create the Name.
     * </p>
     */
    public void testGet001() throws Exception {
        String test = "t=test";
        LdapName ln = new LdapName(test);
        assertEquals(test, ln.get(0));
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * </p>
     */
    public void testGet002() throws Exception {
        try {
            String test = "t=test";
            LdapName ln = new LdapName(test);
            ln.get(1);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {}
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * </p>
     */
    public void testGet003() throws Exception {
        String test = "";
        try {
            LdapName ln = new LdapName(test);
            ln.get(0);
            fail("The name is empty.");
        } catch (IndexOutOfBoundsException e) {}
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     * </p>
     */
    public void testGet004() throws Exception {
        String test = "t=test";
        try {
            LdapName ln = new LdapName(test);
            ln.get(-1);
            fail("Fail, the index is negative.");
        } catch (IndexOutOfBoundsException e) {}
    }
View Full Code Here

Examples of javax.naming.ldap.LdapName

     */
    public void testGet005() throws Exception {
        LinkedList<Rdn> test = new LinkedList<Rdn>();
        test.add(0, new Rdn("t=test"));
        test.add(1, new Rdn("t1=test"));
        LdapName ln = new LdapName(test);
        assertNotNull(ln.get(0));// the range of this name is 0-1
        assertNotNull(ln.get(1));
    }
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.