Package javax.naming.ldap

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


     * </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

     */
    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

     */
    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

     * 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

     * <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

     * 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

     * </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

     * </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

     * size(), the expected result is the complete prefix name.
     * </p>
     */
    public void testGetPrefix005() throws Exception {
        String test = "t=test,t1=test,t2=test";
        LdapName ln = new LdapName(test);
        assertEquals(test, ln.getPrefix(ln.size()).toString());
    }
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.