Event Dispatcher
v0.1.6-beta.1
Project that offers a small library that allows to subscribe and fire events.
|
The TimingExtension class implements the BeforeTestExecutionCallback and the AfterTestExecutionCallback interfaces, which overrides the.
method and the
method.
An Extension can be registered declaratively
via org.junit.jupiter.api.extension.ExtendWith, programmatically
via {@linkplain org.junit.jupiter.api.extension.RegisterExtension @RegisterExtension}, or automatically
via the {@linkplain java.util.ServiceLoader ServiceLoader} mechanism.
Definition at line 25 of file TimingExtension.java.
Public Member Functions | |
void | beforeTestExecution (ExtensionContext context) throws Exception |
void | afterTestExecution (ExtensionContext context) throws Exception |
Private Member Functions | |
Store | getStore (ExtensionContext context) |
Static Private Attributes | |
static final Logger | LOGGER = LogManager.getLogger(TimingExtension.class) |
static final String | START_TIME = "start time" |
void beforeTestExecution | ( | ExtensionContext | context | ) | throws Exception |
This callback is invoked immediately after
each test has been executed, and its only purpose is to start the test timer to measure the elapsed time.
This will store the current system time value for later retrieval under the
key.
context | the current extension context, never null |
Definition at line 44 of file TimingExtension.java.
void afterTestExecution | ( | ExtensionContext | context | ) | throws Exception |
This callback is invoked immediately after
each test has been executed, and its only purpose is to stop the timer and to log out the test elapsed time.
This method will retrieve the stored value under the
key and calculate the elapsed time.
context | the current extension context, never null |
Definition at line 61 of file TimingExtension.java.
|
private |
Returns the.
instance that is associated for the given
.
context | the context in which the current test or container is being executed. Extensions are provided an instance of ExtensionContext to perform their work. |
Definition at line 79 of file TimingExtension.java.
|
staticprivate |
Definition at line 27 of file TimingExtension.java.
|
staticprivate |
Definition at line 29 of file TimingExtension.java.