Run maven test in junit window

alea :

I have a Java Project with maven in Eclipse. This project includes several Junit5 tests.

I have configured my pom.xml as followed:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.22.0</version>
    <configuration>
        <properties>
            <configurationParameters>
                junit.jupiter.execution.parallel.enabled = true
                junit.jupiter.execution.parallel.mode.default = concurrent
            </configurationParameters>
        </properties>
    </configuration>
</plugin>

I included my junit dependency as followed:

<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-engine</artifactId>
    <version>5.5.1</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <version>5.5.1</version>
    <scope>test</scope>
</dependency>

When I click right on my project I can choose Run As -> Junit Test. This will open the Junit View where I can see the process in a nice way and execute the tests without my maven settings.

When I click right on my project I can also choose Run As -> Maven test. This will open the console view, take my maven settings and will run the test. But I don't like the look of the console view.

So my question is: Is it possible to excute my project via Maven test to use my maven settings and let it run in the Junit view?

Jiri Tousek :

The maven test outputs test results in target\surefire-reports\ directory.

You can take the XML with test results and drag&drop it to the Test View once the test completes, and the view will load and show the test results.

Caveats:

  • You won't see the progress, you can only do this once the test completes
  • Can only see one test (~ one test class) at a time, not complete test results
  • Quite inconvenient

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=131631&siteId=1