diff --git a/junit5/README.md b/junit5/README.md deleted file mode 100644 index ad16ad164d..0000000000 --- a/junit5/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## JUnit5 - -This module contains articles about the JUnit 5 - -### Relevant Articles: - diff --git a/junit5/pom.xml b/junit5/pom.xml deleted file mode 100644 index b9804408a2..0000000000 --- a/junit5/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - 4.0.0 - junit5 - junit5 - - - parent-modules - com.baeldung - 1.0.0-SNAPSHOT - - - - 8 - 8 - - - - - org.junit.jupiter - junit-jupiter-api - 5.8.1 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.8.1 - test - - - - \ No newline at end of file diff --git a/junit5/src/test/java/com/baeldung/junit5/A_UnitTest.java b/junit5/src/test/java/com/baeldung/junit5/A_UnitTest.java deleted file mode 100644 index e4ba59b22d..0000000000 --- a/junit5/src/test/java/com/baeldung/junit5/A_UnitTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.baeldung.junit5; - -import org.junit.jupiter.api.Test; - -public class A_UnitTest { - - @Test - public void first() throws Exception{ - System.out.println("Test A first() start => " + Thread.currentThread().getName()); - Thread.sleep(500); - System.out.println("Test A first() end => " + Thread.currentThread().getName()); - } - - @Test - public void second() throws Exception{ - System.out.println("Test A second() start => " + Thread.currentThread().getName()); - Thread.sleep(500); - System.out.println("Test A second() end => " + Thread.currentThread().getName()); - } - -} diff --git a/junit5/src/test/java/com/baeldung/junit5/B_UnitTest.java b/junit5/src/test/java/com/baeldung/junit5/B_UnitTest.java deleted file mode 100644 index 2b195d2551..0000000000 --- a/junit5/src/test/java/com/baeldung/junit5/B_UnitTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.junit5; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.parallel.Execution; -import org.junit.jupiter.api.parallel.ExecutionMode; - -public class B_UnitTest { - - @Test - public void first() throws Exception{ - System.out.println("Test B first() start => " + Thread.currentThread().getName()); - Thread.sleep(500); - System.out.println("Test B first() end => " + Thread.currentThread().getName()); - } - - @Test - public void second() throws Exception{ - System.out.println("Test B second() start => " + Thread.currentThread().getName()); - Thread.sleep(500); - System.out.println("Test B second() end => " + Thread.currentThread().getName()); - } - -} diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/parallel/FirstParallelUnitTest.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/parallel/FirstParallelUnitTest.java new file mode 100644 index 0000000000..8ac8a161ba --- /dev/null +++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/parallel/FirstParallelUnitTest.java @@ -0,0 +1,21 @@ +package com.baeldung.parallel; + +import org.junit.jupiter.api.Test; + +public class FirstParallelUnitTest { + + @Test + public void first() throws Exception{ + System.out.println("FirstParallelUnitTest first() start => " + Thread.currentThread().getName()); + Thread.sleep(500); + System.out.println("FirstParallelUnitTest first() end => " + Thread.currentThread().getName()); + } + + @Test + public void second() throws Exception{ + System.out.println("FirstParallelUnitTest second() start => " + Thread.currentThread().getName()); + Thread.sleep(500); + System.out.println("FirstParallelUnitTest second() end => " + Thread.currentThread().getName()); + } + +} diff --git a/junit5/src/test/java/com/baeldung/junit5/C_UnitTest.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/parallel/ParallelResourceLockUnitTest.java similarity index 61% rename from junit5/src/test/java/com/baeldung/junit5/C_UnitTest.java rename to testing-modules/junit-5-advanced/src/test/java/com/baeldung/parallel/ParallelResourceLockUnitTest.java index ce545f6bee..ba607b2654 100644 --- a/junit5/src/test/java/com/baeldung/junit5/C_UnitTest.java +++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/parallel/ParallelResourceLockUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.junit5; +package com.baeldung.parallel; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -8,7 +8,7 @@ import org.junit.jupiter.api.parallel.ResourceLock; import java.util.ArrayList; import java.util.List; -public class C_UnitTest { +public class ParallelResourceLockUnitTest { private List resources; @@ -26,20 +26,20 @@ public class C_UnitTest { @Test @ResourceLock(value = "resources") public void first() throws Exception { - System.out.println("Test C first() start => " + Thread.currentThread().getName()); + System.out.println("ParallelResourceLockUnitTest first() start => " + Thread.currentThread().getName()); resources.add("first"); System.out.println(resources); Thread.sleep(500); - System.out.println("Test C first() end => " + Thread.currentThread().getName()); + System.out.println("ParallelResourceLockUnitTest first() end => " + Thread.currentThread().getName()); } @Test @ResourceLock(value = "resources") public void second() throws Exception { - System.out.println("Test C second() start => " + Thread.currentThread().getName()); + System.out.println("ParallelResourceLockUnitTest second() start => " + Thread.currentThread().getName()); resources.add("second"); System.out.println(resources); Thread.sleep(500); - System.out.println("Test C second() end => " + Thread.currentThread().getName()); + System.out.println("ParallelResourceLockUnitTest second() end => " + Thread.currentThread().getName()); } } diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/parallel/SecondParallelUnitTest.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/parallel/SecondParallelUnitTest.java new file mode 100644 index 0000000000..6a6a83fbd8 --- /dev/null +++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/parallel/SecondParallelUnitTest.java @@ -0,0 +1,21 @@ +package com.baeldung.parallel; + +import org.junit.jupiter.api.Test; + +public class SecondParallelUnitTest { + + @Test + public void first() throws Exception{ + System.out.println("SecondParallelUnitTest first() start => " + Thread.currentThread().getName()); + Thread.sleep(500); + System.out.println("SecondParallelUnitTest first() end => " + Thread.currentThread().getName()); + } + + @Test + public void second() throws Exception{ + System.out.println("SecondParallelUnitTest second() start => " + Thread.currentThread().getName()); + Thread.sleep(500); + System.out.println("SecondParallelUnitTest second() end => " + Thread.currentThread().getName()); + } + +} diff --git a/junit5/src/test/resources/junit-platform.properties b/testing-modules/junit-5-advanced/src/test/resources/junit-platform.properties similarity index 100% rename from junit5/src/test/resources/junit-platform.properties rename to testing-modules/junit-5-advanced/src/test/resources/junit-platform.properties