Skip to content

Commit 5353d8e

Browse files
committed
Check for JUnit 5 and 6 conflicts with junit-jupiter-engine and not with junit-platform-engine
Fixes: #2045
1 parent 2b81907 commit 5353d8e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/JUnitLaunchValidationOperation.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232

3333
public class JUnitLaunchValidationOperation extends LaunchValidationOperation {
3434

35-
private static final Set<String> JUNIT_PLATFORM_ENGINE_BUNLDES = Set.of(new String[] { //
36-
"junit-platform-engine", //$NON-NLS-1$
37-
"org.junit.platform.engine", //$NON-NLS-1$
35+
private static final Set<String> JUNIT_JUPITER_ENGINE_BUNLDES = Set.of(new String[] { //
36+
"junit-jupiter-engine", //$NON-NLS-1$
37+
"org.junit.jupiter.engine", //$NON-NLS-1$
3838
});
3939

4040
private final Map<Object, Object[]> fErrors = new HashMap<>(2);
@@ -64,8 +64,7 @@ private void checkJunitVersion(ILaunchConfiguration configuration, Set<IPluginMo
6464
case TestKindRegistry.JUNIT3_TEST_KIND_ID, TestKindRegistry.JUNIT4_TEST_KIND_ID -> {
6565
} // nothing to check
6666
case TestKindRegistry.JUNIT5_TEST_KIND_ID -> {
67-
// JUnit 5 platform bundles have version range [1.0,2.0)
68-
junitPlatformBundlesVersions.stream().map(Version::getMajor).filter(i -> i.intValue() != 1).findFirst().ifPresent(otherVersion -> {
67+
junitPlatformBundlesVersions.stream().map(Version::getMajor).filter(i -> i.intValue() != 5).findFirst().ifPresent(otherVersion -> {
6968
String message = NLS.bind(PDEMessages.JUnitLaunchConfiguration_error_JUnitLaunchAndRuntimeMissmatch, 5, otherVersion);
7069
addError(message);
7170
});
@@ -92,7 +91,7 @@ public Map<Object, Object[]> getInput() {
9291

9392
private static Set<Version> junitPlatformBundleVersions(Set<IPluginModelBase> models) {
9493
return models.stream().map(IPluginModelBase::getBundleDescription) //
95-
.filter(d -> JUNIT_PLATFORM_ENGINE_BUNLDES.contains(d.getSymbolicName())) //
94+
.filter(d -> JUNIT_JUPITER_ENGINE_BUNLDES.contains(d.getSymbolicName())) //
9695
.map(BundleDescription::getVersion).collect(Collectors.toSet());
9796
}
9897
}

0 commit comments

Comments
 (0)