public interface LifeCycleConfig
| Modifier and Type | Method and Description |
|---|---|
LifeCycleConfig |
onStart(Runnable runnable)
Add an execution block to run after Testatoo system as started.
|
LifeCycleConfig |
onStop(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
|
LifeCycleConfig onStart(Runnable runnable)
runnable - The code to executeLifeCycleConfig onStop(Runnable runnable)
runnable - The code to executeLifeCycleConfig 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 setupLifeCycleConfig onTest(TestListener listener)
listener - The listener to addCopyright © 2008-2013 Ovea. All Rights Reserved.