Class ForwardingRemoteRunner
java.lang.Object
org.junit.runner.Runner
com.onenetwork.platform.tools.test.junit4.RemoteCapableRunner
com.onenetwork.platform.tools.test.junit4.ForwardingRemoteRunner
- All Implemented Interfaces:
org.junit.runner.Describable
,org.junit.runner.manipulation.Filterable
,org.junit.runner.manipulation.Sortable
- Direct Known Subclasses:
ServerTest
public abstract class ForwardingRemoteRunner extends RemoteCapableRunner implements org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable
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. However, this can be configured by annotating the test class with
For example, to run server-side theories test, you can use:
By default, this runner will delegate to the basic JUnit4 test runner. However, this can be configured by annotating the test class with
@OnServerRunWith
.For example, to run server-side theories test, you can use:
@RunWith("some forwarding remote runner") @OnServerRunWith(Theories.class) public class MyTheoriesTest { ... }
- Since:
- 20.0
-
Constructor Summary
Constructors Constructor Description ForwardingRemoteRunner(java.lang.Class<?> testClass, org.junit.runners.model.RunnerBuilder suiteBuilder)
-
Method Summary
Modifier and Type Method Description protected org.junit.runners.model.Statement
classBlock(org.junit.runner.notification.RunNotifier notifier)
protected void
doRunOnServer(org.junit.runner.notification.RunNotifier notifier)
This method must be implemented to execute the tests when this method is called.void
filter(org.junit.runner.manipulation.Filter value)
protected void
filterDelegate(org.junit.runner.Runner runner)
protected java.lang.Class<? extends org.junit.runner.Runner>
getDelegateRunnerClass(java.lang.Class<?> testClass)
org.junit.runner.Description
getDescription()
protected org.junit.runner.Runner
initDelegateRunner(java.lang.Class<?> testClass, org.junit.runners.model.RunnerBuilder suiteBuilder)
protected org.junit.runner.Runner
initDelegateRunnerProperties(org.junit.runner.Runner runner, java.lang.Class<?> testClass)
void
sort(org.junit.runner.manipulation.Sorter value)
protected void
sortDelegate(org.junit.runner.Runner runner)
Methods inherited from class com.onenetwork.platform.tools.test.junit4.RemoteCapableRunner
execute, executor, getTestClass, initExecutor, isRunningOnServer, run, runOnClient, runOnServer
-
Constructor Details
-
ForwardingRemoteRunner
public ForwardingRemoteRunner(java.lang.Class<?> testClass, org.junit.runners.model.RunnerBuilder suiteBuilder) throws org.junit.runners.model.InitializationError- Throws:
org.junit.runners.model.InitializationError
-
-
Method Details
-
getDescription
public org.junit.runner.Description getDescription()- Specified by:
getDescription
in interfaceorg.junit.runner.Describable
- Specified by:
getDescription
in classorg.junit.runner.Runner
- See Also:
Runner.getDescription()
-
doRunOnServer
protected void doRunOnServer(org.junit.runner.notification.RunNotifier notifier)Description copied from class:RemoteCapableRunner
This method must be implemented to execute the tests when this method is called.
Implementors can assume server environment.
- Specified by:
doRunOnServer
in classRemoteCapableRunner
- Parameters:
notifier
-server-side test run observer
- See Also:
com.onenetwork.platform.tools.test.runner.RemoteCapableRunner#runOnServer(org.junit.runner.notification.RunNotifier)
-
filter
public void filter(org.junit.runner.manipulation.Filter value) throws org.junit.runner.manipulation.NoTestsRemainException- Specified by:
filter
in interfaceorg.junit.runner.manipulation.Filterable
- Throws:
org.junit.runner.manipulation.NoTestsRemainException
- See Also:
Filterable.filter(org.junit.runner.manipulation.Filter)
-
sort
public void sort(org.junit.runner.manipulation.Sorter value)- Specified by:
sort
in interfaceorg.junit.runner.manipulation.Sortable
- See Also:
Sortable.sort(org.junit.runner.manipulation.Sorter)
-
classBlock
protected org.junit.runners.model.Statement classBlock(org.junit.runner.notification.RunNotifier notifier) -
initDelegateRunner
protected org.junit.runner.Runner initDelegateRunner(java.lang.Class<?> testClass, org.junit.runners.model.RunnerBuilder suiteBuilder) throws org.junit.runners.model.InitializationError- Throws:
org.junit.runners.model.InitializationError
-
getDelegateRunnerClass
protected java.lang.Class<? extends org.junit.runner.Runner> getDelegateRunnerClass(java.lang.Class<?> testClass) -
initDelegateRunnerProperties
protected org.junit.runner.Runner initDelegateRunnerProperties(org.junit.runner.Runner runner, java.lang.Class<?> testClass) throws java.lang.Exception- Throws:
java.lang.Exception
-
filterDelegate
protected void filterDelegate(org.junit.runner.Runner runner) throws org.junit.runner.manipulation.NoTestsRemainException- Throws:
org.junit.runner.manipulation.NoTestsRemainException
-
sortDelegate
protected void sortDelegate(org.junit.runner.Runner runner)
-