Package org.spockframework.runtime
Interface IRunListener
- All Known Implementing Classes:
AbstractRunListener
,MasterRunListener
,RevertMetaClassRunListener
public interface IRunListener
Listens to a spec run. Currently, only extensions can register listeners.
They do so by invoking SpecInfo.addListener(). See
StepwiseExtension
for an example of how to use a listener.- Author:
- Peter Niederwieser
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterFeature
(FeatureInfo feature) Called after each feature of a spec.void
afterIteration
(IterationInfo iteration) Called after each iteration of a data-driven feature.void
Called after a spec.void
beforeFeature
(FeatureInfo feature) Called before each feature of a spec.void
beforeIteration
(IterationInfo iteration) Called before each iteration of a data-driven feature.void
beforeSpec
(SpecInfo spec) Called before a spec.void
Called for every error that occurs during a spec run.void
featureSkipped
(FeatureInfo feature) Called if a feature is skipped, for example because it is marked with @Ignore.void
specSkipped
(SpecInfo spec) Called if a spec is skipped, for example because it is marked with @Ignore.
-
Method Details
-
beforeSpec
Called before a spec. -
beforeFeature
Called before each feature of a spec. -
beforeIteration
Called before each iteration of a data-driven feature. All data values have been computed successfully at this point. Not called for features that aren't data-driven (i.e. don't have a where-block). -
afterIteration
Called after each iteration of a data-driven feature. Not called for features that aren't data-driven (i.e. don't have a where-block). -
afterFeature
Called after each feature of a spec. -
afterSpec
Called after a spec. -
error
Called for every error that occurs during a spec run. May be called multiple times for the same method, for example if both the expect-block and the cleanup-block of a feature method fail. -
specSkipped
Called if a spec is skipped, for example because it is marked with @Ignore. -
featureSkipped
Called if a feature is skipped, for example because it is marked with @Ignore.
-