Class SmartOracle
- java.lang.Object
-
- edu.odu.cs.zeil.codegrader.oracle.Oracle
-
- edu.odu.cs.zeil.codegrader.oracle.SmartOracle
-
public class SmartOracle extends Oracle
Compares expected and actual outputs to determine if they match.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.odu.cs.zeil.codegrader.oracle.Oracle
Oracle.ScoringOptions
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BEGIN_EXPECTED
static java.lang.String
BEGIN_OBSERVED
static java.lang.String
END_EXPECTED
static java.lang.String
END_OBSERVED
-
Fields inherited from class edu.odu.cs.zeil.codegrader.oracle.Oracle
PASSED_TEST_MESSAGE
-
-
Constructor Summary
Constructors Constructor Description SmartOracle(OracleProperties config, TestCase testCase, Submission submission, Stage submitterStage)
Create a new smart oracle.
-
Method Summary
All Methods Static 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.static java.lang.String
displayInContext(Token token, java.lang.String line, java.lang.String startMarker, java.lang.String endMarker)
Display a token within the line where it occurs.-
Methods inherited from class edu.odu.cs.zeil.codegrader.oracle.Oracle
getCap, getCommand, getIgnoreCase, getIgnoreEmptyLines, getIgnorePunctuation, getIgnoreWS, getNumbersOnly, getPattern, getPrecision, getScoring, getStage, getSubmission, getTestCase
-
-
-
-
Field Detail
-
BEGIN_EXPECTED
public static final java.lang.String BEGIN_EXPECTED
- See Also:
- Constant Field Values
-
END_EXPECTED
public static final java.lang.String END_EXPECTED
- See Also:
- Constant Field Values
-
BEGIN_OBSERVED
public static final java.lang.String BEGIN_OBSERVED
- See Also:
- Constant Field Values
-
END_OBSERVED
public static final java.lang.String END_OBSERVED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SmartOracle
public SmartOracle(OracleProperties config, TestCase testCase, Submission submission, Stage submitterStage)
Create a new smart oracle.- Parameters:
config
- configuration propertiestestCase
- the test case to which this oracle will applysubmission
- the submission being judgedsubmitterStage
- the stage where the submitted 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.
-
displayInContext
public static java.lang.String displayInContext(Token token, java.lang.String line, java.lang.String startMarker, java.lang.String endMarker)
Display a token within the line where it occurs.- Parameters:
token
- a tokenline
- the line in which it occursstartMarker
- string to display just before the changed tokenendMarker
- string to display just after the changed token- Returns:
- a string containing parts of the line before and after the token itself.
-
-