Package javax.naming.ldap

Examples of javax.naming.ldap.LdapName


     * <p>
     * The expected results is a representation of this LDAP as we created it.
     * </p>
     */
    public void testToString001() throws Exception {
        LdapName ln = new LdapName("t=test");
        assertEquals("t=test", ln.toString());
    }
View Full Code Here


    public void testToString002() throws Exception {
        LinkedList<Rdn> test = new LinkedList<Rdn>();
        test.add(new Rdn("c1=common"));
        test.add(new Rdn("c2=common"));
        test.add(new Rdn("c3=common"));
        LdapName ln = new LdapName(test);
        String comp = "";
        for (Rdn rdn : test) {
            if (test.getFirst() == rdn) {
                comp = rdn.toString();
            } else {
                comp = rdn.toString() + "," + comp;
            }
        }
        assertEquals(comp, ln.toString());
    }
View Full Code Here

     * <p>
     * The expected results is that the name returns an empty string.
     * </p>
     */
    public void testToString003() throws Exception {
        LdapName ln = new LdapName("");
        assertEquals("", ln.toString());
    }
View Full Code Here

     * The expected result is that the name returns the string exactly as given
     * in the constructor.
     * </p>
     */
    public void testToString004() throws Exception {
        LdapName ln = new LdapName("t=ll");
        assertEquals("T=LL", ln.toString().toUpperCase());
    }
View Full Code Here

     * The expected result is a true.
     * </p>
     */
    public void testStartsWithName002() throws Exception {
        String test = "t=test,cn=test";
        LdapName ln = new LdapName(test);
        LdapName n = new LdapName("cn=test");
        assertTrue(ln.startsWith(n));
    }
View Full Code Here

     * The expected result is a false.
     * </p>
     */
    public void testStartsWithName003() throws Exception {
        String test = "t=test,cn=test";
        LdapName ln = new LdapName(test);
        LdapName n = new LdapName("t=test");
        assertFalse(ln.startsWith(n));
    }
View Full Code Here

     * The expected result is a false.
     * </p>
     */
    public void testStartsWithName004() throws Exception {
        String test = "t=test,cn=test,o=other";
        LdapName ln = new LdapName(test);
        LdapName n = (LdapName) ln.getPrefix(ln.size());
        assertTrue(ln.startsWith(n));
    }
View Full Code Here

     * <p>
     * The expected result is a false.
     * </p>
     */
    public void testStartsWithName005() throws Exception {
        LdapName ln = new LdapName("");
        LdapName n = new LdapName("t=test");
        assertFalse(ln.startsWith(n));
    }
View Full Code Here

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

     * <p>
     * The expected result is a false.
     * </p>
     */
    public void testStartsWithName007() throws Exception {
        LdapName ln = new LdapName("t=test");
        LdapName n = new LdapName("");
        assertTrue(ln.startsWith(n));
    }
View Full Code Here

TOP

Related Classes of javax.naming.ldap.LdapName

Copyright © 2018 www.massapicom. 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.