public abstract class JkApplicationTester
extends java.lang.Object
implements java.lang.Runnable
The typical use-case is for testing applications end-to-end. Users need to implement :
run()
method, then can be invoked to orchestrate the whole execution of tests,
managing de deployment and cleanup of application environment.Modifier and Type | Field and Description |
---|---|
protected int |
reAttemptDelay |
protected int |
startTimeout |
Constructor and Description |
---|
JkApplicationTester() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
executeTests()
Executes the tests for the application under test.
|
protected int |
findFreePort()
Retiurn the first free port detected in the dynamic port range.
|
protected void |
init()
Prepares the variables required to start and stop the application,
including the base URL and port configuration.
|
protected abstract boolean |
isApplicationReady()
Check and returns if the application is ready to be tested.
|
void |
run()
Deploy application environment, run tests and un-deploy the application gracefully.
|
protected abstract void |
startApp()
Starts the application and its environment.
|
protected void |
stopForcefully()
This method is invoked when, the application did not start until defined timeout.
|
protected void |
stopGracefully()
This method is invoked when tests are terminated, to undeploy the application and its environment.
|
public final void run()
run
in interface java.lang.Runnable
protected void init()
protected abstract void startApp()
protected abstract boolean isApplicationReady()
protected abstract void executeTests()
for instance
if
tests failed.protected void stopGracefully()
protected void stopForcefully()
protected final int findFreePort()