Search in sources :

Example 1 with BeforeTestGroup

use of com.sun.tck.lib.BeforeTestGroup in project jtharness by openjdk.

the class BeforeTestGroupActions method process.

/**
 * {@inheritDoc}
 */
@Override
public void process(TestGroupContext.TestGroupLifePhase lifePhase, TestGroupContext context) throws Throwable {
    BeforeTestGroup before = (BeforeTestGroup) getTheOnlyTestGroupAnnotationInterestedIn(context);
    String methodName = before.value();
    try {
        searchAndInvoke(methodName, context.getTestGroupInstance().getClass(), context.getTestGroupInstance(), context.getLog());
    } catch (SomethingIsWrong e) {
        final String message = e.getMessage();
        context.printlnToLog(message);
        final String failedTryingToInvoke = MessageFormat.format("Failed trying to invoke @BeforeTestGroup method \"{0}\"", methodName);
        throw new RuntimeException(failedTryingToInvoke);
    }
}
Also used : SomethingIsWrong(com.sun.tck.lib.tgf.SomethingIsWrong) BeforeTestGroup(com.sun.tck.lib.BeforeTestGroup)

Aggregations

BeforeTestGroup (com.sun.tck.lib.BeforeTestGroup)1 SomethingIsWrong (com.sun.tck.lib.tgf.SomethingIsWrong)1