|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LifeCycleConfig
This configuration class enables you to hook into Testatoo system if you need to execute some code before, after all tests and also before, after each test and decide where you want to execute a givne test or not.
| Method Summary | |
|---|---|
LifeCycleConfig |
onStart(java.lang.Runnable runnable)
Add an execution block to run after Testatoo system as started. |
LifeCycleConfig |
onStop(java.lang.Runnable runnable)
Add an execution block to run before Testatoo system stops. |
LifeCycleConfig |
onTest(org.aopalliance.intercept.MethodInterceptor interceptor)
Replace current MethodInterceptor
used to intercept all test calls. |
LifeCycleConfig |
onTest(TestListener listener)
Register a listener when a test method starts |
| Method Detail |
|---|
LifeCycleConfig onStart(java.lang.Runnable runnable)
runnable - The code to execute
LifeCycleConfig onStop(java.lang.Runnable runnable)
runnable - The code to execute
LifeCycleConfig onTest(org.aopalliance.intercept.MethodInterceptor interceptor)
MethodInterceptor
used to intercept all test calls. By default, no interceptor
is setup and all test are executed.
You can setup an interceptor if you need to execute some code
before or after a test, or if you need to skip a specifc test
in some conditions.
Example:
protected void configure() {
lifecycle()
.onTest(new MethodInterceptor() {
public Object invoke(MethodInvocation invocation) throws Throwable {
if (!invocation.getMethod().getName().equals("test3")) {
System.out.println("====> Running: " + invocation.getMethod());
return invocation.proceed();
} else {
System.out.println("====> Skipping: " + invocation.getMethod());
return null;
}
}
});
}
interceptor - The interceptor to setup
LifeCycleConfig onTest(TestListener listener)
listener - The listener to add
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||