Record Class DiscoveredTest

java.lang.Object
java.lang.Record
org.ek9lang.cli.DiscoveredTest
Record Components:
testProgram - The underlying test program
testType - Classification of the test validation mechanism
testCases - 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 Details

    • DiscoveredTest

      public DiscoveredTest(TestProgram testProgram, TestType testType, List<TestCase> testCases)
      Constructor for tests without configuration errors.
    • DiscoveredTest

      public DiscoveredTest(TestProgram testProgram, TestType testType, List<TestCase> testCases, String configurationError)
      Creates an instance of a DiscoveredTest record class.
      Parameters:
      testProgram - the value for the testProgram record component
      testType - the value for the testType record component
      testCases - the value for the testCases record component
      configurationError - the value for the configurationError record 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

      public String getFullyQualifiedName()
      Get the fully qualified name for display.
    • getName

      public String getName()
      Get the simple name for display.
    • groupName

      public String groupName()
      Get the group name (may be null).
    • hasGroup

      public boolean hasGroup()
      Check if this test has a group.
    • getModuleName

      public String getModuleName()
      Get the module name.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • testProgram

      public TestProgram testProgram()
      Returns the value of the testProgram record component.
      Returns:
      the value of the testProgram record component
    • testType

      public TestType testType()
      Returns the value of the testType record component.
      Returns:
      the value of the testType record component
    • testCases

      public List<TestCase> testCases()
      Returns the value of the testCases record component.
      Returns:
      the value of the testCases record component
    • configurationError

      public String configurationError()
      Returns the value of the configurationError record component.
      Returns:
      the value of the configurationError record component