Class ClientTestRunner

java.lang.Object
org.junit.runner.Runner
org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner
org.eclipse.scout.rt.testing.client.runner.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:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
     
    protected static class 
    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
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.eclipse.scout.rt.platform.context.RunContext
     
    protected org.junit.runners.model.Statement
    interceptAfterClassStatement(org.junit.runners.model.Statement s, Class<?> javaClass)
     
    protected org.junit.runners.model.Statement
    interceptAfterStatement(org.junit.runners.model.Statement next, Class<?> testClass, Method testMethod)
     
    protected org.junit.runners.model.Statement
    interceptBeforeClassStatement(org.junit.runners.model.Statement s, Class<?> javaClass)
     
    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, 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClientTestRunner

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

    • 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
    • interceptBeforeClassStatement

      protected org.junit.runners.model.Statement interceptBeforeClassStatement(org.junit.runners.model.Statement s, Class<?> javaClass)
      Overrides:
      interceptBeforeClassStatement in class org.eclipse.scout.rt.testing.platform.runner.PlatformTestRunner
    • interceptAfterClassStatement

      protected org.junit.runners.model.Statement interceptAfterClassStatement(org.junit.runners.model.Statement s, Class<?> javaClass)
      Overrides:
      interceptAfterClassStatement 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