Package edu.odu.cs.zeil.codegrader
Class TestCaseProperties
- java.lang.Object
-
- edu.odu.cs.zeil.codegrader.TestCaseProperties
-
- All Implemented Interfaces:
java.lang.Comparable<TestCaseProperties>
public class TestCaseProperties extends java.lang.Object implements java.lang.Comparable<TestCaseProperties>
-
-
Field Summary
Fields Modifier and Type Field Description java.util.List<OracleProperties>
grading
The grading criteria for this test case.java.lang.String
name
Identifies this test case.java.util.List<java.lang.String>
onFail
What tags should be activated if this case fails (score < 100)java.util.List<java.lang.String>
onSuccess
What tags should be activated if this case succeeds (score == 100)
-
Constructor Summary
Constructors Constructor Description TestCaseProperties()
Create an empty properties set.TestCaseProperties(Assignment asst, java.lang.String testName)
Create a test case directory based upon information in testDirectory and in the assignment directory above it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(TestCaseProperties right)
Compare two TC properties by name.boolean
equals(java.lang.Object right)
Compare by name.Assignment
getAssignment()
java.lang.String
getDescription()
java.lang.String
getExpected()
The expected output from the program.java.lang.String
getFailIf()
java.lang.Iterable<OracleProperties>
getGradingOptions()
Permits iteration over the grading options specified for this test case.java.lang.String
getIn()
The standard input for the program.java.lang.String
getKind()
java.lang.String
getLaunch()
java.lang.String
getParams()
java.nio.file.Path
getRecordingDirectory()
java.nio.file.Path
getStagingDirectory()
java.nio.file.Path
getTestCaseDirectory()
java.nio.file.Path
getTestSuiteDirectory()
int
getTimelimit()
int
getWeight()
int
hashCode()
Hash code of name.boolean
isMultiplier()
boolean
isStatus()
boolean
isStderr()
void
setDescription(java.lang.String theDescription)
void
setExpected(java.lang.String theExpected)
void
setFailIf(java.lang.String theFailIf)
void
setIn(java.lang.String theInput)
void
setKind(java.lang.String theKind)
void
setLaunch(java.lang.String theLaunch)
void
setParams(java.lang.String theParams)
void
setStatus(boolean theStatus)
void
setStderr(boolean theStderr)
void
setTimelimit(int theTimelimit)
void
setWeight(int theWeight)
java.lang.String
toString()
Render as a string (YAML).
-
-
-
Field Detail
-
name
public java.lang.String name
Identifies this test case.
-
grading
public java.util.List<OracleProperties> grading
The grading criteria for this test case.
-
onFail
public java.util.List<java.lang.String> onFail
What tags should be activated if this case fails (score < 100)
-
onSuccess
public java.util.List<java.lang.String> onSuccess
What tags should be activated if this case succeeds (score == 100)
-
-
Constructor Detail
-
TestCaseProperties
public TestCaseProperties(Assignment asst, java.lang.String testName) throws TestConfigurationError
Create a test case directory based upon information in testDirectory and in the assignment directory above it.- Parameters:
asst
- an assignmenttestName
- name of this test case. Must match a subdirectory of the test suite.- Throws:
FileNotFoundException
- if the assignment's test suite directory does not exist or does not contain a subdirectory matching testNameTestConfigurationError
-
TestCaseProperties
public TestCaseProperties()
Create an empty properties set.
-
-
Method Detail
-
toString
public java.lang.String toString()
Render as a string (YAML).- Overrides:
toString
in classjava.lang.Object
-
getExpected
public java.lang.String getExpected()
The expected output from the program.- Returns:
- the expected output
-
getIn
public java.lang.String getIn()
The standard input for the program.- Returns:
- the input path
-
getParams
public java.lang.String getParams()
- Returns:
- command line parameters for running the test case.
-
getTestCaseDirectory
public java.nio.file.Path getTestCaseDirectory()
- Returns:
- the location of the test case information
-
getStagingDirectory
public java.nio.file.Path getStagingDirectory()
- Returns:
- Directory in which a submission will be compiled and tested.
-
getRecordingDirectory
public java.nio.file.Path getRecordingDirectory()
- Returns:
- Where to place information about the points earned for passing tests.
-
getTestSuiteDirectory
public java.nio.file.Path getTestSuiteDirectory()
- Returns:
- Collection of all test cases.
-
getGradingOptions
public java.lang.Iterable<OracleProperties> getGradingOptions()
Permits iteration over the grading options specified for this test case.- Returns:
- iterable over OracleProperties
-
getAssignment
public Assignment getAssignment()
- Returns:
- the assignment settings
-
compareTo
public int compareTo(TestCaseProperties right)
Compare two TC properties by name.- Specified by:
compareTo
in interfacejava.lang.Comparable<TestCaseProperties>
- Parameters:
right
- another TC properties- Returns:
- ordering of the names
-
equals
public boolean equals(java.lang.Object right)
Compare by name.- Overrides:
equals
in classjava.lang.Object
- Parameters:
right
- another test cast property collection- Returns:
- true if the names match
-
hashCode
public int hashCode()
Hash code of name.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hash code
-
getKind
public java.lang.String getKind()
- Returns:
- the kind
-
setKind
public void setKind(java.lang.String theKind)
- Parameters:
theKind
- the kind to set
-
setParams
public void setParams(java.lang.String theParams)
- Parameters:
theParams
- the params to set
-
getWeight
public int getWeight()
- Returns:
- the weight
-
isMultiplier
public boolean isMultiplier()
- Returns:
- true if is a multiplier
-
setWeight
public void setWeight(int theWeight)
- Parameters:
theWeight
- the weight to set
-
getLaunch
public java.lang.String getLaunch()
- Returns:
- the launch
-
setLaunch
public void setLaunch(java.lang.String theLaunch)
- Parameters:
theLaunch
- the launch to set
-
setExpected
public void setExpected(java.lang.String theExpected)
- Parameters:
theExpected
- the expected to set
-
setIn
public void setIn(java.lang.String theInput)
- Parameters:
theInput
- the input to set
-
getTimelimit
public int getTimelimit()
- Returns:
- the timelimit
-
setTimelimit
public void setTimelimit(int theTimelimit)
- Parameters:
theTimelimit
- the timelimit to set
-
isStderr
public boolean isStderr()
- Returns:
- the stderr
-
setStderr
public void setStderr(boolean theStderr)
- Parameters:
theStderr
- the stderr to set
-
isStatus
public boolean isStatus()
- Returns:
- the status
-
setStatus
public void setStatus(boolean theStatus)
- Parameters:
theStatus
- the status to set
-
getDescription
public java.lang.String getDescription()
- Returns:
- the description
-
setDescription
public void setDescription(java.lang.String theDescription)
- Parameters:
theDescription
- the description to set
-
getFailIf
public java.lang.String getFailIf()
- Returns:
- the failIf
-
setFailIf
public void setFailIf(java.lang.String theFailIf)
- Parameters:
theFailIf
- the failIf to set
-
-