Package javax.naming.ldap

Examples of javax.naming.ldap.LdapName


     * Test method for 'javax.naming.ldap.LdapName(String)'
     * </p>
     */
    public void testLdapNameString001() throws Exception {
        try {
            new LdapName((String) null);
            fail("Failed the null argument is invalid.");
        } catch (NullPointerException e) {}

        //check that no exception happens
        new LdapName("CN=test");
        new LdapName("L=test,C=common");
        new LdapName("ST=test;CN=common");
        new LdapName("O=test+CM=common");
        new LdapName("OU=test this");
        new LdapName("C=test\\, this");
        new LdapName("S=#04024869");
        new LdapName("DC=test,T=time+CM=common V<this C>this,S=#04024869");
    }
View Full Code Here


     * Test method for 'javax.naming.ldap.LdapName(String)'
     * </p>
     */
    public void testLdapNameString002() throws Exception {
        String str = "t=\\20\\ te\\ s\\20t\\20\\20 + t2 = test1\\20\\ ";
        LdapName ln = new LdapName(str);
        assertEquals(ln.toString(), str);
        ln.get(0);
        assertEquals(ln.toString(), str);
        ln.add("t=test");
        assertEquals(ln.toString(), "t=test,t=\\ \\ te s t\\ +t2=test1\\ \\ ");
    }
View Full Code Here

     * <p>
     * The String is an example of an RDN surname value consisting of 5 letters
     * </p>
     */
    public void testLdapNameString010() throws Exception {
        new LdapName("SN=Lu\\C4\\8Di\\C4\\87");
    }
View Full Code Here

     * </p>
     */
    public void testLdapNameString011() throws Exception {
        String testUpperCase = "UID=TEST";
        String testLowerCase = "uid=test";
        assertEquals(new LdapName(testUpperCase), new LdapName(testLowerCase));
    }
View Full Code Here

     * <p>
     * The expected result an empty name, not null, empty.
     * </p>
     */
    public void testLdapNameString012() throws Exception {
        LdapName ln = new LdapName("");
        assertTrue(ln.isEmpty());
    }
View Full Code Here

     * <p>
     * The expected result is an instance of ldapname.
     * </p>
     */
    public void testLdapNameString013() throws Exception {
        new LdapName("a=<");
        new LdapName("a=<a");
        new LdapName("a=a<");
        new LdapName("a=a<b");
        new LdapName("a=a<b<");
        new LdapName("a=>");
        new LdapName("a=>a");
        new LdapName("a=a>");
        new LdapName("a=a>b");
        new LdapName("a=a>b>");
    }
View Full Code Here

     * The expected result is an InvalidNameException.
     * </p>
     */
    public void testLdapNameString014() throws Exception {
        try {
            new LdapName("test");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName("t=test,control");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        new LdapName("t=test,");
        try {
            new LdapName(",t=test");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName(",t=test,");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}
    }
View Full Code Here

     * <p>
     * The expected result is an InvalidNameException.
     * </p>
     */
    public void testLdapNameString015() throws Exception {
        new LdapName("t=");
        try {
            new LdapName("=t");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName("=");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName("=t=t");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        new LdapName("a=t=");
        try {
            new LdapName("=a=t=");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        new LdapName("a=b=t=z");

        try {
            new LdapName(";");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        new LdapName("a=b;");
        try {
            new LdapName(";a=b");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName("a=b;c");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName(";a=b;");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}
    }
View Full Code Here

     * The expected result is an InvalidNameException.
     * </p>
     */
    public void testLdapNameString016() throws Exception {

        new LdapName("a=a#");
        try {
            new LdapName("a=#a");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName("#a=a");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName("#a=#a");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName("#a=a#");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}
    }
View Full Code Here

     * The expected result is an Exception.
     * </p>
     */
    public void testLdapNameString036() {
        try {
            new LdapName("a<a");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName("<a=a");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName("<a=a<");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName("a>c");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName(">a=c");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}

        try {
            new LdapName(">a=c>");
            fail("InvalidNameException expected");
        } catch (InvalidNameException e) {}
    }
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.