Search in sources :

Example 1 with BeanAnnotationsInitStatement

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

the class PlatformTestRunner method withBefores.

@Override
protected Statement withBefores(final FrameworkMethod method, final Object target, final Statement statement) {
    final List<FrameworkMethod> befores = getTestClass().getAnnotatedMethods(Before.class);
    if (befores.isEmpty()) {
        return new BeanAnnotationsInitStatement(statement, target);
    }
    Statement beforeStatement = new Statement() {

        @Override
        public void evaluate() throws Throwable {
            for (FrameworkMethod each : befores) {
                each.invokeExplosively(target);
            }
        }
    };
    final Statement interceptedBeforeStatement = interceptBeforeStatement(beforeStatement, getTestClass().getJavaClass(), method.getMethod());
    return new BeanAnnotationsInitStatement(new InterceptedBeforeStatement(statement, interceptedBeforeStatement), target);
}
Also used : BeanAnnotationsInitStatement(org.eclipse.scout.rt.testing.platform.runner.statement.BeanAnnotationsInitStatement) 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) FrameworkMethod(org.junit.runners.model.FrameworkMethod)

Aggregations

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