Annotation Interface testExecutionListeners


@Target(TYPE) @Retention(RUNTIME) @Documented @Inherited public @interface testExecutionListeners
@testExecutionListeners is an annotation that can be applied to a test class to configure which testExecutionListeners should be registered with a testContextManager.

@testExecutionListeners is used to register listeners for a particular test class, its subclasses, and its nested classes. If you wish to register a listener globally, you should register it via the automatic discovery mechanism described in testExecutionListener.

This annotation may be used as a meta-annotation to create custom composed annotations. In addition, this annotation will be inherited from an enclosing test class by default. See @NestedtestConfiguration for details.

Switching to default testExecutionListener implementations

If you extend a class that is annotated with @testExecutionListeners and you need to switch to using the default set of listeners, you can annotate your class with the following.

// Switch to default listeners
@testExecutionListeners(listeners = {}, inheritListeners = false, mergeMode = MERGE_WITH_DEFAULTS)
class Mytests extends Basetests {
    // ...
}
Since:
2.5
Author:
Sam Brannen
See Also: