Making junit plugin using default test runner in case Spock testing framework is detected in classpath.

Currently, when spock jar is in classpath, for example `spock-core-2.3-groovy-4.0.jar`, the IDE junit plugin detects PSI from the jar `org.junit.platform.engine.TestEngine` with value `org.spockframework.runtime.SpockEngine`. By that the IDE forces to use Junit5.

In case a project uses Spock with combination of Junit4 such detection logic makes junit4 test detection impossible when the tests are performed per package or project.

Withing the fix the IDE detects Spock and Junit4 tests simultaneously.

closes https://github.com/JetBrains/intellij-community/pull/2838

GitOrigin-RevId: 20d138df183f8dfdb3121986498b080d4a61a171
This commit is contained in:
Viktors Jengovatovs
2024-08-23 13:09:16 +03:00
committed by intellij-monorepo-bot
parent 9a2a2d9244
commit 5767a7d4e5

View File

@@ -806,7 +806,8 @@ public abstract class TestObject extends JavaTestFrameworkRunnableState<JUnitCon
private static boolean isCustomJunit5TestEngineName(@Nullable String engineImplClassName) {
return !"org.junit.jupiter.engine.JupiterTestEngine".equals(engineImplClassName) &&
!"org.junit.vintage.engine.VintageTestEngine".equals(engineImplClassName);
!"org.junit.vintage.engine.VintageTestEngine".equals(engineImplClassName) &&
!"org.spockframework.runtime.SpockEngine".equals(engineImplClassName);
}
@Override