public enum CollectionSize extends java.lang.Enum<CollectionSize> implements Feature<java.util.Collection>, java.lang.Comparable<CollectionSize>
FeatureSpecificTestSuiteBuilder.withFeatures(Feature...)),
this annotation specifies each of the different sizes for which a test suite should be built. (In
a typical case, the features should include ANY.) These semantics are thus
a little different from those of other Collection-related features such as CollectionFeature or SetFeature.
However, when CollectionSize.Require is used to annotate a test it behaves normally
(i.e. it requires the collection instance under test to be a certain size for the test to run).
Note that this means a test should not require more than one CollectionSize, since a particular
collection instance can only be one size at once.
| Modifier and Type | Class and Description |
|---|---|
static interface |
CollectionSize.Require |
| Enum Constant and Description |
|---|
ANY |
ONE
Test a one-element collection.
|
SEVERAL
Test a three-element collection.
|
ZERO
Test an empty collection.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<Feature<? super java.util.Collection>> |
implied |
private java.lang.Integer |
numElements |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<Feature<? super java.util.Collection>> |
getImpliedFeatures()
Returns the set of features that are implied by this feature.
|
int |
getNumElements() |
static CollectionSize |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CollectionSize[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CollectionSize ZERO
public static final CollectionSize ONE
public static final CollectionSize SEVERAL
public static final CollectionSize ANY
private final java.util.Set<Feature<? super java.util.Collection>> implied
private final java.lang.Integer numElements
public static CollectionSize[] values()
for (CollectionSize c : CollectionSize.values()) System.out.println(c);
public static CollectionSize valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic java.util.Set<Feature<? super java.util.Collection>> getImpliedFeatures()
FeaturegetImpliedFeatures in interface Feature<java.util.Collection>public int getNumElements()