Package edu.odu.cs.zeil.codegrader
Class TestCasePropertiesBase
- java.lang.Object
-
- edu.odu.cs.zeil.codegrader.TestCasePropertiesBase
-
public class TestCasePropertiesBase extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Optional<java.lang.String>descriptionDescription of this test case (for display in student's grade report)java.util.Optional<java.lang.String>expectedA string containing expected output when the program under evaluation is run.java.util.Optional<java.lang.String>failIfIf this tag is active, then this case should fail, unrun, with score of zero.java.util.Optional<java.util.List<OracleProperties>>gradingThe grading criteria for this test case.java.util.Optional<java.lang.String>kindA tag name used to determine when (if ever) a test case should be performed.java.util.Optional<java.lang.String>launchThe command string used to launch the program under evaluation.java.util.Optional<java.lang.Boolean>multiplierIs this test a multiplier for the overall score?java.util.Optional<java.util.List<java.lang.String>>onFailWhat tags should be activated if this case fails (score < 100)java.util.Optional<java.util.List<java.lang.String>>onSuccessWhat tags should be activated if this case succeeds (score == 100)java.util.Optional<java.lang.String>paramsThe command line parameters to be supplies when executing the program under evaluation.java.util.Optional<java.lang.Boolean>statusShould the status code be checked for evidence that a program has crashed? Defaults to false because students aren't likely to be all that careful about returning status codes.java.util.Optional<java.lang.Boolean>stderrShould the standard error stream be captures and included in the program output being evaluated?java.util.OptionalInttimelimitHow many seconds to allow a test execution to run before concluding that the program is hanging, caught in an infinite loop, or simply unacceptably slow.java.util.OptionalIntweightHow many points this test case is worth?
-
Constructor Summary
Constructors Constructor Description TestCasePropertiesBase()Create an empty properties set.TestCasePropertiesBase(java.nio.file.Path testCaseDirectory)Load property values that are stored in explicit files, e.g., file anything.params can contain values for the "params" property.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object right)Compare by name.inthashCode()Hash code of name.static TestCasePropertiesBaseloadYAML(java.io.File input)Load properties from a File.static TestCasePropertiesBaseloadYAML(java.lang.String input)Load properties from a string.java.lang.StringtoString()Render as a string (YAML).
-
-
-
Field Detail
-
kind
public java.util.Optional<java.lang.String> kind
A tag name used to determine when (if ever) a test case should be performed. Default is "test". A test suite begins by activating all cases of kind "build".
-
params
public java.util.Optional<java.lang.String> params
The command line parameters to be supplies when executing the program under evaluation.
-
weight
public java.util.OptionalInt weight
How many points this test case is worth?
-
multiplier
public java.util.Optional<java.lang.Boolean> multiplier
Is this test a multiplier for the overall score?
-
launch
public java.util.Optional<java.lang.String> launch
The command string used to launch the program under evaluation.
-
expected
public java.util.Optional<java.lang.String> expected
A string containing expected output when the program under evaluation is run.
-
timelimit
public java.util.OptionalInt timelimit
How many seconds to allow a test execution to run before concluding that the program is hanging, caught in an infinite loop, or simply unacceptably slow.
-
stderr
public java.util.Optional<java.lang.Boolean> stderr
Should the standard error stream be captures and included in the program output being evaluated?
-
status
public java.util.Optional<java.lang.Boolean> status
Should the status code be checked for evidence that a program has crashed? Defaults to false because students aren't likely to be all that careful about returning status codes.
-
grading
public java.util.Optional<java.util.List<OracleProperties>> grading
The grading criteria for this test case.
-
description
public java.util.Optional<java.lang.String> description
Description of this test case (for display in student's grade report)
-
onFail
public java.util.Optional<java.util.List<java.lang.String>> onFail
What tags should be activated if this case fails (score < 100)
-
onSuccess
public java.util.Optional<java.util.List<java.lang.String>> onSuccess
What tags should be activated if this case succeeds (score == 100)
-
failIf
public java.util.Optional<java.lang.String> failIf
If this tag is active, then this case should fail, unrun, with score of zero.
-
-
Constructor Detail
-
TestCasePropertiesBase
public TestCasePropertiesBase()
Create an empty properties set.
-
TestCasePropertiesBase
public TestCasePropertiesBase(java.nio.file.Path testCaseDirectory)
Load property values that are stored in explicit files, e.g., file anything.params can contain values for the "params" property.- Parameters:
testCaseDirectory- directory containing configuration info for this test case
-
-
Method Detail
-
loadYAML
public static TestCasePropertiesBase loadYAML(java.lang.String input) throws TestConfigurationError
Load properties from a string.- Parameters:
input- properties in YAML- Returns:
- the properties
- Throws:
TestConfigurationError- if input cannot be parsed
-
loadYAML
public static TestCasePropertiesBase loadYAML(java.io.File input) throws TestConfigurationError
Load properties from a File.- Parameters:
input- file containing properties in YAML- Returns:
- the properties
- Throws:
TestConfigurationError- if input cannot be parsed
-
toString
public java.lang.String toString()
Render as a string (YAML).- Overrides:
toStringin classjava.lang.Object
-
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
-
-