From 8ecb359b9d8ad0e1215c66ac813e812889ad5a26 Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Wed, 17 Dec 2025 15:40:51 +0100 Subject: [PATCH 01/16] bump com.google.guava:guava from 33.4.8-jre to 33.5.0-jre --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index fb18e63..78deb80 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ useLocalRepo=false showTestOutput=false version=7.9.0-SNAPSHOT -guava_version = 33.4.8-jre +guava_version = 33.5.0-jre javax_inject_version = 1 slf4j_version = 1.7.10 hamcrest_version = 1.3 From 29bd2b48791489dcee5029d05a01069e0ba9ea65 Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Wed, 17 Dec 2025 15:45:43 +0100 Subject: [PATCH 02/16] bump commons-io:commons-io from 2.19.0 to 2.21.0 --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 78deb80..e8d4ea2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,6 @@ junit_version = 4.13.1 groovy_version = 4.0.2 logback_version = 1.5.18 jline_version = 2.12 -commons_io_version = 2.19.0 commons_cli_version = 1.9.0 -spotbugs_annotation_version = 4.7.3 \ No newline at end of file +spotbugs_annotation_version = 4.7.3 +commons_io_version = 2.21.0 \ No newline at end of file From 09d9e7f2e84d3b108a3eac0a551e329b7dda109f Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Wed, 17 Dec 2025 17:08:02 +0100 Subject: [PATCH 03/16] bump commons-cli:commons-cli from 1.9.0 to 1.11.0 --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index e8d4ea2..a20180a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,6 @@ junit_version = 4.13.1 groovy_version = 4.0.2 logback_version = 1.5.18 jline_version = 2.12 -commons_cli_version = 1.9.0 spotbugs_annotation_version = 4.7.3 -commons_io_version = 2.21.0 \ No newline at end of file +commons_io_version = 2.21.0 +commons_cli_version = 1.11.0 \ No newline at end of file From c24a05095cd393e90cc710813494ea62899752a0 Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Wed, 17 Dec 2025 17:08:51 +0100 Subject: [PATCH 04/16] bump com.github.spotbugs:spotbugs-annotations from 4.7.3 to 4.9.8 --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index a20180a..fc9712d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,6 @@ junit_version = 4.13.1 groovy_version = 4.0.2 logback_version = 1.5.18 jline_version = 2.12 -spotbugs_annotation_version = 4.7.3 commons_io_version = 2.21.0 -commons_cli_version = 1.11.0 \ No newline at end of file +commons_cli_version = 1.11.0 +spotbugs_annotation_version = 4.9.8 \ No newline at end of file From 836500cc305cad24a81de327648e146570a7912b Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Wed, 17 Dec 2025 17:13:54 +0100 Subject: [PATCH 05/16] bump ch.qos.logback:logback-classic and ch.qos.logback:logback-core from 1.5.18 to 1.5.22 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index fc9712d..59b65d9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ slf4j_version = 1.7.10 hamcrest_version = 1.3 junit_version = 4.13.1 groovy_version = 4.0.2 -logback_version = 1.5.18 +logback_version = 1.5.22 jline_version = 2.12 commons_io_version = 2.21.0 commons_cli_version = 1.11.0 From b66e74634bcb55d0e713928cf8449da416833c1b Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Wed, 17 Dec 2025 17:16:16 +0100 Subject: [PATCH 06/16] bump org.hamcrest:hamcrest from 1.3 to 3.0 --- gradle.properties | 2 +- se-commons-groovy/build.gradle | 3 +-- se-commons-utilities/build.gradle | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 59b65d9..31eddc9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ version=7.9.0-SNAPSHOT guava_version = 33.5.0-jre javax_inject_version = 1 slf4j_version = 1.7.10 -hamcrest_version = 1.3 +hamcrest_version = 3.0 junit_version = 4.13.1 groovy_version = 4.0.2 logback_version = 1.5.22 diff --git a/se-commons-groovy/build.gradle b/se-commons-groovy/build.gradle index 6e31e27..9af29bf 100644 --- a/se-commons-groovy/build.gradle +++ b/se-commons-groovy/build.gradle @@ -13,8 +13,7 @@ dependencies { implementation "jline:jline:$jline_version" implementation "com.google.guava:guava:$guava_version" implementation "org.apache.groovy:groovy:$groovy_version" - testImplementation "org.hamcrest:hamcrest-core:$hamcrest_version" - testImplementation "org.hamcrest:hamcrest-library:$hamcrest_version" + testImplementation "org.hamcrest:hamcrest:$hamcrest_version" testImplementation "junit:junit:$junit_version" } diff --git a/se-commons-utilities/build.gradle b/se-commons-utilities/build.gradle index 5fb504d..7e1fd90 100644 --- a/se-commons-utilities/build.gradle +++ b/se-commons-utilities/build.gradle @@ -9,8 +9,7 @@ dependencies { implementation "javax.inject:javax.inject:$javax_inject_version" implementation "commons-cli:commons-cli:$commons_cli_version" implementation "com.github.spotbugs:spotbugs-annotations:$spotbugs_annotation_version" - testImplementation "org.hamcrest:hamcrest-core:$hamcrest_version" - testImplementation "org.hamcrest:hamcrest-library:$hamcrest_version" + testImplementation "org.hamcrest:hamcrest:$hamcrest_version" testImplementation "junit:junit:$junit_version" } From 5d8a339b82be102918e22cc8d7b94f488557808d Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Thu, 18 Dec 2025 11:45:37 +0100 Subject: [PATCH 07/16] bump org.junit.*:* from 4.13.1 to 5.14.1 --- build.gradle | 2 +- gradle.properties | 3 +- se-commons-gradle/build.gradle | 7 ++- se-commons-groovy/build.gradle | 5 +- .../commons/groovy/GroovyInterpreterTest.java | 22 ++++---- se-commons-logging/build.gradle | 5 +- .../se_rwth/commons/logging/FindingTest.java | 42 +++++++------- .../commons/logging/InteractiveLogTest.java | 52 +++++++++--------- .../de/se_rwth/commons/logging/LogTest.java | 18 +++--- se-commons-utilities/build.gradle | 5 +- .../de/se_rwth/commons/DeltaFileSetTest.java | 55 ++++++++++--------- .../de/se_rwth/commons/DirectoriesTest.java | 35 +++++------- .../java/de/se_rwth/commons/FilesTest.java | 15 ++--- .../de/se_rwth/commons/NamesUnitTest.java | 13 ++--- .../ProtectedSpaceSplitterUnitTest.java | 4 +- .../se_rwth/commons/SourcePositionTest.java | 6 +- .../commons/StringMatchersUnitTest.java | 9 +-- .../StringTransformationsUnitTest.java | 15 ++--- .../java/de/se_rwth/commons/UtilTest.java | 9 +-- .../se_rwth/commons/cli/CLIArgumentsTest.java | 7 +-- 20 files changed, 163 insertions(+), 166 deletions(-) diff --git a/build.gradle b/build.gradle index a05f6eb..5995d60 100644 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ subprojects { apply plugin : 'io.github.themrmilchmann.ecj' tasks.withType(Test).configureEach { - useJUnit() + useJUnitPlatform() testLogging { // controls whether test output is shown showStandardStreams= ("false").equals(getProperty('showTestOutput'))? false : true diff --git a/gradle.properties b/gradle.properties index 31eddc9..530f23d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,8 @@ guava_version = 33.5.0-jre javax_inject_version = 1 slf4j_version = 1.7.10 hamcrest_version = 3.0 -junit_version = 4.13.1 +junit_version = 5.14.1 +junit_platform_version = 1.14.1 groovy_version = 4.0.2 logback_version = 1.5.22 jline_version = 2.12 diff --git a/se-commons-gradle/build.gradle b/se-commons-gradle/build.gradle index 542bf72..db5e2b9 100644 --- a/se-commons-gradle/build.gradle +++ b/se-commons-gradle/build.gradle @@ -32,9 +32,10 @@ configurations { dependencies { testPluginImplementation gradleApi() testImplementation gradleTestKit() - testImplementation("org.junit.jupiter:junit-jupiter:5.7.1") - testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.0") - testRuntimeOnly("org.junit.platform:junit-platform-launcher") + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:$junit_platform_version" } tasks.named('test', Test) { useJUnitPlatform() diff --git a/se-commons-groovy/build.gradle b/se-commons-groovy/build.gradle index 9af29bf..84bcb3f 100644 --- a/se-commons-groovy/build.gradle +++ b/se-commons-groovy/build.gradle @@ -14,7 +14,10 @@ dependencies { implementation "com.google.guava:guava:$guava_version" implementation "org.apache.groovy:groovy:$groovy_version" testImplementation "org.hamcrest:hamcrest:$hamcrest_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:$junit_platform_version" } gradlePlugin.plugins { diff --git a/se-commons-groovy/src/test/java/de/se_rwth/commons/groovy/GroovyInterpreterTest.java b/se-commons-groovy/src/test/java/de/se_rwth/commons/groovy/GroovyInterpreterTest.java index cb324f9..2bf1ea6 100644 --- a/se-commons-groovy/src/test/java/de/se_rwth/commons/groovy/GroovyInterpreterTest.java +++ b/se-commons-groovy/src/test/java/de/se_rwth/commons/groovy/GroovyInterpreterTest.java @@ -2,12 +2,13 @@ package de.se_rwth.commons.groovy; import org.codehaus.groovy.GroovyException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.concurrent.atomic.AtomicInteger; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; +import static org.junit.jupiter.api.Assertions.assertThrows; /** * Test for {@link GroovyInterpreter}. @@ -54,35 +55,32 @@ public void test__multipleVariablesWithSameName() { } - @Test(expected = RuntimeException.class) + @Test public void test__evaluate_scriptWithSyntaxError() { GroovyInterpreter groovy = GroovyInterpreter.newInterpreter().build(); - groovy.evaluate("if(}{)"); - + assertThrows(RuntimeException.class, () -> groovy.evaluate("if(}{)")); } - @Test(expected = GroovyException.class) + @Test public void test__tryEvaluate_scriptWithSyntaxError() throws GroovyException { GroovyInterpreter groovy = GroovyInterpreter.newInterpreter().build(); - groovy.tryEvaluate("if(}{)"); - + assertThrows(GroovyException.class, () -> groovy.tryEvaluate("if(}{)")); } - @Test(expected = GroovyException.class) + @Test public void test__tryEvaluate_nonExistentVariable() throws GroovyException { GroovyInterpreter groovy = GroovyInterpreter.newInterpreter().build(); - groovy.tryEvaluate("o.toString()"); - + assertThrows(GroovyException.class, () -> groovy.tryEvaluate("o.toString()")); } - @Test(expected = GroovyException.class) + @Test public void test__tryEvaluate_nonExistentMethod() throws GroovyException { GroovyInterpreter groovy = GroovyInterpreter.newInterpreter().build(); - groovy.tryEvaluate("foo()"); + assertThrows(GroovyException.class, () -> groovy.tryEvaluate("foo()")); } diff --git a/se-commons-logging/build.gradle b/se-commons-logging/build.gradle index 60eb568..95d92b5 100644 --- a/se-commons-logging/build.gradle +++ b/se-commons-logging/build.gradle @@ -5,7 +5,10 @@ dependencies { api project(":se-commons-utilities") testImplementation "ch.qos.logback:logback-classic:$logback_version" testImplementation "ch.qos.logback:logback-core:$logback_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:$junit_platform_version" } publishing { diff --git a/se-commons-logging/src/test/java/de/se_rwth/commons/logging/FindingTest.java b/se-commons-logging/src/test/java/de/se_rwth/commons/logging/FindingTest.java index 39e123b..7f2e6b4 100644 --- a/se-commons-logging/src/test/java/de/se_rwth/commons/logging/FindingTest.java +++ b/se-commons-logging/src/test/java/de/se_rwth/commons/logging/FindingTest.java @@ -3,8 +3,10 @@ import de.se_rwth.commons.SourcePosition; import de.se_rwth.commons.SourcePositionBuilder; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; @SuppressWarnings({"SimplifiableAssertion", "EqualsWithItself"}) public class FindingTest { @@ -19,7 +21,7 @@ public void testShouldEqualItself1() { Finding f = new Finding(Finding.Type.ERROR, "A"); // When && Then - Assert.assertTrue(f.equals(f)); + assertTrue(f.equals(f)); } @Test @@ -29,7 +31,7 @@ public void testShouldEqualItself2() { Finding f = new Finding(Finding.Type.ERROR, "E", sp); // When && Then - Assert.assertTrue(f.equals(f)); + assertTrue(f.equals(f)); } @Test @@ -39,7 +41,7 @@ public void testShouldEqualItself3() { Finding f = new Finding(Finding.Type.WARNING, "E", sp); // When && Then - Assert.assertTrue(f.equals(f)); + assertTrue(f.equals(f)); } @Test @@ -49,7 +51,7 @@ public void testShouldEqualItself4() { Finding f = new Finding(Finding.Type.USER_ERROR, "E", sp); // When && Then - Assert.assertTrue(f.equals(f)); + assertTrue(f.equals(f)); } @Test @@ -60,7 +62,7 @@ public void testShouldEqualItself5() { Finding f = new Finding(Finding.Type.ERROR, "E", sp, spe); // When && Then - Assert.assertTrue(f.equals(f)); + assertTrue(f.equals(f)); } @Test @@ -70,7 +72,7 @@ public void testShouldEqual1() { Finding f2 = new Finding(Finding.Type.ERROR, "A"); // When && Then - Assert.assertTrue(f1.equals(f2)); + assertTrue(f1.equals(f2)); } @Test @@ -80,7 +82,7 @@ public void testShouldEqual2() { Finding f2 = new Finding(Finding.Type.WARNING, "A"); // When && Then - Assert.assertTrue(f1.equals(f2)); + assertTrue(f1.equals(f2)); } @Test @@ -90,7 +92,7 @@ public void testShouldEqual3() { Finding f2 = new Finding(Finding.Type.USER_ERROR, "A"); // When && Then - Assert.assertTrue(f1.equals(f2)); + assertTrue(f1.equals(f2)); } @Test @@ -102,7 +104,7 @@ public void testShouldEqual4() { Finding f2 = new Finding(Finding.Type.ERROR, "E", sp2); // When && Then - Assert.assertTrue(f1.equals(f2)); + assertTrue(f1.equals(f2)); } @Test @@ -116,7 +118,7 @@ public void testShouldEqual5() { Finding f2 = new Finding(Finding.Type.ERROR, "E", sp2, spe2); // When && Then - Assert.assertTrue(f1.equals(f2)); + assertTrue(f1.equals(f2)); } @Test @@ -126,7 +128,7 @@ public void testShouldNotEqual1() { Finding f2 = new Finding(Finding.Type.ERROR, "B"); // When && Then - Assert.assertFalse(f1.equals(f2)); + assertFalse(f1.equals(f2)); } @Test @@ -136,7 +138,7 @@ public void testShouldNotEqual2() { Finding f2 = new Finding(Finding.Type.WARNING, "A"); // When && Then - Assert.assertFalse(f1.equals(f2)); + assertFalse(f1.equals(f2)); } @Test @@ -146,7 +148,7 @@ public void testShouldNotEqual3() { Finding f2 = new Finding(Finding.Type.WARNING, "B"); // When && Then - Assert.assertFalse(f1.equals(f2)); + assertFalse(f1.equals(f2)); } @Test @@ -158,7 +160,7 @@ public void testShouldNotEqual4() { Finding f2 = new Finding(Finding.Type.ERROR, "E", sp2); // When && Then - Assert.assertFalse(f1.equals(f2)); + assertFalse(f1.equals(f2)); } @Test @@ -170,7 +172,7 @@ public void testShouldNotEqual5() { Finding f2 = new Finding(Finding.Type.ERROR, "E", sp2); // When && Then - Assert.assertFalse(f1.equals(f2)); + assertFalse(f1.equals(f2)); } @Test @@ -182,7 +184,7 @@ public void testShouldNotEqual6() { Finding f2 = new Finding(Finding.Type.ERROR, "E", sp2); // When && Then - Assert.assertFalse(f1.equals(f2)); + assertFalse(f1.equals(f2)); } @Test @@ -196,7 +198,7 @@ public void testShouldEqual7() { Finding f2 = new Finding(Finding.Type.ERROR, "E", sp2, spe2); // When && Then - Assert.assertFalse(f1.equals(f2)); + assertFalse(f1.equals(f2)); } @Test @@ -210,6 +212,6 @@ public void testShouldEqual8() { Finding f2 = new Finding(Finding.Type.ERROR, "E", sp2, spe2); // When && Then - Assert.assertFalse(f1.equals(f2)); + assertFalse(f1.equals(f2)); } } diff --git a/se-commons-logging/src/test/java/de/se_rwth/commons/logging/InteractiveLogTest.java b/se-commons-logging/src/test/java/de/se_rwth/commons/logging/InteractiveLogTest.java index 0e51e12..1dfd2d6 100644 --- a/se-commons-logging/src/test/java/de/se_rwth/commons/logging/InteractiveLogTest.java +++ b/se-commons-logging/src/test/java/de/se_rwth/commons/logging/InteractiveLogTest.java @@ -1,9 +1,9 @@ /* (c) https://github.com/MontiCore/monticore */ package de.se_rwth.commons.logging; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * This is a test of interactive mode of the Logger. @@ -30,23 +30,23 @@ public void testInteractiveLogging() { Log.warn(f4); // check entries - assertEquals(Log.getFindings().size(),5); - assertEquals(Log.getErrorCount(),3); + assertEquals(5, Log.getFindings().size()); + assertEquals(3, Log.getErrorCount()); - assertEquals(Log.getFindings().get(0).getType() , Finding.Type.ERROR); - assertEquals(Log.getFindings().get(0).getMsg() , f0); + assertEquals(Finding.Type.ERROR, Log.getFindings().get(0).getType()); + assertEquals(f0, Log.getFindings().get(0).getMsg()); - assertEquals(Log.getFindings().get(1).getType(), Finding.Type.USER_ERROR); - assertEquals(Log.getFindings().get(1).getMsg() , f1); + assertEquals(Finding.Type.USER_ERROR, Log.getFindings().get(1).getType()); + assertEquals(f1, Log.getFindings().get(1).getMsg()); - assertEquals(Log.getFindings().get(2).getType(), Finding.Type.WARNING); - assertEquals(Log.getFindings().get(2).getMsg() , f2); + assertEquals(Finding.Type.WARNING, Log.getFindings().get(2).getType()); + assertEquals(f2, Log.getFindings().get(2).getMsg()); - assertEquals(Log.getFindings().get(3).getType(), Finding.Type.ERROR); - assertEquals(Log.getFindings().get(3).getMsg() , f3); + assertEquals(Finding.Type.ERROR, Log.getFindings().get(3).getType()); + assertEquals(f3, Log.getFindings().get(3).getMsg()); - assertEquals(Log.getFindings().get(4).getType(), Finding.Type.WARNING); - assertEquals(Log.getFindings().get(4).getMsg() , f4); + assertEquals(Finding.Type.WARNING, Log.getFindings().get(4).getType()); + assertEquals(f4, Log.getFindings().get(4).getMsg()); } @Test @@ -63,22 +63,22 @@ public void testInteractiveLoggingInBatchMode() { Log.warn(f4); // check entries - assertEquals(Log.getFindings().size(),5); - assertEquals(Log.getErrorCount(),3); + assertEquals(5, Log.getFindings().size()); + assertEquals(3, Log.getErrorCount()); - assertEquals(Log.getFindings().get(0).getType() , Finding.Type.ERROR); - assertEquals(Log.getFindings().get(0).getMsg() , f0); + assertEquals(Finding.Type.ERROR, Log.getFindings().get(0).getType()); + assertEquals(f0, Log.getFindings().get(0).getMsg()); - assertEquals(Log.getFindings().get(1).getType(), Finding.Type.ERROR); - assertEquals(Log.getFindings().get(1).getMsg() , f1); + assertEquals(Finding.Type.ERROR, Log.getFindings().get(1).getType()); + assertEquals(f1, Log.getFindings().get(1).getMsg()); - assertEquals(Log.getFindings().get(2).getType(), Finding.Type.WARNING); - assertEquals(Log.getFindings().get(2).getMsg() , f2); + assertEquals(Finding.Type.WARNING, Log.getFindings().get(2).getType()); + assertEquals(f2, Log.getFindings().get(2).getMsg()); - assertEquals(Log.getFindings().get(3).getType(), Finding.Type.ERROR); - assertEquals(Log.getFindings().get(3).getMsg() , f3); + assertEquals(Finding.Type.ERROR, Log.getFindings().get(3).getType()); + assertEquals(f3, Log.getFindings().get(3).getMsg()); - assertEquals(Log.getFindings().get(4).getType(), Finding.Type.WARNING); - assertEquals(Log.getFindings().get(4).getMsg() , f4); + assertEquals(Finding.Type.WARNING, Log.getFindings().get(4).getType()); + assertEquals(f4, Log.getFindings().get(4).getMsg()); } } diff --git a/se-commons-logging/src/test/java/de/se_rwth/commons/logging/LogTest.java b/se-commons-logging/src/test/java/de/se_rwth/commons/logging/LogTest.java index 8a4a950..a9e9b60 100755 --- a/se-commons-logging/src/test/java/de/se_rwth/commons/logging/LogTest.java +++ b/se-commons-logging/src/test/java/de/se_rwth/commons/logging/LogTest.java @@ -4,15 +4,13 @@ import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.joran.JoranConfigurator; import ch.qos.logback.core.joran.spi.JoranException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.LoggerFactory; import java.io.File; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.*; /** * This is a very basic test of the new centralized logging mechanism. The main @@ -108,17 +106,17 @@ public void testAndDemonstrateLogStubForDeveloper() { Log.println("line 2"); Log.print("line 3\n"); List r1 = LogStub.getPrints(); - assertEquals(r1.size(),3); - assertEquals(r1.get(0),"line 1"); - assertEquals(r1.get(1),"line 2" + System.lineSeparator()); - assertEquals(r1.get(2),"line 3\n"); + assertEquals(3, r1.size()); + assertEquals("line 1", r1.get(0)); + assertEquals("line 2" + System.lineSeparator(), r1.get(1)); + assertEquals("line 3\n", r1.get(2)); LogStub.clearPrints(); Log.print("line 4"); Log.println("line 5"); List r2 = LogStub.getPrints(); - assertEquals(r2.size(),2); - assertEquals(r2.get(0),"line 4"); + assertEquals(2, r2.size()); + assertEquals("line 4", r2.get(0)); } @Test diff --git a/se-commons-utilities/build.gradle b/se-commons-utilities/build.gradle index 7e1fd90..9e5c5fa 100644 --- a/se-commons-utilities/build.gradle +++ b/se-commons-utilities/build.gradle @@ -10,7 +10,10 @@ dependencies { implementation "commons-cli:commons-cli:$commons_cli_version" implementation "com.github.spotbugs:spotbugs-annotations:$spotbugs_annotation_version" testImplementation "org.hamcrest:hamcrest:$hamcrest_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:$junit_platform_version" } publishing { diff --git a/se-commons-utilities/src/test/java/de/se_rwth/commons/DeltaFileSetTest.java b/se-commons-utilities/src/test/java/de/se_rwth/commons/DeltaFileSetTest.java index 5ac091a..a42863b 100644 --- a/se-commons-utilities/src/test/java/de/se_rwth/commons/DeltaFileSetTest.java +++ b/se-commons-utilities/src/test/java/de/se_rwth/commons/DeltaFileSetTest.java @@ -1,17 +1,19 @@ /* (c) https://github.com/MontiCore/monticore */ package de.se_rwth.commons; -import com.google.common.base.Charsets; -import com.google.common.io.Files; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import static com.google.common.io.Files.asCharSink; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasSize; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * TODO: Write me! @@ -21,29 +23,28 @@ public class DeltaFileSetTest { @Test - public void test() throws IOException { - - TemporaryFolder modelFolder = new TemporaryFolder(); - modelFolder.create(); - File f1 = modelFolder.newFile("blubb"); - File f2 = modelFolder.newFile("blabb"); - Files.write("Blubb", f1, Charsets.ISO_8859_1); - Files.write("Blabb", f2, Charsets.ISO_8859_1); + public void test(@TempDir Path modelFolder) throws IOException { + File f1 = modelFolder.resolve("blubb").toFile(); + assertTrue(f1.createNewFile()); + File f2 = modelFolder.resolve("blabb").toFile(); + assertTrue(f2.createNewFile()); + asCharSink(f1, StandardCharsets.ISO_8859_1).write("Blubb"); + asCharSink(f2, StandardCharsets.ISO_8859_1).write("Blabb"); File traceLog = File.createTempFile(".delta", ""); DeltaFileSet deltaFileSet = DeltaFileSet.newDeltaFileSet(traceLog) - .fromFile(modelFolder.getRoot()) + .fromFile(modelFolder.toFile()) .build(); assertNotNull(deltaFileSet); assertNotNull(deltaFileSet.getFiles()); assertThat(deltaFileSet.getFiles(), hasSize(2)); - - Files.write("Blabb + Update!", f2, Charsets.ISO_8859_1); + + asCharSink(f2, StandardCharsets.ISO_8859_1).write("Blabb + Update!"); DeltaFileSet deltaFileSet2 = DeltaFileSet.newDeltaFileSet(traceLog) - .fromFile(modelFolder.getRoot()) + .fromFile(modelFolder.toFile()) .build(); assertNotNull(deltaFileSet2); @@ -51,29 +52,29 @@ public void test() throws IOException { assertThat(deltaFileSet2.getFiles(), hasSize(1)); DeltaFileSet deltaFileSet3 = DeltaFileSet.newDeltaFileSet(traceLog) - .fromFile(modelFolder.getRoot()) + .fromFile(modelFolder.toFile()) .build(); assertNotNull(deltaFileSet3); assertNotNull(deltaFileSet3.getFiles()); assertThat(deltaFileSet3.getFiles(), hasSize(0)); - - Files.write("Blabb + Update!", f1, Charsets.ISO_8859_1); - Files.write("Blabb + Update Again!", f2, Charsets.ISO_8859_1); + + asCharSink(f1, StandardCharsets.ISO_8859_1).write("Blabb + Update!"); + asCharSink(f2, StandardCharsets.ISO_8859_1).write("Blabb + Update Again!"); DeltaFileSet deltaFileSet4 = DeltaFileSet.newDeltaFileSet(traceLog) - .fromFile(modelFolder.getRoot()) + .fromFile(modelFolder.toFile()) .build(); assertNotNull(deltaFileSet4); assertNotNull(deltaFileSet4.getFiles()); assertThat(deltaFileSet4.getFiles(), hasSize(2)); - - Files.write("Blabb + Update!", f1, Charsets.ISO_8859_1); - Files.write("Blabb + Update Again!", f2, Charsets.ISO_8859_1); + + asCharSink(f1, StandardCharsets.ISO_8859_1).write("Blabb + Update!"); + asCharSink(f2, StandardCharsets.ISO_8859_1).write("Blabb + Update Again!"); DeltaFileSet deltaFileSet5 = DeltaFileSet.newDeltaFileSet(traceLog) - .fromFile(modelFolder.getRoot()) + .fromFile(modelFolder.toFile()) .build(); assertNotNull(deltaFileSet5); diff --git a/se-commons-utilities/src/test/java/de/se_rwth/commons/DirectoriesTest.java b/se-commons-utilities/src/test/java/de/se_rwth/commons/DirectoriesTest.java index d7ea05b..c35858f 100644 --- a/se-commons-utilities/src/test/java/de/se_rwth/commons/DirectoriesTest.java +++ b/se-commons-utilities/src/test/java/de/se_rwth/commons/DirectoriesTest.java @@ -1,17 +1,18 @@ /* (c) https://github.com/MontiCore/monticore */ package de.se_rwth.commons; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import java.io.File; import java.io.IOException; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Unit tests for {@link Directories} @@ -19,24 +20,17 @@ * */ public class DirectoriesTest { - - @Rule - public TemporaryFolder folder = new TemporaryFolder(); - /** * Tests a copy operation on two flat directories. */ @Test - public void testCopy__flatDirectoryToDirectory() throws IOException { - - this.folder.create(); - File sourceDirectory = this.folder.newFolder(); - File targetDirectory = this.folder.newFolder(); + public void testCopy__flatDirectoryToDirectory(@TempDir File sourceDirectory, @TempDir File targetDirectory) throws IOException { File someFile = new File(sourceDirectory, "foo"); - someFile.createNewFile(); + assertTrue(someFile.createNewFile()); Directories.copy(sourceDirectory, targetDirectory); + assertNotNull(targetDirectory.listFiles()); assertThat(targetDirectory.listFiles().length, is(1)); assertThat(targetDirectory.listFiles()[0].getName(), equalTo(someFile.getName())); @@ -46,19 +40,16 @@ public void testCopy__flatDirectoryToDirectory() throws IOException { * Tests a copy operation on two nested directories. */ @Test - public void testCopy__nestedDirectoryToDirectory() throws IOException { - - this.folder.create(); - File sourceDirectory = this.folder.newFolder(); - File targetDirectory = this.folder.newFolder(); + public void testCopy__nestedDirectoryToDirectory(@TempDir File sourceDirectory, @TempDir File targetDirectory) throws IOException { File sourceSubDirectory = new File(sourceDirectory, "a/b/c"); - sourceSubDirectory.mkdirs(); + assertTrue(sourceSubDirectory.mkdirs()); File someFile = new File(sourceSubDirectory, "foo"); - someFile.createNewFile(); + assertTrue(someFile.createNewFile()); Directories.copy(sourceDirectory, targetDirectory); File targetSubDirectory = new File(targetDirectory, "a/b/c"); + assertNotNull(targetSubDirectory.listFiles()); assertThat(targetDirectory.listFiles().length, is(1)); assertThat(targetSubDirectory.listFiles().length, is(1)); assertThat(targetSubDirectory.listFiles()[0].getName(), equalTo(someFile.getName())); diff --git a/se-commons-utilities/src/test/java/de/se_rwth/commons/FilesTest.java b/se-commons-utilities/src/test/java/de/se_rwth/commons/FilesTest.java index 33ea261..e7f6250 100644 --- a/se-commons-utilities/src/test/java/de/se_rwth/commons/FilesTest.java +++ b/se-commons-utilities/src/test/java/de/se_rwth/commons/FilesTest.java @@ -1,17 +1,14 @@ /* (c) https://github.com/MontiCore/monticore */ package de.se_rwth.commons; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; - +import static org.junit.jupiter.api.Assertions.*; /** * Unit tests for {@link Files} @@ -23,7 +20,7 @@ public class FilesTest { @Test public void unzipAttack() throws URISyntaxException { URL zipFile = getClass().getResource("/directoryTraversal.zip"); - assertNotNull("Test file missing", zipFile); + assertNotNull(zipFile, "Test file missing"); File tmp = Files.createTempDir(); @@ -33,7 +30,7 @@ public void unzipAttack() throws URISyntaxException { fail(); } catch (IOException e) { - assertEquals(e.getMessage(), "Zip file entry contains ../ which leads to directory traversal"); + assertEquals("Zip file entry contains ../ which leads to directory traversal", e.getMessage()); } Files.deleteFiles(tmp); @@ -42,12 +39,12 @@ public void unzipAttack() throws URISyntaxException { @Test public void unzipFunctionality() throws URISyntaxException, IOException { URL zipFile = getClass().getResource("/test.zip"); - assertNotNull("Test file missing", zipFile); + assertNotNull(zipFile, "Test file missing"); File tmp = Files.createTempDir(); for (File entry : Files.unzip(new File(zipFile.toURI()), tmp)) { - assertEquals(entry.getName(), "test"); + assertEquals("test", entry.getName()); } Files.deleteFiles(tmp); diff --git a/se-commons-utilities/src/test/java/de/se_rwth/commons/NamesUnitTest.java b/se-commons-utilities/src/test/java/de/se_rwth/commons/NamesUnitTest.java index d394672..a9e42ce 100644 --- a/se-commons-utilities/src/test/java/de/se_rwth/commons/NamesUnitTest.java +++ b/se-commons-utilities/src/test/java/de/se_rwth/commons/NamesUnitTest.java @@ -2,12 +2,13 @@ package de.se_rwth.commons; import com.google.common.collect.ImmutableList; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.File; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; /** * Unit test for {@link Names}. @@ -100,12 +101,10 @@ public void test__getQualifiedName() { } - @Test(expected = IllegalArgumentException.class) + @Test public void test__getQualifiedName_invalidArguments() { - - Names.getQualifiedName("", ""); - Names.getQualifiedName("cc.blubb", ""); - + assertThrows(IllegalArgumentException.class, () -> Names.getQualifiedName("", "")); + assertThrows(IllegalArgumentException.class, () -> Names.getQualifiedName("cc.blubb", "")); } @Test diff --git a/se-commons-utilities/src/test/java/de/se_rwth/commons/ProtectedSpaceSplitterUnitTest.java b/se-commons-utilities/src/test/java/de/se_rwth/commons/ProtectedSpaceSplitterUnitTest.java index b54fdee..ef55886 100644 --- a/se-commons-utilities/src/test/java/de/se_rwth/commons/ProtectedSpaceSplitterUnitTest.java +++ b/se-commons-utilities/src/test/java/de/se_rwth/commons/ProtectedSpaceSplitterUnitTest.java @@ -2,10 +2,10 @@ package de.se_rwth.commons; import com.google.common.collect.Iterables; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; /** * Unit test for {@link ProtectedSpaceSplitter}. diff --git a/se-commons-utilities/src/test/java/de/se_rwth/commons/SourcePositionTest.java b/se-commons-utilities/src/test/java/de/se_rwth/commons/SourcePositionTest.java index 6b68850..0432ef7 100644 --- a/se-commons-utilities/src/test/java/de/se_rwth/commons/SourcePositionTest.java +++ b/se-commons-utilities/src/test/java/de/se_rwth/commons/SourcePositionTest.java @@ -1,12 +1,12 @@ package de.se_rwth.commons; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; public class SourcePositionTest { diff --git a/se-commons-utilities/src/test/java/de/se_rwth/commons/StringMatchersUnitTest.java b/se-commons-utilities/src/test/java/de/se_rwth/commons/StringMatchersUnitTest.java index 65ee948..0fde7b6 100644 --- a/se-commons-utilities/src/test/java/de/se_rwth/commons/StringMatchersUnitTest.java +++ b/se-commons-utilities/src/test/java/de/se_rwth/commons/StringMatchersUnitTest.java @@ -1,12 +1,13 @@ /* (c) https://github.com/MontiCore/monticore */ package de.se_rwth.commons; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Unit test for {@link StringMatchers} diff --git a/se-commons-utilities/src/test/java/de/se_rwth/commons/StringTransformationsUnitTest.java b/se-commons-utilities/src/test/java/de/se_rwth/commons/StringTransformationsUnitTest.java index 2d807a0..c7dc9df 100644 --- a/se-commons-utilities/src/test/java/de/se_rwth/commons/StringTransformationsUnitTest.java +++ b/se-commons-utilities/src/test/java/de/se_rwth/commons/StringTransformationsUnitTest.java @@ -1,10 +1,11 @@ /* (c) https://github.com/MontiCore/monticore */ package de.se_rwth.commons; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; /** * Unit test for {@link StringTransformations}. @@ -14,7 +15,7 @@ public class StringTransformationsUnitTest { /** - * Test for {@link StringMatchers.Transformations#CAPITALIZE} + * Test for {@link StringTransformations#CAPITALIZE} */ @Test public void test__Transformations_CAPITALIZE() { @@ -36,7 +37,7 @@ public void test__Transformations_CAPITALIZE() { } /** - * Test for {@link StringMatchers.Transformations#ESCAPE_JAVA} + * Test for {@link StringTransformations#ESCAPE_JAVA} */ @Test public void test__Transformations_ESCAPE_JAVA() { @@ -58,12 +59,12 @@ public void test__Transformations_ESCAPE_JAVA() { } /** - * Test for {@link StringMatchers.Transformations#CAPITALIZE} + * Test for {@link StringTransformations#CAPITALIZE} */ - @Test(expected = NullPointerException.class) + @Test public void test__Transformations_CAPITALIZE_null() { - StringTransformations.CAPITALIZE.apply(null); + assertThrows(NullPointerException.class, () -> StringTransformations.CAPITALIZE.apply(null)); } diff --git a/se-commons-utilities/src/test/java/de/se_rwth/commons/UtilTest.java b/se-commons-utilities/src/test/java/de/se_rwth/commons/UtilTest.java index 49fd845..57ae20f 100644 --- a/se-commons-utilities/src/test/java/de/se_rwth/commons/UtilTest.java +++ b/se-commons-utilities/src/test/java/de/se_rwth/commons/UtilTest.java @@ -2,14 +2,15 @@ package de.se_rwth.commons; -import org.junit.Before; -import org.junit.Test; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.Collection; import java.util.stream.Collectors; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** */ @@ -50,7 +51,7 @@ private TestNode(String content) { * * with the alphabetic order corresponding to a preorder traversal. */ - @Before + @BeforeEach public void setupTree() { A = new TestNode("A"); B = new TestNode("B"); diff --git a/se-commons-utilities/src/test/java/de/se_rwth/commons/cli/CLIArgumentsTest.java b/se-commons-utilities/src/test/java/de/se_rwth/commons/cli/CLIArgumentsTest.java index c5907ae..7a05b7d 100644 --- a/se-commons-utilities/src/test/java/de/se_rwth/commons/cli/CLIArgumentsTest.java +++ b/se-commons-utilities/src/test/java/de/se_rwth/commons/cli/CLIArgumentsTest.java @@ -2,14 +2,11 @@ package de.se_rwth.commons.cli; import com.google.common.collect.Iterables; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Map; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.*; /** * Couple of basic unit tests for {@link CLIArguments}. From 65fef4c151412fc5e4f26103dfe6da2881d666b4 Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Thu, 18 Dec 2025 11:47:11 +0100 Subject: [PATCH 08/16] bump org.apache.commons:commons-lang3 from 3.8.1 to 3.20.0 --- gradle.properties | 1 + se-commons-gradle/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 530f23d..d6a43bc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,4 +17,5 @@ logback_version = 1.5.22 jline_version = 2.12 commons_io_version = 2.21.0 commons_cli_version = 1.11.0 +commons_lang3_version = 3.20.0 spotbugs_annotation_version = 4.9.8 \ No newline at end of file diff --git a/se-commons-gradle/build.gradle b/se-commons-gradle/build.gradle index db5e2b9..a21c426 100644 --- a/se-commons-gradle/build.gradle +++ b/se-commons-gradle/build.gradle @@ -12,8 +12,8 @@ dependencies { implementation project(":se-commons-logging") implementation 'com.google.code.gson:gson:2.13.2' - implementation "org.apache.commons:commons-lang3:3.8.1" implementation "com.google.guava:guava:33.1.0-jre" + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" } From 45ca9187469d2da873648bf42865a41a11fe0434 Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Thu, 18 Dec 2025 11:47:46 +0100 Subject: [PATCH 09/16] extracted gson_version to gradle.properties --- gradle.properties | 1 + se-commons-gradle/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d6a43bc..1ad420d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,6 +15,7 @@ junit_platform_version = 1.14.1 groovy_version = 4.0.2 logback_version = 1.5.22 jline_version = 2.12 +gson_version = 2.13.2 commons_io_version = 2.21.0 commons_cli_version = 1.11.0 commons_lang3_version = 3.20.0 diff --git a/se-commons-gradle/build.gradle b/se-commons-gradle/build.gradle index a21c426..5f6a51c 100644 --- a/se-commons-gradle/build.gradle +++ b/se-commons-gradle/build.gradle @@ -10,7 +10,7 @@ dependencies { implementation gradleApi() implementation project(":se-commons-utilities") implementation project(":se-commons-logging") - implementation 'com.google.code.gson:gson:2.13.2' + implementation "com.google.code.gson:gson:$gson_version" implementation "com.google.guava:guava:33.1.0-jre" implementation "org.apache.commons:commons-lang3:$commons_lang3_version" From af6958f074183f3d9bd41a02192e72564de630d1 Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Thu, 18 Dec 2025 11:49:14 +0100 Subject: [PATCH 10/16] replaced deprecated javax dependency --- gradle.properties | 2 +- se-commons-utilities/build.gradle | 2 +- .../src/main/java/de/se_rwth/commons/cli/CLIArguments.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 1ad420d..11f0ac2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,8 +7,8 @@ showTestOutput=false version=7.9.0-SNAPSHOT guava_version = 33.5.0-jre -javax_inject_version = 1 slf4j_version = 1.7.10 +jakarta_inject_version = 2.0.1 hamcrest_version = 3.0 junit_version = 5.14.1 junit_platform_version = 1.14.1 diff --git a/se-commons-utilities/build.gradle b/se-commons-utilities/build.gradle index 9e5c5fa..d82f604 100644 --- a/se-commons-utilities/build.gradle +++ b/se-commons-utilities/build.gradle @@ -6,7 +6,7 @@ dependencies { implementation "jline:jline:$jline_version" api "org.slf4j:slf4j-api:$slf4j_version" implementation "com.google.guava:guava:$guava_version" - implementation "javax.inject:javax.inject:$javax_inject_version" + implementation "jakarta.inject:jakarta.inject-api:$jakarta_inject_version" implementation "commons-cli:commons-cli:$commons_cli_version" implementation "com.github.spotbugs:spotbugs-annotations:$spotbugs_annotation_version" testImplementation "org.hamcrest:hamcrest:$hamcrest_version" diff --git a/se-commons-utilities/src/main/java/de/se_rwth/commons/cli/CLIArguments.java b/se-commons-utilities/src/main/java/de/se_rwth/commons/cli/CLIArguments.java index 5a15965..4c8410e 100644 --- a/se-commons-utilities/src/main/java/de/se_rwth/commons/cli/CLIArguments.java +++ b/se-commons-utilities/src/main/java/de/se_rwth/commons/cli/CLIArguments.java @@ -5,7 +5,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterators; -import javax.inject.Named; +import jakarta.inject.Named; import java.util.Collections; import java.util.LinkedHashMap; import java.util.Iterator; From b80410578ec4802baa2a4943189a5fb8f9310fd2 Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Thu, 18 Dec 2025 11:50:05 +0100 Subject: [PATCH 11/16] added spotbugs-annotations to se-commons-gradle --- se-commons-gradle/build.gradle | 1 + .../de/monticore/gradle/queue/CachedQueueServicePlugin.java | 2 +- .../gradle/queue/InternalCachedQueueSetupSettingsPlugin.java | 2 +- .../src/testPlugin/java/se/rwth/example/TestPlugin.java | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/se-commons-gradle/build.gradle b/se-commons-gradle/build.gradle index 5f6a51c..72b931f 100644 --- a/se-commons-gradle/build.gradle +++ b/se-commons-gradle/build.gradle @@ -14,6 +14,7 @@ dependencies { implementation "com.google.guava:guava:33.1.0-jre" implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + implementation "com.github.spotbugs:spotbugs-annotations:$spotbugs_annotation_version" } diff --git a/se-commons-gradle/src/main/java/de/monticore/gradle/queue/CachedQueueServicePlugin.java b/se-commons-gradle/src/main/java/de/monticore/gradle/queue/CachedQueueServicePlugin.java index 9196d94..19f5170 100644 --- a/se-commons-gradle/src/main/java/de/monticore/gradle/queue/CachedQueueServicePlugin.java +++ b/se-commons-gradle/src/main/java/de/monticore/gradle/queue/CachedQueueServicePlugin.java @@ -1,7 +1,7 @@ /* (c) https://github.com/MontiCore/monticore */ package de.monticore.gradle.queue; -import org.checkerframework.checker.nullness.qual.NonNull; +import edu.umd.cs.findbugs.annotations.NonNull; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.tasks.TaskProvider; diff --git a/se-commons-gradle/src/main/java/de/monticore/gradle/queue/InternalCachedQueueSetupSettingsPlugin.java b/se-commons-gradle/src/main/java/de/monticore/gradle/queue/InternalCachedQueueSetupSettingsPlugin.java index b62f02f..212ee9c 100644 --- a/se-commons-gradle/src/main/java/de/monticore/gradle/queue/InternalCachedQueueSetupSettingsPlugin.java +++ b/se-commons-gradle/src/main/java/de/monticore/gradle/queue/InternalCachedQueueSetupSettingsPlugin.java @@ -1,7 +1,7 @@ /* (c) https://github.com/MontiCore/monticore */ package de.monticore.gradle.queue; -import org.checkerframework.checker.nullness.qual.NonNull; +import edu.umd.cs.findbugs.annotations.NonNull; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.invocation.Gradle; diff --git a/se-commons-gradle/src/testPlugin/java/se/rwth/example/TestPlugin.java b/se-commons-gradle/src/testPlugin/java/se/rwth/example/TestPlugin.java index 25fdd09..889bcba 100644 --- a/se-commons-gradle/src/testPlugin/java/se/rwth/example/TestPlugin.java +++ b/se-commons-gradle/src/testPlugin/java/se/rwth/example/TestPlugin.java @@ -4,7 +4,7 @@ import de.monticore.gradle.internal.ProgressLoggerService; import de.monticore.gradle.queue.CachedQueueServicePlugin; -import org.checkerframework.checker.nullness.qual.NonNull; +import edu.umd.cs.findbugs.annotations.NonNull; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.provider.Provider; From 868ace1dcc03208557ade0f21126f432f154e8a3 Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Thu, 18 Dec 2025 11:50:49 +0100 Subject: [PATCH 12/16] extracted guava version to gradle.properties --- se-commons-gradle/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/se-commons-gradle/build.gradle b/se-commons-gradle/build.gradle index 72b931f..97f81d1 100644 --- a/se-commons-gradle/build.gradle +++ b/se-commons-gradle/build.gradle @@ -12,8 +12,8 @@ dependencies { implementation project(":se-commons-logging") implementation "com.google.code.gson:gson:$gson_version" - implementation "com.google.guava:guava:33.1.0-jre" implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + implementation "com.google.guava:guava:$guava_version" implementation "com.github.spotbugs:spotbugs-annotations:$spotbugs_annotation_version" } From 4b2ec423e1471a0fb557a40253995edf49a302e1 Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Thu, 18 Dec 2025 11:51:46 +0100 Subject: [PATCH 13/16] bump org.slf4j:slf4j-api from 1.7.10 to 2.0.17 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 11f0ac2..5de5a91 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,8 +7,8 @@ showTestOutput=false version=7.9.0-SNAPSHOT guava_version = 33.5.0-jre -slf4j_version = 1.7.10 jakarta_inject_version = 2.0.1 +slf4j_version = 2.0.17 hamcrest_version = 3.0 junit_version = 5.14.1 junit_platform_version = 1.14.1 From 57ca9eb7131ff389811e7ec5772f3d505e378c5a Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Thu, 18 Dec 2025 11:58:49 +0100 Subject: [PATCH 14/16] extracted gradle plugin versions to gradle.properties --- build.gradle | 10 +++++----- gradle.properties | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 5995d60..45ade2e 100644 --- a/build.gradle +++ b/build.gradle @@ -4,16 +4,16 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { id 'java-library' - id "io.github.themrmilchmann.ecj" version "0.2.0" // Eclipse compiler as it's much faster than javac - id "org.sonarqube" version "3.0" + id "io.github.themrmilchmann.ecj" version "$ecj_plugin_version" // Eclipse compiler as it's much faster than javac + id "org.sonarqube" version "$sonarqube_plugin_version" id "jacoco" - id 'org.barfuin.gradle.jacocolog' version '3.1.0' + id 'org.barfuin.gradle.jacocolog' version "$jacocolog_plugin_version" id 'maven-publish' } allprojects { group = "de.se_rwth.commons" - buildDir = file("$projectDir/target") + layout.buildDirectory = file("$projectDir/target") repositories { if(("true").equals(getProperty('useLocalRepo'))){ @@ -36,7 +36,7 @@ subprojects { useJUnitPlatform() testLogging { // controls whether test output is shown - showStandardStreams= ("false").equals(getProperty('showTestOutput'))? false : true + showStandardStreams= !("false").equals(getProperty('showTestOutput')) showExceptions true showCauses true showStackTraces true diff --git a/gradle.properties b/gradle.properties index 5de5a91..603dff3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,4 +19,7 @@ gson_version = 2.13.2 commons_io_version = 2.21.0 commons_cli_version = 1.11.0 commons_lang3_version = 3.20.0 -spotbugs_annotation_version = 4.9.8 \ No newline at end of file +spotbugs_annotation_version = 4.9.8 +sonarqube_plugin_version = 3.0 +ecj_plugin_version = 0.2.0 +jacocolog_plugin_version = 3.1.0 \ No newline at end of file From b9e2c82e71d61ec265faaa4856beb3dc4cead70d Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Thu, 18 Dec 2025 13:09:23 +0100 Subject: [PATCH 15/16] bump org.jline:jline from 2.12 to 3.20.6 --- gradle.properties | 2 +- se-commons-groovy/build.gradle | 2 +- .../groovy/InteractiveGroovyShell.java | 32 ++++++++++--------- se-commons-utilities/build.gradle | 2 +- .../commons/configuration/Configuration.java | 2 +- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/gradle.properties b/gradle.properties index 603dff3..1f4af5e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ junit_version = 5.14.1 junit_platform_version = 1.14.1 groovy_version = 4.0.2 logback_version = 1.5.22 -jline_version = 2.12 +jline_version = 3.30.6 gson_version = 2.13.2 commons_io_version = 2.21.0 commons_cli_version = 1.11.0 diff --git a/se-commons-groovy/build.gradle b/se-commons-groovy/build.gradle index 84bcb3f..7066657 100644 --- a/se-commons-groovy/build.gradle +++ b/se-commons-groovy/build.gradle @@ -10,7 +10,7 @@ description = 'se-commons: groovy' dependencies { api project(":se-commons-utilities") api project(":se-commons-logging") - implementation "jline:jline:$jline_version" + implementation "org.jline:jline:$jline_version:jdk8" implementation "com.google.guava:guava:$guava_version" implementation "org.apache.groovy:groovy:$groovy_version" testImplementation "org.hamcrest:hamcrest:$hamcrest_version" diff --git a/se-commons-groovy/src/main/java/de/se_rwth/commons/groovy/InteractiveGroovyShell.java b/se-commons-groovy/src/main/java/de/se_rwth/commons/groovy/InteractiveGroovyShell.java index 057f889..8135d4a 100644 --- a/se-commons-groovy/src/main/java/de/se_rwth/commons/groovy/InteractiveGroovyShell.java +++ b/se-commons-groovy/src/main/java/de/se_rwth/commons/groovy/InteractiveGroovyShell.java @@ -1,8 +1,11 @@ /* (c) https://github.com/MontiCore/monticore */ package de.se_rwth.commons.groovy; -import jline.console.ConsoleReader; import org.codehaus.groovy.GroovyException; +import org.jline.reader.LineReader; +import org.jline.reader.LineReaderBuilder; +import org.jline.terminal.Terminal; +import org.jline.terminal.TerminalBuilder; import java.io.IOException; import java.io.PrintWriter; @@ -37,22 +40,21 @@ public static final InteractiveGroovyShell forInterpreter(GroovyInterpreter groo public void tryRun() throws IOException { - ConsoleReader reader = new ConsoleReader(); - PrintWriter writer = new PrintWriter(reader.getOutput()); - - reader.setPrompt(PROMPT); - - String line; - while ((line = reader.readLine()) != null) { - try { - groovy.tryEvaluate(line); - } - catch (GroovyException e) { - writer.append("[ERROR] Could not parse command."); - writer.flush(); + try (Terminal terminal = TerminalBuilder.builder().build()) { + LineReader reader = LineReaderBuilder.builder().terminal(terminal).build(); + PrintWriter writer = new PrintWriter(terminal.output()); + + String line; + while ((line = reader.readLine(PROMPT)) != null) { + try { + groovy.tryEvaluate(line); + } + catch (GroovyException e) { + writer.append("[ERROR] Could not parse command."); + writer.flush(); + } } } - } } diff --git a/se-commons-utilities/build.gradle b/se-commons-utilities/build.gradle index d82f604..84609d3 100644 --- a/se-commons-utilities/build.gradle +++ b/se-commons-utilities/build.gradle @@ -3,8 +3,8 @@ description = 'se-commons: utilities' dependencies { api "commons-io:commons-io:$commons_io_version" - implementation "jline:jline:$jline_version" api "org.slf4j:slf4j-api:$slf4j_version" + implementation "org.jline:jline:$jline_version:jdk8" implementation "com.google.guava:guava:$guava_version" implementation "jakarta.inject:jakarta.inject-api:$jakarta_inject_version" implementation "commons-cli:commons-cli:$commons_cli_version" diff --git a/se-commons-utilities/src/main/java/de/se_rwth/commons/configuration/Configuration.java b/se-commons-utilities/src/main/java/de/se_rwth/commons/configuration/Configuration.java index 34f8190..90c487f 100644 --- a/se-commons-utilities/src/main/java/de/se_rwth/commons/configuration/Configuration.java +++ b/se-commons-utilities/src/main/java/de/se_rwth/commons/configuration/Configuration.java @@ -3,9 +3,9 @@ import com.google.common.primitives.Doubles; import com.google.common.primitives.Ints; -import jline.internal.Log; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; +import org.jline.utils.Log; import java.util.ArrayList; import java.util.Arrays; From 5ef52e921e30ea70393e69f77d1ff87530405efd Mon Sep 17 00:00:00 2001 From: Janik Rapp Date: Fri, 19 Dec 2025 16:16:03 +0100 Subject: [PATCH 16/16] bump com.diffplug.spotless:spotless-plugin-gradle from 6.25.0 to 7.2.1 --- gradle.properties | 5 ++++- se-commons-codestyle/build.gradle | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 1f4af5e..82bc236 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,4 +22,7 @@ commons_lang3_version = 3.20.0 spotbugs_annotation_version = 4.9.8 sonarqube_plugin_version = 3.0 ecj_plugin_version = 0.2.0 -jacocolog_plugin_version = 3.1.0 \ No newline at end of file +jacocolog_plugin_version = 3.1.0 + +# newer versions require JDK 17+ +spotless_plugin_version = 7.2.1 \ No newline at end of file diff --git a/se-commons-codestyle/build.gradle b/se-commons-codestyle/build.gradle index 44dff7c..c918a8b 100644 --- a/se-commons-codestyle/build.gradle +++ b/se-commons-codestyle/build.gradle @@ -9,7 +9,7 @@ description = 'se-commons: codestyle' dependencies { implementation gradleApi() - implementation "com.diffplug.spotless:spotless-plugin-gradle:6.25.0" + implementation "com.diffplug.spotless:spotless-plugin-gradle:$spotless_plugin_version" } repositories {