Record Class TestProgram

java.lang.Object
java.lang.Record
org.ek9lang.cli.TestProgram
Record Components:
programSymbol - The program's symbol containing metadata and location
groupName - Optional group name for sequential execution (null = parallel)
sourceDirectory - Directory containing the source .ek9 file (for expected_output.txt lookup)

public record TestProgram(AggregateSymbol programSymbol, String groupName, Path sourceDirectory) extends Record
Represents an EK9 program marked with @Test directive. Used by the test runner to discover and execute tests.
  • Constructor Details

    • TestProgram

      public TestProgram(AggregateSymbol programSymbol, String groupName, Path sourceDirectory)
      Creates an instance of a TestProgram record class.
      Parameters:
      programSymbol - the value for the programSymbol record component
      groupName - the value for the groupName record component
      sourceDirectory - the value for the sourceDirectory record component
  • Method Details

    • hasGroup

      boolean hasGroup()
      Check if this test belongs to a group for sequential execution.
    • getClassName

      String getClassName()
      Get the fully qualified class name for bytecode execution. EK9 generates classes with module path as package name.
    • getName

      String getName()
      Get the simple program name for display.
    • getFullyQualifiedName

      String getFullyQualifiedName()
      Get the fully qualified name including module.
    • getModuleName

      String getModuleName()
      Get the module name from the fully qualified name. Extracts everything before the last "::" separator.
    • getSourceFile

      String getSourceFile()
      Get the source file path where this test program is defined. Returns a relative or absolute path depending on how it was compiled.
      Returns:
      Source file path, or null if not available
    • getParameterCount

      int getParameterCount()
      Get the number of declared parameters for this program. Programs can have typed parameters (String, Integer, etc.) that are passed as command line arguments.
      Returns:
      Number of declared parameters (0 if no parameters)
    • 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.
    • programSymbol

      public AggregateSymbol programSymbol()
      Returns the value of the programSymbol record component.
      Returns:
      the value of the programSymbol record component
    • groupName

      public String groupName()
      Returns the value of the groupName record component.
      Returns:
      the value of the groupName record component
    • sourceDirectory

      public Path sourceDirectory()
      Returns the value of the sourceDirectory record component.
      Returns:
      the value of the sourceDirectory record component