дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-26 03:14:38 +02:00
feat(run): run JUnit 5 tests of Maven modules without Maven (#5571)
Gutter Run / Debug of JUnit 5 tests in Maven modules now starts OpenIDEA's own JUnit Platform runner (java/junit-runner, built from the in-tree source and embedded by ide-sdk) on the language server's test classpath instead of mvn test, as IDEA runs Maven tests unless build/run actions are delegated to Maven. The runner reports TeamCity service messages to the existing test tree; Debug and Rerun Failed Tests reuse it. The launcher jar of the engine's version comes from the classpath, else from the engine's Maven/Gradle repository folder, else is downloaded once from Maven Central.
The runner JVM gets the module's Surefire configuration like IDEA's MavenJUnitPatcher: argLine (with @{...} late replacement), systemPropertyVariables / systemProperties, environmentVariables, workingDirectory, additionalClasspathElements and classpathDependencyExcludes, read from the cached effective POM (else the module POM); the console lists what was applied.
Settings › Build Tools › Maven › Run tests using: OpenIDEA (default) or Maven (the previous mvn test -Dtest=... path). JUnit 4-only, TestNG and Gradle tests keep their current runners.
Closes #5553
Co-authored-by: wildcatDownstairs <[email protected]>
Цей коміт міститься в:
1 джерело
ae7a8e74c8
коміт
8c23c589ca
32 files changed
+1089
-48
No files matched your search
@@ -0,0 +1,43 @@
|
||||
package sample;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
class SampleTest {
|
||||
@Test
|
||||
void passes() {
|
||||
System.out.println("hello [ünï]");
|
||||
}
|
||||
|
||||
@Test
|
||||
void fails() {
|
||||
assertEquals(1, 2, "it's wrong");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
void disabled() {}
|
||||
|
||||
@Test
|
||||
void aborted() {
|
||||
assumeTrue(false);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(ints = {1, 2})
|
||||
void parameterized(int n) {
|
||||
assertEquals(1, n);
|
||||
}
|
||||
|
||||
@Nested
|
||||
class Inner {
|
||||
@Test
|
||||
void nested() {}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Заблокувати користувача