Package org.spockframework.runtime.model
Class IterationInfo
- java.lang.Object
-
- org.spockframework.runtime.model.NodeInfo<FeatureInfo,java.lang.reflect.AnnotatedElement>
-
- org.spockframework.runtime.model.IterationInfo
-
public class IterationInfo extends NodeInfo<FeatureInfo,java.lang.reflect.AnnotatedElement>
Runtime information about an iteration of a feature method.
-
-
Constructor Summary
Constructors Constructor Description IterationInfo(FeatureInfo feature, java.lang.Object[] dataValues, int estimatedNumIterations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCleanup(java.lang.Runnable cleanup)
java.util.List<java.lang.Runnable>
getCleanups()
java.lang.Object[]
getDataValues()
Return this iteration's data values for the ongoing execution of the owning feature method.int
getEstimatedNumIterations()
Returns the estimated total number of iterations for the ongoing execution of the owning feature method.java.lang.String
getName()
Returns the name of this iteration.java.lang.reflect.AnnotatedElement
getReflection()
-
Methods inherited from class org.spockframework.runtime.model.NodeInfo
getDescription, getLine, getMetadata, getParent, isStub, setDescription, setLine, setMetadata, setName, setParent, setReflection
-
-
-
-
Constructor Detail
-
IterationInfo
public IterationInfo(FeatureInfo feature, java.lang.Object[] dataValues, int estimatedNumIterations)
-
-
Method Detail
-
getReflection
public java.lang.reflect.AnnotatedElement getReflection()
- Overrides:
getReflection
in classNodeInfo<FeatureInfo,java.lang.reflect.AnnotatedElement>
-
getName
public java.lang.String getName()
Returns the name of this iteration. No strong guarantees are provided for this name, except that it is non-null. For example, it may be the same as the feature name, and it may not be unique among iterations of the same feature execution. Nevertheless, this is generally the name that should be presented to the user (if any).- Overrides:
getName
in classNodeInfo<FeatureInfo,java.lang.reflect.AnnotatedElement>
- Returns:
- the name of this iteration
-
getDataValues
public java.lang.Object[] getDataValues()
Return this iteration's data values for the ongoing execution of the owning feature method. The names of the data values (in the same order) are available throughFeatureInfo.getDataVariables()
.- Returns:
- this iteration's data values for the ongoing execution of the owning feature method
-
getEstimatedNumIterations
public int getEstimatedNumIterations()
Returns the estimated total number of iterations for the ongoing execution of the owning feature method. The value is obtained by calling size() on each data provider before the first iteration is run. It is only an estimate and won't change during feature execution (i.e. all FeatureInfos will return the same value).- Returns:
- the estimated total number of iterations for the execution of the owning feature method
-
addCleanup
public void addCleanup(java.lang.Runnable cleanup)
-
getCleanups
public java.util.List<java.lang.Runnable> getCleanups()
-
-