JUnit Jupiter
JUnit is the teacher. It decides what a question is, puts it to the pupil, and says whether the answer was right.
Ares does not replace it. Ares is the checklist the teacher works alongside: JUnit still owns the question and when it is asked, and Ares decides whether that desk may be visited at all, and what the pupil may do while answering.
What it is
JUnit Jupiter is the programming and extension model of JUnit 5. A test is a method
annotated @Test; the Jupiter engine discovers it, runs it and reports the outcome.
What matters for Ares is the extension model. Jupiter lets a library hook into the lifecycle of a test rather than wrapping it by hand: an extension can run before a test is executed, decide that a test should not be executed at all, or supply a parameter to the test method.
How Ares 2 uses it
The api/jupiter package is the integration layer.
@Publicand@Hiddenmark whether a test gives immediate feedback or waits for the deadline.@PublicTestand@HiddenTestare the combined forms that carry@Testas well.- The deadline check runs before a hidden test executes, so a hidden test that is not yet due never runs, rather than running and having its result suppressed. That is the whole point: a test that runs can leak through a file or a static field.
@Policyselects and configures the security policy, but does not activate anything on its own. The sandbox runs only when an Ares test annotation (@Public,@Hidden,@PublicTest,@HiddenTest) has registered the extensions, so a plain JUnit@Testcarrying only@Policyruns unsupervised.- Parameter resolution supplies
IOTesterto a test that declares it, which is how console interaction is tested without the test touchingSystem.indirectly.
Ares ships a jqwik integration for property-based tests too; see Jqwik.
Further reading
- JUnit 5 User Guide — JUnit team
- junit-team/junit-framework — source repository
- A Guide to JUnit 5 — Baeldung
- The Java Tutorials — Oracle
- Java Tutorial — W3Schools