Project

General

Profile

« Previous | Next » 

Revision 8559

Added by Jing Tao over 10 years ago

Add a method to test an alias account in the ldap server.

View differences:

AuthLdapTest.java
58 58
        TestSuite suite = new TestSuite();
59 59
        suite.addTest(new AuthLdapTest("initialize"));
60 60
        suite.addTest(new AuthLdapTest("getPrincipals"));
61
        suite.addTest(new AuthLdapTest("testAliasedAccount"));
61 62
        return suite;
62 63
    }
63 64

  
......
104 105
    /**
105 106
     * To Do: add more methods test
106 107
     */
108
    
109
    public void testAliasedAccount() throws Exception {
110
        String alias = "uid=test2,o=unaffiliated,dc=ecoinformatics,dc=org";
111
        AuthLdap ldap = new AuthLdap();
112
        assertTrue("We should authenticate the alias dn "+alias,ldap.authenticate(alias, "test"));
113
        String[] info =ldap.getUserInfo(alias, null);
114
        assertTrue("The email address should be tao@nceas.ucsb.edu and should be "+info[2], info[2].equals("tao@nceas.ucsb.edu"));
115
    }
107 116

  
108 117
}

Also available in: Unified diff