use of com.sun.tck.lib.ExpectedExceptions in project jtharness by openjdk.
the class ExceptionsExpected method getExpectedExceptionTypes.
/**
* Returns an array of expected exception types.
*/
protected Class<? extends Throwable>[] getExpectedExceptionTypes(TestCaseContext context) {
Class<? extends Throwable>[] expExTypes = null;
Set<Annotation> annotations = getAnnotationsInterestedIn(context);
for (Annotation annotation : annotations) {
if (ExpectedExceptions.class.equals(annotation.annotationType())) {
ExpectedExceptions exceptions = (ExpectedExceptions) annotation;
expExTypes = exceptions.value();
if (expExTypes.length == 0) {
throw new SomethingIsWrong("@ExpectedExceptions attached to " + context.getTestCaseName() + " contains empty array of classes.");
}
}
}
return expExTypes;
}
Aggregations