Search in sources :

Example 1 with StringEqualsIgnoreCaseTester

use of org.apereo.portal.groups.pags.testers.StringEqualsIgnoreCaseTester in project uPortal by Jasig.

the class PAGSTest method testStringEqualsIgnoreCaseTester.

public void testStringEqualsIgnoreCaseTester() throws Exception {
    print(CR + "***** ENTERING PAGSTester.testStringEqualsIgnoreCaseTester() *****" + CR);
    String msg = null;
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomStrings[0]);
    newPerson.setAttribute(key2, randomStrings[1].toLowerCase());
    msg = "Testing IPerson " + newPerson;
    print(msg);
    String testKey = randomStrings[0].toLowerCase();
    IPersonTester tester1 = new StringEqualsIgnoreCaseTester(new TestPersonAttributesGroupTestDefinition(key1, testKey));
    IPersonTester tester2 = new StringEqualsIgnoreCaseTester(new TestPersonAttributesGroupTestDefinition(key2, randomStrings[1]));
    msg = "Testing " + tester1;
    assertTrue(msg, tester1.test(newPerson));
    msg = "Testing " + tester2;
    assertTrue(msg, tester2.test(newPerson));
    print("Success!");
    print(CR + "***** LEAVING PAGSTester.testStringEqualsIgnoreCaseTester() *****" + CR);
}
Also used : IPerson(org.apereo.portal.security.IPerson) StringEqualsIgnoreCaseTester(org.apereo.portal.groups.pags.testers.StringEqualsIgnoreCaseTester)

Aggregations

StringEqualsIgnoreCaseTester (org.apereo.portal.groups.pags.testers.StringEqualsIgnoreCaseTester)1 IPerson (org.apereo.portal.security.IPerson)1