Class ClientTestRunner

  • All Implemented Interfaces:
    org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Orderable, org.junit.runner.manipulation.Sortable
    Direct Known Subclasses:
    ParameterizedClientTestRunner

    public class ClientTestRunner
    extends org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner
    Use this Runner to run tests which require a session context.

    Use the following mandatory annotations to configure the Runner:

    • RunWithClientSession:
      to specify the client-session to be used; can be defined on class or method-level;
    • RunWithSubject:
      to specify the user on behalf of which to run the test; can be defined on class or method-level;
    Example:
     @RunWith(ClientTestRunner.class)
     @RunWithClientSession()
     @RunWithSubject("anna")
     public class YourTest {
        ...
     }
     
    Execution: Note: Usually, all Before, the Test-annotated method and all After methods are invoked in a single model job. But if the Test-annotated method uses the timeout feature (i.e. Test.timeout() ), the three parts are executed in different model jobs.
    Since:
    5.1
    See Also:
    RunWithClientSession, RunWithSubject
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  ClientTestRunner.AddBlockingConditionTimeoutStatement  
      protected static class  ClientTestRunner.CleanupDesktopStatement
      Statement which closes all forms which were started during the test evaluation.
      • Nested classes/interfaces inherited from class org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner

        org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner.InterceptedAfterStatement, org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner.InterceptedBeforeStatement, org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner.RunAftersStatement
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.eclipse.scout.rt.platform.context.RunContext createJUnitRunContext()  
      protected org.junit.runners.model.Statement interceptAfterStatement​(org.junit.runners.model.Statement next, Class<?> testClass, Method testMethod)  
      protected org.junit.runners.model.Statement interceptBeforeStatement​(org.junit.runners.model.Statement next, Class<?> testClass, Method testMethod)  
      protected org.junit.runners.model.Statement interceptClassLevelStatement​(org.junit.runners.model.Statement next, Class<?> testClass)  
      protected org.junit.runners.model.Statement interceptMethodLevelStatement​(org.junit.runners.model.Statement next, Class<?> testClass, Method testMethod)  
      protected org.junit.runners.model.Statement withPotentialTimeout​(org.junit.runners.model.FrameworkMethod method, Object test, org.junit.runners.model.Statement next)  
      • Methods inherited from class org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner

        classBlock, getTimeoutMillis, hasNoTimeout, interceptAfterClassStatement, interceptBeforeClassStatement, methodBlock, possiblyExpectingExceptions, withAfterClasses, withAfters, withBeforeClasses, withBefores
      • Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner

        collectInitializationErrors, computeTestMethods, createTest, createTest, describeChild, getChildren, getTestRules, isIgnored, methodInvoker, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor
      • Methods inherited from class org.junit.runners.ParentRunner

        childrenInvoker, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withInterruptIsolation
      • Methods inherited from class org.junit.runner.Runner

        testCount
    • Constructor Detail

      • ClientTestRunner

        public ClientTestRunner​(Class<?> clazz)
                         throws org.junit.runners.model.InitializationError
        Throws:
        org.junit.runners.model.InitializationError
    • Method Detail

      • interceptClassLevelStatement

        protected org.junit.runners.model.Statement interceptClassLevelStatement​(org.junit.runners.model.Statement next,
                                                                                 Class<?> testClass)
        Overrides:
        interceptClassLevelStatement in class org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner
      • interceptMethodLevelStatement

        protected org.junit.runners.model.Statement interceptMethodLevelStatement​(org.junit.runners.model.Statement next,
                                                                                  Class<?> testClass,
                                                                                  Method testMethod)
        Overrides:
        interceptMethodLevelStatement in class org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner
      • withPotentialTimeout

        protected org.junit.runners.model.Statement withPotentialTimeout​(org.junit.runners.model.FrameworkMethod method,
                                                                         Object test,
                                                                         org.junit.runners.model.Statement next)
        Overrides:
        withPotentialTimeout in class org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner
      • interceptBeforeStatement

        protected org.junit.runners.model.Statement interceptBeforeStatement​(org.junit.runners.model.Statement next,
                                                                             Class<?> testClass,
                                                                             Method testMethod)
        Overrides:
        interceptBeforeStatement in class org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner
      • interceptAfterStatement

        protected org.junit.runners.model.Statement interceptAfterStatement​(org.junit.runners.model.Statement next,
                                                                            Class<?> testClass,
                                                                            Method testMethod)
        Overrides:
        interceptAfterStatement in class org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner
      • createJUnitRunContext

        protected org.eclipse.scout.rt.platform.context.RunContext createJUnitRunContext()
        Overrides:
        createJUnitRunContext in class org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner