Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the current JUnit version in the README #44

Merged
merged 1 commit into from
May 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Dodona JUnit Judge

This is a judging system for Dodona, to judge Java exercises using the JUnit testing framework.
This is a judging system for Dodona, to judge Java exercises using the JUnit 4 testing framework.

## Preparing exercises

Expand Down Expand Up @@ -48,7 +48,7 @@ When running the judge, the code is compiled in the order given below. This mean
- The judge is compiled.
- The code in `evaluation` is compiled. This directory should contain the JUnit tests. It can also contain other classes and jar-files which will be included in the class path.

After compilation, the judge is executed. It will assume the presence of a `TestSuite` class, containing a JUnit testsuite, which it will run. While the source file for `TestSuite` can be anywhere, I'd advise `evaluation/TestSuite.java`.
After compilation, the judge is executed. It will assume the presence of a `TestSuite` class, containing a JUnit 4 testsuite, which it will run. While the source file for `TestSuite` can be anywhere, I'd advise `evaluation/TestSuite.java`.

### Good practices

Expand All @@ -66,7 +66,7 @@ While above description leaves a lot of interpretation, here is how a new exerci

### Test files

As mentioned, test files can be pure JUnit test files, including all features in the latest JUnit (I especially recommend Parameterized). Some extras are available though:
As mentioned, test files can be pure JUnit test files, including all features in JUnit 4 (I especially recommend Parameterized). Some extras are available though:

- By importing `dodona.junit.TabTitle` in your exercise, you can set the title of the tab in dodona for this test (each test in TestSuite will produce on tab). Just add the `@TabTitle("Some Title")` annotation to your test class.
- By importing `dodona.junit.TabTitle` in your exercise, you can set the title of the tab in dodona for this test (each test in TestSuite will produce one tab). Just add the `@TabTitle("Some Title")` annotation to your test class.
- `dodona.junit.MessageWriter` is a JUnit test rule. By using `@Rule public MessageWriter out = new MessageWriter();` in your test class, you can write to `out` as if it were `System.out` (it's actually a `PrintWriter`, not a `PrintStream`, but they share most methods). Whatever you write to it in a test will be visible to the students if that test fails. Useful for e.g. printing the input matrices to a matrix multiplication exercise test, along with the expected and generated outputs.