Record Class DiscoveredTest
java.lang.Object
java.lang.Record
org.ek9lang.cli.DiscoveredTest
- Record Components:
testProgram- The underlying test programtestType- Classification of the test validation mechanismtestCases- List of test cases (empty for assert-based, single for simple blackbox)configurationError- Error message if test is misconfigured (null if OK)
public record DiscoveredTest(TestProgram testProgram, TestType testType, List<TestCase> testCases, String configurationError)
extends Record
Metadata about a discovered @Test program including its validation type.
This record captures the full picture of a test for reporting purposes:
- The underlying test program (symbol, group, source directory)
- The test type (assert-based, simple blackbox, parameterized)
- For parameterized tests: the discovered test cases
- Configuration errors that prevent proper execution
This information enables formatters to clearly communicate the nature of each test to humans, AI systems, and CI/CD pipelines.
-
Constructor Summary
ConstructorsConstructorDescriptionDiscoveredTest(TestProgram testProgram, TestType testType, List<TestCase> testCases) Constructor for tests without configuration errors.DiscoveredTest(TestProgram testProgram, TestType testType, List<TestCase> testCases, String configurationError) Creates an instance of aDiscoveredTestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintNumber of test cases that will be executed.Returns the value of theconfigurationErrorrecord component.final booleanIndicates whether some other object is "equal to" this one.Get the fully qualified name for display.Get the module name.getName()Get the simple name for display.Get the group name (may be null).booleanCheck if this test has a configuration error that prevents execution.booleanhasGroup()Check if this test has a group.final inthashCode()Returns a hash code value for this object.Returns the value of thetestCasesrecord component.Returns the value of thetestProgramrecord component.testType()Returns the value of thetestTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DiscoveredTest
Constructor for tests without configuration errors. -
DiscoveredTest
public DiscoveredTest(TestProgram testProgram, TestType testType, List<TestCase> testCases, String configurationError) Creates an instance of aDiscoveredTestrecord class.- Parameters:
testProgram- the value for thetestProgramrecord componenttestType- the value for thetestTyperecord componenttestCases- the value for thetestCasesrecord componentconfigurationError- the value for theconfigurationErrorrecord component
-
-
Method Details
-
hasConfigurationError
public boolean hasConfigurationError()Check if this test has a configuration error that prevents execution. -
caseCount
public int caseCount()Number of test cases that will be executed. For assert-based tests, this is 1 (the program itself). For simple blackbox, this is 1. For parameterized, this is the number of commandline_arg_*.txt files. -
getFullyQualifiedName
Get the fully qualified name for display. -
getName
Get the simple name for display. -
groupName
Get the group name (may be null). -
hasGroup
public boolean hasGroup()Check if this test has a group. -
getModuleName
Get the module name. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
testProgram
Returns the value of thetestProgramrecord component.- Returns:
- the value of the
testProgramrecord component
-
testType
-
testCases
-
configurationError
Returns the value of theconfigurationErrorrecord component.- Returns:
- the value of the
configurationErrorrecord component
-