Class ServerTest

java.lang.Object
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable
Direct Known Subclasses:
IsolatedServerTest

public class ServerTest
extends ForwardingRemoteRunner
JUnit4 test executor that executes test on a remote server. Whole test class will be executed in one execution request.

By default, tests run on server side using default JUnit4 runner. However, this can be configured by annotating test class with @OnServerRunWith.

For example, to run theories test on server, use:
 @RunWith(ServerTest.class)
 @OnServerRunWith(Theories.class)
 public class MyTheoriesTest {
   ...
 }
 
Since:
20.0
  • Constructor Details

    • ServerTest

      public ServerTest​(java.lang.Class<?> testClass, org.junit.runners.model.RunnerBuilder suiteBuilder) throws org.junit.runners.model.InitializationError
      Throws:
      org.junit.runners.model.InitializationError
  • Method Details

    • runOnClient

      public void runOnClient​(org.junit.runner.notification.RunNotifier notifier)
      Description copied from class: RemoteCapableRunner
      Invoked to run tests on the side of a client machine. Implementations are expected to not actually run tests when this method invoked, but instead send a test execution request(s) to remote server.
      Specified by:
      runOnClient in class RemoteCapableRunner
      Parameters:
      notifier - client-side test run observer
      See Also:
      com.onenetwork.platform.tools.test.runner.RemoteCapableRunner#runOnClient(org.junit.runner.notification.RunNotifier)
    • initExecutor

      protected RemoteTestExecutor initExecutor()
      Description copied from class: RemoteCapableRunner
      Initiates a test executor object responsible for sending test execution requests to remote server.
      Specified by:
      initExecutor in class RemoteCapableRunner
      Returns:
      See Also:
      com.onenetwork.platform.tools.test.runner.RemoteCapableRunner#initExecutor()