Search in sources :

Example 1 with BeanAnnotationsCleanupStatement

use of org.eclipse.scout.rt.testing.platform.runner.statement.BeanAnnotationsCleanupStatement in project scout.rt by eclipse.

the class PlatformTestRunner method withAfters.

@Override
protected Statement withAfters(final FrameworkMethod method, final Object target, final Statement statement) {
    final List<FrameworkMethod> afters = getTestClass().getAnnotatedMethods(After.class);
    if (afters.isEmpty()) {
        return new BeanAnnotationsCleanupStatement(statement);
    }
    final List<Throwable> errors = new ArrayList<>();
    final Statement afterStatement = new RunAftersStatement(afters, target, errors);
    final Statement interceptedAfterStatement = interceptAfterStatement(afterStatement, getTestClass().getJavaClass(), method.getMethod());
    InterceptedAfterStatement s1 = new InterceptedAfterStatement(statement, interceptedAfterStatement, errors);
    return new BeanAnnotationsCleanupStatement(s1);
}
Also used : BeanAnnotationsCleanupStatement(org.eclipse.scout.rt.testing.platform.runner.statement.BeanAnnotationsCleanupStatement) Statement(org.junit.runners.model.Statement) SubjectStatement(org.eclipse.scout.rt.testing.platform.runner.statement.SubjectStatement) BeanAnnotationsCleanupStatement(org.eclipse.scout.rt.testing.platform.runner.statement.BeanAnnotationsCleanupStatement) AssertNoRunningJobsStatement(org.eclipse.scout.rt.testing.platform.runner.statement.AssertNoRunningJobsStatement) TimeoutRunContextStatement(org.eclipse.scout.rt.testing.platform.runner.statement.TimeoutRunContextStatement) BeanAnnotationsInitStatement(org.eclipse.scout.rt.testing.platform.runner.statement.BeanAnnotationsInitStatement) RegisterBeanStatement(org.eclipse.scout.rt.testing.platform.runner.statement.RegisterBeanStatement) ThrowHandledExceptionStatement(org.eclipse.scout.rt.testing.platform.runner.statement.ThrowHandledExceptionStatement) ClearThreadInterruptionStatusStatement(org.eclipse.scout.rt.testing.platform.runner.statement.ClearThreadInterruptionStatusStatement) RunContextStatement(org.eclipse.scout.rt.testing.platform.runner.statement.RunContextStatement) PlatformStatement(org.eclipse.scout.rt.testing.platform.runner.statement.PlatformStatement) TransactionAddFailureOnAnyExceptionStatement(org.eclipse.scout.rt.testing.platform.runner.statement.TransactionAddFailureOnAnyExceptionStatement) TimesStatement(org.eclipse.scout.rt.testing.platform.runner.statement.TimesStatement) ArrayList(java.util.ArrayList) FrameworkMethod(org.junit.runners.model.FrameworkMethod)

Aggregations

ArrayList (java.util.ArrayList)1 AssertNoRunningJobsStatement (org.eclipse.scout.rt.testing.platform.runner.statement.AssertNoRunningJobsStatement)1 BeanAnnotationsCleanupStatement (org.eclipse.scout.rt.testing.platform.runner.statement.BeanAnnotationsCleanupStatement)1 BeanAnnotationsInitStatement (org.eclipse.scout.rt.testing.platform.runner.statement.BeanAnnotationsInitStatement)1 ClearThreadInterruptionStatusStatement (org.eclipse.scout.rt.testing.platform.runner.statement.ClearThreadInterruptionStatusStatement)1 PlatformStatement (org.eclipse.scout.rt.testing.platform.runner.statement.PlatformStatement)1 RegisterBeanStatement (org.eclipse.scout.rt.testing.platform.runner.statement.RegisterBeanStatement)1 RunContextStatement (org.eclipse.scout.rt.testing.platform.runner.statement.RunContextStatement)1 SubjectStatement (org.eclipse.scout.rt.testing.platform.runner.statement.SubjectStatement)1 ThrowHandledExceptionStatement (org.eclipse.scout.rt.testing.platform.runner.statement.ThrowHandledExceptionStatement)1 TimeoutRunContextStatement (org.eclipse.scout.rt.testing.platform.runner.statement.TimeoutRunContextStatement)1 TimesStatement (org.eclipse.scout.rt.testing.platform.runner.statement.TimesStatement)1 TransactionAddFailureOnAnyExceptionStatement (org.eclipse.scout.rt.testing.platform.runner.statement.TransactionAddFailureOnAnyExceptionStatement)1 FrameworkMethod (org.junit.runners.model.FrameworkMethod)1 Statement (org.junit.runners.model.Statement)1