From 5c0ea4c47d59c0d17a1f2da5f5c181426f9a6168 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 14 Oct 2018 22:39:34 +0300 Subject: [PATCH 1/2] move tests in junit-5 --- .../{throwsexception => junit5vstestng}/Calculator.java | 2 +- .../DivideByZeroException.java | 2 +- .../CalculatorUnitTest.java | 2 +- .../baeldung/junit5vstestng}/Class1UnitTest.java | 2 +- .../baeldung/junit5vstestng}/Class2UnitTest.java | 2 +- .../baeldung/junit5vstestng}/CustomNameUnitTest.java | 2 +- .../baeldung/junit5vstestng}/ParameterizedUnitTest.java | 2 +- .../baeldung/junit5vstestng}/PizzaDeliveryStrategy.java | 2 +- .../baeldung/junit5vstestng}/SelectClassesSuiteUnitTest.java | 4 +--- .../baeldung/junit5vstestng}/SelectPackagesSuiteUnitTest.java | 2 +- ...viceIntegrationTest.java => SummationServiceUnitTest.java} | 2 +- 11 files changed, 11 insertions(+), 13 deletions(-) rename testing-modules/junit-5/src/main/java/com/baeldung/{throwsexception => junit5vstestng}/Calculator.java (85%) rename testing-modules/junit-5/src/main/java/com/baeldung/{throwsexception => junit5vstestng}/DivideByZeroException.java (79%) rename testing-modules/junit-5/src/test/java/com/baeldung/{throwsexception => junit5vstestng}/CalculatorUnitTest.java (90%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/suite/childpackage1 => com/baeldung/junit5vstestng}/Class1UnitTest.java (81%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/suite/childpackage2 => com/baeldung/junit5vstestng}/Class2UnitTest.java (81%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/customtestname => com/baeldung/junit5vstestng}/CustomNameUnitTest.java (91%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/parameterisedsource => com/baeldung/junit5vstestng}/ParameterizedUnitTest.java (96%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/parameterisedsource => com/baeldung/junit5vstestng}/PizzaDeliveryStrategy.java (57%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/suite => com/baeldung/junit5vstestng}/SelectClassesSuiteUnitTest.java (63%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/suite => com/baeldung/junit5vstestng}/SelectPackagesSuiteUnitTest.java (89%) rename testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/{SummationServiceIntegrationTest.java => SummationServiceUnitTest.java} (96%) diff --git a/testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/Calculator.java b/testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/Calculator.java similarity index 85% rename from testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/Calculator.java rename to testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/Calculator.java index 50dbc9c774..4ff303c031 100644 --- a/testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/Calculator.java +++ b/testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/Calculator.java @@ -1,4 +1,4 @@ -package com.baeldung.throwsexception; +package com.baeldung.junit5vstestng; public class Calculator { diff --git a/testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java b/testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/DivideByZeroException.java similarity index 79% rename from testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java rename to testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/DivideByZeroException.java index 4413374c99..4523f46590 100644 --- a/testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java +++ b/testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/DivideByZeroException.java @@ -1,4 +1,4 @@ -package com.baeldung.throwsexception; +package com.baeldung.junit5vstestng; public class DivideByZeroException extends RuntimeException { diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CalculatorUnitTest.java similarity index 90% rename from testing-modules/junit-5/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CalculatorUnitTest.java index ef838ed304..c563b01603 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CalculatorUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.throwsexception; +package com.baeldung.junit5vstestng; import org.junit.Test; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class1UnitTest.java similarity index 81% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class1UnitTest.java index 78469cb971..09c2b9108b 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class1UnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.suite.childpackage1; +package com.baeldung.junit5vstestng; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class2UnitTest.java similarity index 81% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class2UnitTest.java index 4463ecfad9..184ecafa1b 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class2UnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.suite.childpackage2; +package com.baeldung.junit5vstestng; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CustomNameUnitTest.java similarity index 91% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CustomNameUnitTest.java index f04b825c89..9cf03ad3de 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CustomNameUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.customtestname; +package com.baeldung.junit5vstestng; import static org.junit.Assert.assertNotNull; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/ParameterizedUnitTest.java similarity index 96% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/ParameterizedUnitTest.java index 8d09161176..b5560650c4 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/ParameterizedUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.parameterisedsource; +package com.baeldung.junit5vstestng; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/PizzaDeliveryStrategy.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/PizzaDeliveryStrategy.java similarity index 57% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/PizzaDeliveryStrategy.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/PizzaDeliveryStrategy.java index ecfc7b4627..7f0a0ffa20 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/PizzaDeliveryStrategy.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/PizzaDeliveryStrategy.java @@ -1,4 +1,4 @@ -package org.baeldung.java.parameterisedsource; +package com.baeldung.junit5vstestng; public enum PizzaDeliveryStrategy { EXPRESS, diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectClassesSuiteUnitTest.java similarity index 63% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectClassesSuiteUnitTest.java index 220897eae7..7b4bd746bf 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectClassesSuiteUnitTest.java @@ -1,7 +1,5 @@ -package org.baeldung.java.suite; +package com.baeldung.junit5vstestng; -import org.baeldung.java.suite.childpackage1.Class1UnitTest; -import org.baeldung.java.suite.childpackage2.Class2UnitTest; import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.suite.api.SelectClasses; import org.junit.runner.RunWith; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java similarity index 89% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java index ae887ae43b..8f2eb2b5c5 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.suite; +package com.baeldung.junit5vstestng; import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.suite.api.SelectPackages; diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceIntegrationTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceUnitTest.java similarity index 96% rename from testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceIntegrationTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceUnitTest.java index 92e7a6f5db..a8c02e9968 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceIntegrationTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceUnitTest.java @@ -11,7 +11,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -public class SummationServiceIntegrationTest { +public class SummationServiceUnitTest { private static List numbers; @BeforeAll From 2db4d4091e50024d9ae8e4280387858aa7245da3 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 14 Oct 2018 22:44:56 +0300 Subject: [PATCH 2/2] modify link --- core-java/README.md | 1 - testing-modules/junit-5/README.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/core-java/README.md b/core-java/README.md index 9e38dfc47d..c0c3c5c0b9 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -29,7 +29,6 @@ - [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda) - [Introduction to Nashorn](http://www.baeldung.com/java-nashorn) - [Chained Exceptions in Java](http://www.baeldung.com/java-chained-exceptions) -- [A Quick JUnit vs TestNG Comparison](http://www.baeldung.com/junit-vs-testng) - [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions) - [Java Money and the Currency API](http://www.baeldung.com/java-money-and-currency) - [JVM Log Forging](http://www.baeldung.com/jvm-log-forging) diff --git a/testing-modules/junit-5/README.md b/testing-modules/junit-5/README.md index 836848282b..1fbd7a4a5e 100644 --- a/testing-modules/junit-5/README.md +++ b/testing-modules/junit-5/README.md @@ -15,3 +15,4 @@ - [The Order of Tests in JUnit](http://www.baeldung.com/junit-5-test-order) - [Running JUnit Tests Programmatically, from a Java Application](https://www.baeldung.com/junit-tests-run-programmatically-from-java) - [Testing an Abstract Class With JUnit](https://www.baeldung.com/junit-test-abstract-class) +- [A Quick JUnit vs TestNG Comparison](http://www.baeldung.com/junit-vs-testng)