Class TaskDef
- java.lang.Object
-
- sbt.testing.TaskDef
-
- All Implemented Interfaces:
java.io.Serializable
public final class TaskDef extends java.lang.Object implements java.io.SerializableA bundle of information used to request aTaskfrom a test framework.An array of
TaskDefis passed toRunner'stasksmethod, which returns an array ofTasks. Each returned task, when executed, will run tests and suites determined by the test class name, fingerprints, "explicitly specified" field, and selectors of one of the passedTaskDefs.The "Explicitly specified" field means the user supplied a complete fully qualified test name, such as with the command:
> test-only
com.mycompany.myproject.WholeNameSpecas opposed to commands like:
> test-only
*WholeNameSpecor simply:
> test
The
explicitlySpecifiedfield will be true for in the first case, and false in the last two cases, because only in the first case was the fully qualified test class name completely specified by the user. The test framework can use this information to decide whether to ignore an annotation requesting a class not be discovered.The
fingerprintparameter indicates how the test suite was identified as a test suite. Thistasksmethod may be called withTaskDefs containing the same value fortestClassNamebut different fingerprints. For example, if both a class and its companion object were test classes, thetasksmethod could be passed an array containingTaskDefs with the same name but with a different value forfingerprint.isModule.A test framework may "reject" a requested task by returning no
Taskfor thatTaskDef.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TaskDef(java.lang.String fullyQualifiedName, Fingerprint fingerprint, boolean explicitlySpecified, Selector[] selectors)Constructs a newTaskDefwith the given fully qualified name, fingerprint, "explicitly specified" fag, and array of selectors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)booleanexplicitlySpecified()Indicates whether or not the test class requested by thisTaskDefwas "explicitly specified."Fingerprintfingerprint()The fingerprint that the test class requested by thisTaskDefmatches.java.lang.StringfullyQualifiedName()The fully qualified name of the test class requested by thisTaskDef.inthashCode()Selector[]selectors()One to many selectors describing the nature of theTaskrequested by thisTaskDef.java.lang.StringtoString()
-
-
-
Constructor Detail
-
TaskDef
public TaskDef(java.lang.String fullyQualifiedName, Fingerprint fingerprint, boolean explicitlySpecified, Selector[] selectors)Constructs a newTaskDefwith the given fully qualified name, fingerprint, "explicitly specified" fag, and array of selectors.- Parameters:
fullyQualifiedName- the fully qualified name of the test class to be run by the requested taskfingerprint- indicates how the test suite was identified as a test suite.explicitlySpecified- indicates whether the test class was explicitly specified by user.selectors- a possibly empty array ofSelectorsdetermining suites and tests to run
-
-
Method Detail
-
fullyQualifiedName
public java.lang.String fullyQualifiedName()
The fully qualified name of the test class requested by thisTaskDef.
-
fingerprint
public Fingerprint fingerprint()
The fingerprint that the test class requested by thisTaskDefmatches.
-
explicitlySpecified
public boolean explicitlySpecified()
Indicates whether or not the test class requested by thisTaskDefwas "explicitly specified."For more information on what explicitly specified means, see the main documentation for this class.
-
selectors
public Selector[] selectors()
One to many selectors describing the nature of theTaskrequested by thisTaskDef.A
Selectorcan indicate a direct, such as command-line, request from the user or a "rerun" of previously run tests. In the latter case, theSelectorswould be taken from those passed in events of a previous run or runs.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-