Package com.onenetwork.platform.tools.test.junit4

Support for running JUnit4 tests in style of older Cactus Server tests.

This package consists of two client-facing classes: All other classes in this package are abstract and built to enable extensions. It is preferred, however, to use Test Rules instead of extending existing runners.

Using classes from this package has an advantage over using older style Server Tests in the sense that JUnit4 tests are generally more easily composable. For example, to run tests on Server, the test class will need to be annotated with
 @RunWith(ServerTest.class)
 
To make tests transactional, it is enough to use RunInTransaction test rule.

To make tests work and test UI elements and take screenshots whenever the test fails, it is enough to use TakeScreenshotOnError test rule.

Since:
20.0
  • Interface Summary 
    Interface Description
    RemoteTestExecutor
    Interface that describes an entity capable of executing JUnit tests on remote machine.

    Exact mechanism of such test execution are deliberately unspecified, to allow more flexibility.
  • Class Summary 
    Class Description
    ForwardingRemoteRunner
    Remote-capable JUnit4 test runner that takes responsibility of sending remote run requests, but on server side delegates actual test execution to separately configured runner instance.

    By default, this runner will delegate to the basic JUnit4 test runner.
    IsolatedServerTest
    Server Test runner variant that sends separate execution requests for each test method.
    RemoteCapableRunner
    Base class for JUnit 4 test runners that execute tests on remote JVM.

    It is assumed that client and server machine have same test classes and, to a certain extent, same runner implementations.
    ServerTest
    JUnit4 test executor that executes test on a remote server.
  • Annotation Types Summary 
    Annotation Type Description
    OnServerRunWith
    Configuration annotation for forwarding remote test runners.