Class ExternalOracle


  • public class ExternalOracle
    extends Oracle
    Oracle that works by running an external command.
    • Constructor Detail

      • ExternalOracle

        public ExternalOracle​(OracleProperties config,
                              TestCase testCase,
                              Submission sub,
                              Stage submitterStage)
        Create an oracle that launches an external command.
        Parameters:
        config - properties
        testCase - the test case on which it is applied
        sub - submission being evaluated
        submitterStage - 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.
        Specified by:
        compare in class Oracle
        Parameters:
        expected - the expected string
        actual - the string being examined
        Returns:
        true if actual is an acceptable variant of expected.
      • 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 output
        actual - file with actual output
        Returns:
        result of executing the oracle