Enum Class TestType
- All Implemented Interfaces:
Serializable, Comparable<TestType>, Constable
Classification of @Test program types based on validation mechanism.
EK9 supports five distinct testing paradigms:
- ASSERT: Traditional unit tests using assert/assertThrows/assertDoesNotThrow. No expected output files. Test passes if no assertion failures occur.
- BLACKBOX: Output validation via single expected_output.txt file. Program runs without arguments. Actual stdout compared to expected file.
- BLACKBOX_HYBRID: Combines blackbox output validation WITH assertions. Both the expected output must match AND all assertions must pass.
- PARAMETERIZED: Multiple test cases with commandline_arg_*.txt and expected_case_*.txt file pairs. Each case runs independently with its arguments.
- PARAMETERIZED_HYBRID: Parameterized test cases that also use assertions. Each case must match expected output AND pass all assertions.
Hybrid tests are detected at runtime when a blackbox/parameterized test fails due to assertion failure (not output mismatch). Full compile-time detection of hybrid tests requires call-graph analysis (Phase C).
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionPure assertion-based test with no expected output files.Single expected_output.txt file, no command line arguments, no assertions.Single expected_output.txt file WITH assertions.Multiple test cases with commandline_arg_*.txt and expected_case_*.txt pairs.Parameterized test cases WITH assertions. -
Method Summary
Modifier and TypeMethodDescriptionDescriptive text for discovery output explaining the test type.booleanisHybrid()Check if this is a hybrid test (both output validation and assertions).Value for JSON and machine-readable output (lowercase with underscores).Short label for human-readable output in result lines.toHybrid()Get the hybrid variant of this test type.booleanCheck if this test type uses assertions.booleanCheck if this test type validates output against expected files.static TestTypeReturns the enum constant of this class with the specified name.static TestType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ASSERT
Pure assertion-based test with no expected output files. Uses assert, assertThrows, assertDoesNotThrow statements. -
BLACKBOX
Single expected_output.txt file, no command line arguments, no assertions. Validates program stdout against expected output only. -
BLACKBOX_HYBRID
Single expected_output.txt file WITH assertions. Both output validation and assertion checks must pass. -
PARAMETERIZED
Multiple test cases with commandline_arg_*.txt and expected_case_*.txt pairs. Each case is a separate test execution with specific arguments, no assertions. -
PARAMETERIZED_HYBRID
Parameterized test cases WITH assertions. Each case must match expected output AND pass all assertions.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
jsonValue
Value for JSON and machine-readable output (lowercase with underscores). Consistent across all formats: JSON, JUnit XML properties, etc. -
shortLabel
Short label for human-readable output in result lines. For parameterized tests, callers append case ID: "Param:caseid" -
description
Descriptive text for discovery output explaining the test type. -
validatesOutput
public boolean validatesOutput()Check if this test type validates output against expected files. -
usesAssertions
public boolean usesAssertions()Check if this test type uses assertions. -
isHybrid
public boolean isHybrid()Check if this is a hybrid test (both output validation and assertions). -
toHybrid
Get the hybrid variant of this test type. Returns self if already hybrid or if ASSERT (no hybrid variant).
-