Where would I go to find the minimum required junit-jupiter for my Java 8 project? Maybe it's not even a junit-jupiter I need because it's too new.
The homepage suggests that I use JUnit 6 which uses Java 17, I'm using Java 8 because supposedly right now it's more widely supported especially with old Android devices?
I saw on DPE university that some pom files reference earlier parent files and I thought if I'm going to have to reference earlier references just to find Java 8 i may as well not look. So is there a filter of some kind?
Is there a technique to finding dependencies easier than what I've tried so far, which is pretty much just picking the earliest version and reading the pom.xml file? Because despite what the tutorial said I think I'm searching for the wrong thing. Maybe pom files only show transitive dependencies and not which JVM/JDK/SDK it supports.
This is my test file:
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class FirstScreenTest {
@Test
public void testAdd(){
assertEquals(2+2,4);
}
}
and it's inside my src directory with a build.gradle that looks like so:
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
eclipse.project.name = appName + '-core'
dependencies {
api "com.badlogicgames.gdx:gdx-ai:$aiVersion"
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
api "com.badlogicgames.gdx:gdx:$gdxVersion"
if(enableGraalNative == 'true') {
implementation "io.github.berstanio:gdx-svmhelper-annotations:$graalHelperVersion"
}
testImplementation ('org.junit.jupiter:junit-jupiter:6.1.0')
}
test{
useJUnitPlatform()
}
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
As you can see JUnit 6 is in use which as I mentioned before uses Java 17. I need something specifically for Java 8 because that's how I preloaded the libgdx to be and I wouldn't want to upgrade right now just because I hear that Java 8 is more widespread.
I switched to jupiter 5.10.1, when I run test I get an error about Gradle test executor:
./gradlew test
"With Pleasure!"~>>
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:test' (registered by plugin 'org.gradle.jvm-test-suite').
> Test process encountered an unexpected problem.
> Could not start Gradle Test Executor 1.
> Failed to load JUnit Platform. Please ensure that all JUnit Platform dependencies are available on the test's runtime classpath, including the JUnit Platform launcher.
* Try:
> Check common problems https://docs.gradle.org/9.6.1/userguide/java_testing.html#sec:java_testing_troubleshooting.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights from a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.