* This method performs all actions mentioned in class description.
*
*/
public void run() throws Exception {
Set prin = new HashSet();
prin.add(new FakePrincipal());
try {
createAP(null, prin, "listen");
// FAIL
throw new TestException(
"AuthenticationPermission was created successfully "
+ "while NullPointerException was expected to be "
+ "thrown.");
} catch (NullPointerException npe) {
// PASS
logger.fine(npe.toString() + " was thrown as expected.");
}
try {
createAP(prin, prin, null);
// FAIL
throw new TestException(
"AuthenticationPermission was created successfully "
+ "while NullPointerException was expected to be "
+ "thrown.");
} catch (NullPointerException npe) {
// PASS
logger.fine(npe.toString() + " was thrown as expected.");
}
try {
createAP(null, prin, null);
// FAIL
throw new TestException(
"AuthenticationPermission was created successfully "
+ "while NullPointerException was expected to be "
+ "thrown.");
} catch (NullPointerException npe) {
// PASS
logger.fine(npe.toString() + " was thrown as expected.");
}
Set testPrin = new HashSet();
try {
createAP(testPrin, prin, "listen");
// FAIL
throw new TestException(
"AuthenticationPermission was created successfully "
+ "while IllegalArgumentException was expected to be "
+ "thrown.");
} catch (IllegalArgumentException iae) {
// PASS
logger.fine(iae.toString() + " was thrown as expected.");
}
testPrin.add(new FakePrincipal());
testPrin.add(new Object());
try {
createAP(testPrin, prin, "listen");