Package javax.naming.ldap

Examples of javax.naming.ldap.Rdn


     */
    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.");
View Full Code Here


     * The expected result is a non null Rdn.
     * </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

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

     * </p>
     */
    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 true.
     * </p>
     */
    public void testStartsWithListOfRdn002() throws Exception {
        LinkedList<Rdn> test = new LinkedList<Rdn>();
        Rdn a = new Rdn("t=test");
        test.add(a);
        assertTrue(new LdapName("t=test").startsWith(test));
    }
View Full Code Here

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

     * </p>
     */
    public void testStartsWithListOfRdn006() throws Exception {

        LinkedList<Rdn> test = new LinkedList<Rdn>();
        test.add(new Rdn("t=test"));
        test.add(new Rdn("t1=test"));
        test.add(new Rdn("t2=test"));
        test.add(new Rdn("t3=test"));
        assertTrue(new LdapName("t3=test,t2=test,t1=test,t=test")
                .startsWith(test));
    }
View Full Code Here

     * The expected result is if a non null list of Rdns is sended, is a true.
     * </p>
     */
    public void testEndsWithListOfRdn002() throws Exception {
        LinkedList<Rdn> test = new LinkedList<Rdn>();
        test.add(new Rdn("t", "test"));
        assertTrue(new LdapName("t=test").endsWith(test));
    }
View Full Code Here

     * The expected result is if a non null list of Rdns is sended, is a false.
     * </p>
     */
    public void testEndsWithListOfRdn004() throws Exception {
        LinkedList<Rdn> test = new LinkedList<Rdn>();
        test.add(new Rdn("t=test"));
        assertFalse(new LdapName("").endsWith(test));
    }
View Full Code Here

     * </p>
     */
    public void testEndsWithListOfRdn006() throws Exception {

        LinkedList<Rdn> test = new LinkedList<Rdn>();
        test.add(new Rdn("t", "test"));
        test.add(new Rdn("t2", "test"));
        test.add(new Rdn("t3", "test"));
        assertTrue(new LdapName("t3=test,t2=test,t=test").endsWith(test));
    }
View Full Code Here

TOP

Related Classes of javax.naming.ldap.Rdn

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.