Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2f024d2
Fix makefile, add verbose option to integration tests
rien Jan 28, 2026
36b8766
Remove code used for i18n
rien Jan 28, 2026
5c3605b
Un-i18n correct test
rien Jan 28, 2026
8abb149
Un-i18n tests
rien Jan 28, 2026
1cfeb11
Properly escape quotation marks
rien Jan 29, 2026
f98cce7
Remove validate.sh, but describe integration-tests in README
rien Jan 29, 2026
0020abc
Directly set err_out, fix bug with accepted/failed
rien Jan 30, 2026
07e7075
Merge pull request #63 from dodona-edu/feature/remove-i18n
rien Jan 30, 2026
e960ee2
Remove the exit functionality, securitymanager is deprecated
rien Jan 29, 2026
2ed3fb5
Add a test for the MessageWriter
rien Jan 29, 2026
16052d1
Migrate to JUnit 6, now only by supporting JUnit 4 tests
rien Jan 30, 2026
8767ee9
Store integration-test restults with judge migration
rien Jan 30, 2026
5ea8e5f
Move junit 4 integration tests to subdirectory
rien Jan 30, 2026
4905f26
Copy tests results to ensure their output does not differ
rien Jan 30, 2026
6d357db
Remove interactive functionality, it is not needed anymore
rien Jan 30, 2026
25ce844
Support JUnit 6 usage of MessageWriter
rien Jan 30, 2026
766a391
Convert junit 4 integration tests to junit 6
rien Jan 30, 2026
87a0e56
Add mixed junit 4 & 6 integration test, add junit 6 example
rien Feb 3, 2026
534e0e0
Migrate examples to Junit 6
rien Feb 4, 2026
cb553b4
Fix deprecation warnings and errors, prepare for java 25
rien Feb 4, 2026
19e7860
Update with-package test to actual behavior: package should be stripped
rien Feb 4, 2026
afc4368
Merge pull request #64 from dodona-edu/feature/junit6-retry
rien Feb 4, 2026
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: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,11 @@ Since the tests are mostly just jUnit tests, IntelliJ and other IDE's provide su
Per exercise, create a new project. The `config.json` file should be in the project root. Mark (or create) the `workdir`, `evaluation` and `solution` directories as "sources root". Add jUnit 4 as a dependency of the project.

If your exercises use some Dodona-specific features, such as the `TabTitle` or the `AssertionStubber`, add the Judge as a dependency. Opening this repository as an IntelliJ project should allow you to create a JAR.

## Developing the judge

While developing, you can use `./integration-tests/run` to validate whether the judge is working properly. It checks the judge's output JSON against previous results (stored as `result.json`) and monitors whether something has changed.

You can also use `./integration-tests/run <path-to-repo>` to run the same checks on an exercise repository, which is useful to validate a larger set op exercises.

With `---overwrite`, you can overwrite previous `result.json` files with the current output, and with `-v` you can check for judge error output and view the exact changes when output differs.
8 changes: 4 additions & 4 deletions examples/diffing-testwriter/evaluation/TestSuite.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import org.junit.runners.Suite;
import org.junit.runner.RunWith;
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({
@Suite
@SelectClasses({
TestWriterTest.class,
})
public class TestSuite {}
9 changes: 5 additions & 4 deletions examples/diffing-testwriter/evaluation/TestWriterTest.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import org.junit.Assert;
import org.junit.Test;
import org.junit.Before;


import dodona.reflection.AssertionStubber;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class TestWriterTest {

private static dodona.junit.TestWriter testWriter = new dodona.junit.TestWriter();

private TestWriterInterface solution;

@Before public void initialize() {
@BeforeEach
public void initialize() {
solution = new AssertionStubber().stub(TestWriterInterface.class, TestWriter.class);
}

Expand Down
12 changes: 0 additions & 12 deletions examples/i18n/config.json

This file was deleted.

1 change: 0 additions & 1 deletion examples/i18n/description/description.en.md

This file was deleted.

1 change: 0 additions & 1 deletion examples/i18n/description/description.nl.md

This file was deleted.

9 changes: 0 additions & 9 deletions examples/i18n/evaluation/TestSuite.java

This file was deleted.

22 changes: 0 additions & 22 deletions examples/i18n/evaluation/TranslatedTest.java

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions examples/interactive/config.json

This file was deleted.

1 change: 0 additions & 1 deletion examples/interactive/description/description.en.md

This file was deleted.

1 change: 0 additions & 1 deletion examples/interactive/description/description.nl.md

This file was deleted.

23 changes: 0 additions & 23 deletions examples/interactive/evaluation/EchoTest.java

This file was deleted.

12 changes: 0 additions & 12 deletions examples/interactive/solution/Echo.java

This file was deleted.

34 changes: 18 additions & 16 deletions examples/simple/evaluation/GeneratedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,35 @@
import java.util.List;
import java.util.ArrayList;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import dodona.junit.TabTitle;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.Parameter;
import org.junit.jupiter.params.ParameterizedClass;
import org.junit.jupiter.params.provider.MethodSource;

/**
* A more complex test class.
*
* Runs a larger number of generated tests.
*/
@RunWith(Parameterized.class)
@TabTitle("Random Tests") // Giving a name other than 'Test' to the tab in Dodona.
@DisplayName("Random Tests") // Giving a name other than 'Test' to the tab in Dodona.
@ParameterizedClass
@MethodSource("data")
public class GeneratedTest {

public static final int TEST_COUNT = 50;
public static final int TEST_COUNT = 2;
public static final long SEED = 42; // Fixed random seed to get the same tests for every student.
public static final int TEST_MAX = 10000;
public static final int TEST_MAX = 100;


@Parameter(0)
int testNumber;
@Parameter(1)
int expected;

/** This method generates a number of tests. */

@Parameterized.Parameters(name = "{index} | addOne({0}) == {1}")
public static Iterable<Object[]> data() {
List<Object[]> data = new ArrayList<>();
Random random = new Random(SEED);
Expand All @@ -35,16 +41,12 @@ public static Iterable<Object[]> data() {
return data;
}

/* Each test, in order, is filled in here and run. */
@Parameterized.Parameter(value=0) public int testNumber;
@Parameterized.Parameter(value=1) public int expected;

private static SimpleInterface studentSolution;

@Test
public void test() {
if(studentSolution == null) studentSolution = new Simple();
Assert.assertEquals(expected, studentSolution.addOne(testNumber));
Assertions.assertEquals(expected, studentSolution.addOne(testNumber));
}

}
8 changes: 4 additions & 4 deletions examples/simple/evaluation/SimpleTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class SimpleTest {

Expand All @@ -8,13 +8,13 @@ public class SimpleTest {
@Test
public void testZero() {
if(solution == null) solution = new Simple();
Assert.assertEquals(1, solution.addOne(0));
Assertions.assertEquals(1, solution.addOne(0));
}

@Test
public void testOne() {
if(solution == null) solution = new Simple();
Assert.assertEquals(2, solution.addOne(1));
Assertions.assertEquals(2, solution.addOne(1));
}

}
8 changes: 4 additions & 4 deletions examples/simple/evaluation/TestSuite.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import org.junit.runners.Suite;
import org.junit.runner.RunWith;
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({
@Suite
@SelectClasses({
// List of tests to run.
SimpleTest.class,
GeneratedTest.class,
Expand Down
13 changes: 8 additions & 5 deletions examples/stubber/evaluation/StubberTest.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import org.junit.Assert;
import org.junit.Test;
import org.junit.Before;


import dodona.reflection.AssertionStubber;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class StubberTest {

private StubberInterface solution;

@Before public void initialize() {
@BeforeEach
public void initialize() {
solution = new AssertionStubber().stub(StubberInterface.class, Stubber.class);
}

@Test
public void test() {
Assert.assertTrue(solution.isStubbed());
Assertions.assertTrue(solution.isStubbed());
}

}
8 changes: 4 additions & 4 deletions examples/stubber/evaluation/TestSuite.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import org.junit.runners.Suite;
import org.junit.runner.RunWith;
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({
@Suite
@SelectClasses({
StubberTest.class,
})
public class TestSuite {}
12 changes: 0 additions & 12 deletions examples/system-exit/config.json

This file was deleted.

1 change: 0 additions & 1 deletion examples/system-exit/description/description.en.md

This file was deleted.

1 change: 0 additions & 1 deletion examples/system-exit/description/description.nl.md

This file was deleted.

28 changes: 0 additions & 28 deletions examples/system-exit/evaluation/Interference.java

This file was deleted.

11 changes: 0 additions & 11 deletions examples/system-exit/evaluation/TestSuite.java

This file was deleted.

21 changes: 0 additions & 21 deletions examples/system-exit/evaluation/Unaware.java

This file was deleted.

Loading