Search in sources :

Example 6 with ReflectiveCallable

use of org.junit.internal.runners.model.ReflectiveCallable in project tomee by apache.

the class ValidationRunner method methodBlock.

@Override
protected Statement methodBlock(final FrameworkMethod method) {
    final Object test;
    try {
        test = new ReflectiveCallable() {

            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createTest();
            }
        }.run();
    } catch (final Throwable e) {
        return new Fail(e);
    }
    Statement statement = new InvokeMethod(method, test);
    statement = withBefores(method, test, statement);
    statement = withAfters(method, test, statement);
    return statement;
}
Also used : ReflectiveCallable(org.junit.internal.runners.model.ReflectiveCallable) Statement(org.junit.runners.model.Statement) Fail(org.junit.internal.runners.statements.Fail)

Aggregations

ReflectiveCallable (org.junit.internal.runners.model.ReflectiveCallable)6 Fail (org.junit.internal.runners.statements.Fail)6 Statement (org.junit.runners.model.Statement)6 Target (au.com.dius.pact.provider.junit.target.Target)1 TestClassAwareTarget (au.com.dius.pact.provider.junit.target.TestClassAwareTarget)1 TestTarget (au.com.dius.pact.provider.junit.target.TestTarget)1 Method (java.lang.reflect.Method)1 AssumptionViolatedException (org.junit.internal.AssumptionViolatedException)1 RunAfters (org.junit.internal.runners.statements.RunAfters)1 RunBefores (org.junit.internal.runners.statements.RunBefores)1 FrameworkMethod (org.junit.runners.model.FrameworkMethod)1