Class ExternalOracle
- java.lang.Object
-
- edu.odu.cs.zeil.codegrader.oracle.Oracle
-
- edu.odu.cs.zeil.codegrader.oracle.ExternalOracle
-
public class ExternalOracle extends Oracle
Oracle that works by running an external command.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.odu.cs.zeil.codegrader.oracle.Oracle
Oracle.ScoringOptions
-
-
Field Summary
-
Fields inherited from class edu.odu.cs.zeil.codegrader.oracle.Oracle
PASSED_TEST_MESSAGE
-
-
Constructor Summary
Constructors Constructor Description ExternalOracle(OracleProperties config, TestCase testCase, Submission sub, Stage submitterStage)
Create an oracle that launches an external command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OracleResult
compare(java.lang.String expected, java.lang.String actual)
Compare two strings to see if one is an acceptable variant of the other.OracleResult
executeOracle(java.io.File expected, java.io.File actual)
Runs the test case using the code in submission.-
Methods inherited from class edu.odu.cs.zeil.codegrader.oracle.Oracle
getCap, getCommand, getIgnoreCase, getIgnoreEmptyLines, getIgnorePunctuation, getIgnoreWS, getNumbersOnly, getPattern, getPrecision, getScoring, getStage, getSubmission, getTestCase
-
-
-
-
Constructor Detail
-
ExternalOracle
public ExternalOracle(OracleProperties config, TestCase testCase, Submission sub, Stage submitterStage)
Create an oracle that launches an external command.- Parameters:
config
- propertiestestCase
- the test case on which it is appliedsub
- submission being evaluatedsubmitterStage
- stage where submitter code has been built
-
-
Method Detail
-
compare
public OracleResult compare(java.lang.String expected, java.lang.String actual)
Compare two strings to see if one is an acceptable variant of the other. The precise meaning of "acceptable" depends on the settings.
-
executeOracle
public OracleResult executeOracle(java.io.File expected, java.io.File actual)
Runs the test case using the code in submission. Standard out and standard err are captured and available as getOutput() and getErr(). The status code is also available.- Parameters:
expected
- file with expected outputactual
- file with actual output- Returns:
- result of executing the oracle
-
-