Class JUnit5Oracle


  • public class JUnit5Oracle
    extends Oracle
    An oracle that ignores the expected string and scans the observed string for a JUnit 5 report, as generated by running junit-platform-console-*.jar. E.g.,
     Test run finished after 64 ms
     [         3 containers found      ]
     [         0 containers skipped    ]
     [         3 containers started    ]
     [         0 containers aborted    ]
     [         3 containers successful ]
     [         0 containers failed     ]
     [        10 tests found           ]
     [         0 tests skipped         ]
     [        10 tests started         ]
     [         0 tests aborted         ]
     [         6 tests successful      ]
     [         4 tests failed          ]
     
    The score is the ratio of successful tests to started tests.
    • Constructor Detail

      • JUnit5Oracle

        public JUnit5Oracle​(OracleProperties config,
                            TestCase testCase,
                            Submission submission,
                            Stage submitterStage)
        Create a new oracle.
        Parameters:
        config - configuration properties
        testCase - the test case to which this oracle will apply
        submission - the submission being judged
        submitterStage - 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.
        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.