Tibor17 commented on a change in pull request #484:
URL: https://github.com/apache/maven-surefire/pull/484#discussion_r820209008



##########
File path: maven-surefire-plugin/src/site/apt/examples/junit-platform.apt.vm
##########
@@ -411,6 +411,42 @@ Using JUnit 5 Platform
 </dependencies>
 +---+
 
+** JUnit5 Suite
+
+  For more information see this
+  
{{{https://github.com/apache/maven-surefire/tree/master/surefire-its/src/test/resources/junit5-suite}example}}
+  and the 
{{{https://junit.org/junit5/docs/current/user-guide/#junit-platform-suite-engine}tutorial}}.
+
++---+
+<dependencies>
+    <dependency>
+        <groupId>org.junit.jupiter</groupId>
+        <artifactId>junit-jupiter-engine</artifactId>
+        <version>5.8.2</version>
+        <scope>test</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.junit.platform</groupId>
+        <artifactId>junit-platform-suite-engine</artifactId>
+        <version>1.8.2</version>
+        <scope>test</scope>
+    </dependency>
+</dependencies>
+<build>
+    <plugins>
+        <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+                <includes>
+                    <include>JUnit5Tests</include>

Review comment:
       Don't be surprised! What is the point of Junit5 Suite? It's the same 
point that the Junit4 suite has!
   The Point is to start the suite class which is a similar case is in your 
Surefire project. The suite children are executed by selecting `JUnit5Tests` 
and not by surefire provider and that the reason you have to select it. You 
must select the suite and not the children. Why we do not use the parameter 
`test`? Because there is a significant difference between `includes` and 
`test`.  The `test` is a filter performing the selection inside of the JUnit 
which cannot be used here because this way you are not able to select the root 
class `JUnit5Tests` and you filter out all children. The `includes` does 
exactly what we want, it does not perform filtering inside of JUnit, it 
performs selection of classes that you `send` to the JUnit framework to execute 
it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to