diff --git a/testing-modules/junit-5-advanced/pom.xml b/testing-modules/junit-5-advanced/pom.xml
index bfc490b03e..5a65b0f6f3 100644
--- a/testing-modules/junit-5-advanced/pom.xml
+++ b/testing-modules/junit-5-advanced/pom.xml
@@ -33,6 +33,19 @@
${assertj.version}
test
+
+ org.junit.platform
+ junit-platform-suite
+ ${junit-platform.version}
+ test
+
+
+ org.junit.platform
+ junit-platform-runner
+ ${junit-platform.version}
+ test
+
+
@@ -45,6 +58,9 @@
-javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
true
+
+ **/testsuite/**/*UnitTest.java
+
@@ -53,6 +69,7 @@
1.49
3.24.2
+ 1.9.2
\ No newline at end of file
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/ClassOneUnitTest.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/ClassOneUnitTest.java
new file mode 100644
index 0000000000..4ce092796e
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/ClassOneUnitTest.java
@@ -0,0 +1,13 @@
+package com.baeldung.testsuite;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class ClassOneUnitTest {
+
+ @Test
+ public void whenTrue_thenTrue() {
+ Assertions.assertTrue(true);
+ }
+
+}
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/ClassThreeUnitTest.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/ClassThreeUnitTest.java
new file mode 100644
index 0000000000..b686ef5773
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/ClassThreeUnitTest.java
@@ -0,0 +1,13 @@
+package com.baeldung.testsuite;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+
+public class ClassThreeUnitTest {
+ @Test
+ @Tag("slow")
+ public void whenTrue_thenTrue() {
+ Assertions.assertTrue(true);
+ }
+}
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/package-info.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/package-info.java
new file mode 100644
index 0000000000..53c8ea5e8a
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * Dummy tests - showing Junit Suite functionality
+ */
+package com.baeldung.testsuite;
\ No newline at end of file
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/subpackage/ClassTwoUnitTest.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/subpackage/ClassTwoUnitTest.java
new file mode 100644
index 0000000000..bb63fcda63
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/subpackage/ClassTwoUnitTest.java
@@ -0,0 +1,11 @@
+package com.baeldung.testsuite.subpackage;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class ClassTwoUnitTest {
+ @Test
+ public void whenTrue_thenTrue() {
+ Assertions.assertTrue(true);
+ }
+}
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitClassNamePatternsSuite.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitClassNamePatternsSuite.java
new file mode 100644
index 0000000000..aa17e26069
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitClassNamePatternsSuite.java
@@ -0,0 +1,14 @@
+package com.baeldung.testsuite.suites;
+
+import org.junit.platform.suite.api.ExcludeClassNamePatterns;
+import org.junit.platform.suite.api.IncludeClassNamePatterns;
+import org.junit.platform.suite.api.SelectPackages;
+import org.junit.platform.suite.api.Suite;
+
+@Suite
+@SelectPackages("com.baeldung.testsuite")
+@IncludeClassNamePatterns("com.baeldung.testsuite.Class.*UnitTest")
+@ExcludeClassNamePatterns("com.baeldung.testsuite.ClassTwoUnitTest")
+public class JUnitClassNamePatternsSuite {
+ // runs ClassOneUnitTest and ClassThreeUnitTest
+}
\ No newline at end of file
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitExcludePackagesSuite.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitExcludePackagesSuite.java
new file mode 100644
index 0000000000..47cd993f8a
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitExcludePackagesSuite.java
@@ -0,0 +1,12 @@
+package com.baeldung.testsuite.suites;
+
+import org.junit.platform.suite.api.ExcludePackages;
+import org.junit.platform.suite.api.SelectPackages;
+import org.junit.platform.suite.api.Suite;
+
+@Suite
+@SelectPackages("com.baeldung.testsuite")
+@ExcludePackages("com.baeldung.testsuite.subpackage")
+public class JUnitExcludePackagesSuite {
+ // runs ClassOneUnitTest and ClassThreeUnitTest
+}
\ No newline at end of file
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitRunWithSuite.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitRunWithSuite.java
new file mode 100644
index 0000000000..ad098fb305
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitRunWithSuite.java
@@ -0,0 +1,16 @@
+package com.baeldung.testsuite.suites;
+
+import com.baeldung.testsuite.ClassOneUnitTest;
+import com.baeldung.testsuite.subpackage.ClassTwoUnitTest;
+import org.junit.platform.runner.JUnitPlatform;
+import org.junit.platform.suite.api.SelectClasses;
+import org.junit.platform.suite.api.SuiteDisplayName;
+import org.junit.runner.RunWith;
+
+@RunWith(JUnitPlatform.class)
+@SuiteDisplayName("My Test Suite")
+@SelectClasses({ClassOneUnitTest.class, ClassTwoUnitTest.class})
+public class JUnitRunWithSuite {
+ // runs ClassOneUnitTest and ClassTwoUnitTest
+ // equivalent to JUnitSelectClassesSuite
+}
\ No newline at end of file
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitSelectClassesSuite.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitSelectClassesSuite.java
new file mode 100644
index 0000000000..dc2b78ac53
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitSelectClassesSuite.java
@@ -0,0 +1,14 @@
+package com.baeldung.testsuite.suites;
+
+import com.baeldung.testsuite.ClassOneUnitTest;
+import com.baeldung.testsuite.subpackage.ClassTwoUnitTest;
+import org.junit.platform.suite.api.SelectClasses;
+import org.junit.platform.suite.api.Suite;
+import org.junit.platform.suite.api.SuiteDisplayName;
+
+@Suite
+@SuiteDisplayName("My Test Suite")
+@SelectClasses({ClassOneUnitTest.class, ClassTwoUnitTest.class})
+public class JUnitSelectClassesSuite {
+ // runs ClassOneUnitTest and ClassTwoUnitTest
+}
\ No newline at end of file
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitSelectPackagesSuite.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitSelectPackagesSuite.java
new file mode 100644
index 0000000000..26562a18d7
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitSelectPackagesSuite.java
@@ -0,0 +1,10 @@
+package com.baeldung.testsuite.suites;
+
+import org.junit.platform.suite.api.SelectPackages;
+import org.junit.platform.suite.api.Suite;
+
+@Suite
+@SelectPackages({"com.baeldung.testsuite", "com.baeldung.testsuitetwo"})
+public class JUnitSelectPackagesSuite {
+ // runs ClassOneUnitTest, ClassTwoUnitTest and ClassThreeUnitTest
+}
\ No newline at end of file
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitTestExcludeTagsSuite.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitTestExcludeTagsSuite.java
new file mode 100644
index 0000000000..5ae32fc0b5
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitTestExcludeTagsSuite.java
@@ -0,0 +1,12 @@
+package com.baeldung.testsuite.suites;
+
+import org.junit.platform.suite.api.ExcludeTags;
+import org.junit.platform.suite.api.SelectPackages;
+import org.junit.platform.suite.api.Suite;
+
+@Suite
+@SelectPackages("com.baeldung.testsuite")
+@ExcludeTags("slow")
+public class JUnitTestExcludeTagsSuite {
+ // runs ClassOneUnitTest, ClassTwoUnitTest
+}
\ No newline at end of file
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitTestIncludePackagesSuite.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitTestIncludePackagesSuite.java
new file mode 100644
index 0000000000..b5442aff35
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitTestIncludePackagesSuite.java
@@ -0,0 +1,12 @@
+package com.baeldung.testsuite.suites;
+
+import org.junit.platform.suite.api.IncludePackages;
+import org.junit.platform.suite.api.SelectPackages;
+import org.junit.platform.suite.api.Suite;
+
+@Suite
+@SelectPackages("com.baeldung.testsuite")
+@IncludePackages("com.baeldung.testsuite.subpackage")
+public class JUnitTestIncludePackagesSuite {
+ // runs ClassTwoUnitTest
+}
\ No newline at end of file
diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitTestIncludeTagsSuite.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitTestIncludeTagsSuite.java
new file mode 100644
index 0000000000..1cfce4bd7a
--- /dev/null
+++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/testsuite/suites/JUnitTestIncludeTagsSuite.java
@@ -0,0 +1,12 @@
+package com.baeldung.testsuite.suites;
+
+import org.junit.platform.suite.api.IncludeTags;
+import org.junit.platform.suite.api.SelectPackages;
+import org.junit.platform.suite.api.Suite;
+
+@Suite
+@SelectPackages("com.baeldung.testsuite")
+@IncludeTags("slow")
+public class JUnitTestIncludeTagsSuite {
+ // runs ClassTwoUnitTest
+}
\ No newline at end of file