msg = "Testing IPerson " + newPerson;
print(msg);
// test equals attribute. Should return true.
IPersonTester tester1 = new RegexTester(key1, randomStrings[0]);
// test and attribute begin with same String. Should return true.
String testValue2 = randomStrings[0].substring(0,1) + ".*";
IPersonTester tester2 = new RegexTester(key1, testValue2);
// test and attribute begin with different String. Should return false.
String testValue3 = "^[0]";
IPersonTester tester3 = new RegexTester(key1, testValue3);
// test and attribute end with same String. Should return true.
String testValue4 = ".*" + randomStrings[1].substring(randomStrings[1].length() - 1) + "$";
IPersonTester tester4 = new RegexTester(key2, testValue4);
// test and attribute end with different String. Should return false.
String testValue5 = ".*9$";
IPersonTester tester5 = new RegexTester(key2, testValue5);
// test value is same as last String in Vector. Should return true.
String testValue6 = "^" + ((String)stringVector.lastElement()) + "$";
IPersonTester tester6 = new RegexTester(key3, testValue6);
msg = "Testing " + tester1;
assertTrue(msg, tester1.test(newPerson));
msg = "Testing " + tester2;
assertTrue(msg, tester2.test(newPerson));
msg = "Testing " + tester3;
assertFalse(msg, tester3.test(newPerson));
msg = "Testing " + tester4;
assertTrue(msg, tester4.test(newPerson));
msg = "Testing " + tester5;
assertFalse(msg, tester5.test(newPerson));
msg = "Testing " + tester6;
assertTrue(msg, tester6.test(newPerson));
print("Success!");
print(CR + "***** LEAVING PAGSTester.testRegexTester() *****" + CR);