public enum CaseCompositionMode extends Enum<CaseCompositionMode>
| Enum Constant and Description |
|---|
EACH_SUBCASE_AT_LEAST_ONCE
The composition will generate enough subcases so that each base case's suppliers are covered at least once, or
the a number equivalent to the maximum number of suppliers of any base case.
|
PAIRWISE_PERMUTATIONS_OF_SUBCASES
The composition will generate enough subcases so that each possible pairing of any two base cases will be
included at least once.
|
| Modifier and Type | Method and Description |
|---|---|
static CaseCompositionMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CaseCompositionMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CaseCompositionMode EACH_SUBCASE_AT_LEAST_ONCE
For example, suppose you are writing a composition of the following three base cases:
a, with subcases 1 and 2;b, with subcases 'X', 'Y', and 'Z'; andc, with a single subcase true.
When these cases are composed with EACH_SUBCASE_AT_LEAST_ONCE, the final set of combined cases might be
the following:
case a | case b | case c | |
|---|---|---|---|
| 1 | 1 | 'X' | true |
| 2 | 2 | 'Y' | true |
| 3 | 1 | 'Z' | true |
Note that the total number of composed subcases is 3, because case b had the most subcases (again, 3).
The subcases for a and c repeated as necessary so that each composed subcase had a valid value
for all three.
Note also that the way in which subcases are reused is not guaranteed by this algorithm and may change between tests.
public static final CaseCompositionMode PAIRWISE_PERMUTATIONS_OF_SUBCASES
This mode uses the pairwise algorithm defined by the Pairwise class;
refer to it for more details. As an example, consider the following three base cases:
a, with subcases 1 and 2;b, with subcases 'X', 'Y', and 'Z'; andc, with a single subcase true.Given this input, the pairwise algorithm might generate the following composed subcases:
case a | case b | case c | |
|---|---|---|---|
| 1 | 1 | 'X' | true |
| 2 | 1 | 'Y' | true |
| 3 | 1 | 'Z' | true |
| 4 | 2 | 'X' | true |
| 5 | 2 | 'Y' | true |
| 6 | 2 | 'Z' | true |
Note that each possible pair between (a, b), (a, c), and (b, c)
are covered at least once. The number of subcases necessary roughly depends on the number of subcases between the
two largest base cases (in this example, case a had two possible subcases, and case b had three,
for a total of 2 * 3 = 6 cases).
Note also that the specific distribution of subcases is not guaranteed by this algorithm and may change between tests.
public static CaseCompositionMode[] values()
for (CaseCompositionMode c : CaseCompositionMode.values()) System.out.println(c);
public static CaseCompositionMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2017 Redfin. All rights reserved.