Record Class TestCase
java.lang.Object
java.lang.Record
org.ek9lang.cli.TestCase
- Record Components:
testProgram- The test program this case belongs tocaseId- Case identifier (null for simple tests, "1", "edge", etc. for parameterized)arguments- Command line arguments (empty for no-arg tests)expectedOutputFile- Path to expected_output.txt or expected_case_{caseId}.txt
public record TestCase(TestProgram testProgram, String caseId, List<String> arguments, Path expectedOutputFile)
extends Record
Represents a single test case (possibly one of many for parameterized tests).
For simple tests with expected_output.txt, there is one TestCase with caseId=null. For parameterized tests with commandline_arg_*.txt files, there is one TestCase per case.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theargumentsrecord component.caseId()Returns the value of thecaseIdrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpectedOutputFilerecord component.(package private) StringGet the display name for this test case.final inthashCode()Returns a hash code value for this object.(package private) booleanCheck if this is a parameterized test case (has a case ID).Returns the value of thetestProgramrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TestCase
public TestCase(TestProgram testProgram, String caseId, List<String> arguments, Path expectedOutputFile) Creates an instance of aTestCaserecord class.- Parameters:
testProgram- the value for thetestProgramrecord componentcaseId- the value for thecaseIdrecord componentarguments- the value for theargumentsrecord componentexpectedOutputFile- the value for theexpectedOutputFilerecord component
-
-
Method Details
-
isParameterized
boolean isParameterized()Check if this is a parameterized test case (has a case ID). -
getDisplayName
String getDisplayName()Get the display name for this test case. For parameterized tests, includes the case ID. -
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
-
caseId
-
arguments
-
expectedOutputFile
Returns the value of theexpectedOutputFilerecord component.- Returns:
- the value of the
expectedOutputFilerecord component
-