public interface ExternalResource extends TestListenerRule
This interface is provided here as a facility for rule provider, which will
implement the before()
and after()
methods. The idea is to
support use case that access some external system which need preparation and
cleanup between each test.
To use this interface, implementer should :
before()
with the code that prepare the
external resource (creation of folder, start of server, etc).after()
with the code that cleanup the
external resource (destruction of folder, shutdown of server, etc). This
method is used even in case the test is in failure or error.Modifier and Type | Method and Description |
---|---|
default void |
after()
Code to be done after.
|
default void |
before()
Code to be done before
|
default void |
onEnd(TestContext<Object> context)
This method delegate to the
after() method. |
default void |
onStart(TestContext<Object> context)
This method delegate to the
before() method. |
computeStatement, of, onAssumptionSkip, onEnd, onError, onFailure, onStart
default void onStart(TestContext<Object> context)
before()
method.onStart
in interface TestListenerRule
context
- the context.default void onEnd(TestContext<Object> context)
after()
method.onEnd
in interface TestListenerRule
context
- the context.default void before()
default void after()
Copyright © 2015 Powerunit. All rights reserved.