Record Class TestProgram
java.lang.Object
java.lang.Record
org.ek9lang.cli.TestProgram
- Record Components:
programSymbol- The program's symbol containing metadata and locationgroupName- 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 Summary
ConstructorsConstructorDescriptionTestProgram(AggregateSymbol programSymbol, String groupName, Path sourceDirectory) Creates an instance of aTestProgramrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.(package private) StringGet the fully qualified class name for bytecode execution.(package private) StringGet the fully qualified name including module.(package private) StringGet the module name from the fully qualified name.(package private) StringgetName()Get the simple program name for display.(package private) intGet the number of declared parameters for this program.(package private) StringGet the source file path where this test program is defined.Returns the value of thegroupNamerecord component.(package private) booleanhasGroup()Check if this test belongs to a group for sequential execution.final inthashCode()Returns a hash code value for this object.Returns the value of theprogramSymbolrecord component.Returns the value of thesourceDirectoryrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TestProgram
Creates an instance of aTestProgramrecord class.- Parameters:
programSymbol- the value for theprogramSymbolrecord componentgroupName- the value for thegroupNamerecord componentsourceDirectory- the value for thesourceDirectoryrecord 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
-
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). -
programSymbol
Returns the value of theprogramSymbolrecord component.- Returns:
- the value of the
programSymbolrecord component
-
groupName
-
sourceDirectory
Returns the value of thesourceDirectoryrecord component.- Returns:
- the value of the
sourceDirectoryrecord component
-