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>gradingThe grading criteria for this test case.java.lang.StringnameIdentifies this test case.java.util.List<java.lang.String>onFailWhat tags should be activated if this case fails (score < 100)java.util.List<java.lang.String>onSuccessWhat 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 intcompareTo(TestCaseProperties right)Compare two TC properties by name.booleanequals(java.lang.Object right)Compare by name.AssignmentgetAssignment()java.lang.StringgetDescription()java.lang.StringgetExpected()The expected output from the program.java.lang.StringgetFailIf()java.lang.Iterable<OracleProperties>getGradingOptions()Permits iteration over the grading options specified for this test case.java.lang.StringgetIn()The standard input for the program.java.lang.StringgetKind()java.lang.StringgetLaunch()java.lang.StringgetParams()java.nio.file.PathgetRecordingDirectory()java.nio.file.PathgetStagingDirectory()java.nio.file.PathgetTestCaseDirectory()java.nio.file.PathgetTestSuiteDirectory()intgetTimelimit()intgetWeight()inthashCode()Hash code of name.booleanisMultiplier()booleanisStatus()booleanisStderr()voidsetDescription(java.lang.String theDescription)voidsetExpected(java.lang.String theExpected)voidsetFailIf(java.lang.String theFailIf)voidsetIn(java.lang.String theInput)voidsetKind(java.lang.String theKind)voidsetLaunch(java.lang.String theLaunch)voidsetParams(java.lang.String theParams)voidsetStatus(boolean theStatus)voidsetStderr(boolean theStderr)voidsetTimelimit(int theTimelimit)voidsetWeight(int theWeight)java.lang.StringtoString()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:
toStringin 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:
compareToin 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:
equalsin 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:
hashCodein 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
-
-