diff --git a/ws/Archetypes/archetype-catalog.xml b/ws/Archetypes/archetype-catalog.xml index 4c2700fc59a7f89a26adfbbcf0f16720bb896d35..b5be721ab6a08aa61559c5eba7e618cdee6b1c21 100644 --- a/ws/Archetypes/archetype-catalog.xml +++ b/ws/Archetypes/archetype-catalog.xml @@ -14,6 +14,14 @@ <description>Modified from maven-archetype-quickstart using Java 1.8, log4j 2.x and Junit 4</description> </archetype> + <archetype> + <groupId>de.hdm-stuttgart.mi</groupId> + <artifactId>mi-maven-archetype-quickstart</artifactId> + <version>1.2</version> + <repository>https://maven.mi.hdm-stuttgart.de/Archetypes</repository> + <description>Modified from maven-archetype-quickstart using Java 1.8, log4j 2.x and Junit 4</description> + </archetype> + <archetype> <groupId>de.hdm-stuttgart.mi</groupId> <artifactId>mi-maven-archetype-javafxml</artifactId> diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/pom.xml b/ws/Archetypes/mi-maven-archetype-quickstart/pom.xml index 6e53460cc25f414ce4edd3b827253feadaf9da68..83ea038ac0ca089c8474a26379d1b3f363e7e8e6 100644 --- a/ws/Archetypes/mi-maven-archetype-quickstart/pom.xml +++ b/ws/Archetypes/mi-maven-archetype-quickstart/pom.xml @@ -4,7 +4,7 @@ <groupId>de.hdm-stuttgart.mi</groupId> <artifactId>mi-maven-archetype-quickstart</artifactId> - <version>1.1</version> + <version>1.2</version> <packaging>jar</packaging> <distributionManagement> <!-- mvn deploy --> diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml index 63c0f0a9a38d02ce79ed19020eb0641ec3e381d0..077b794525c53128c97c973ae129f4a184313662 100644 --- a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml +++ b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml @@ -17,9 +17,16 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-engine</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/App.java b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/App.java index 7406b99b058d02291a903ee53b624f059510d13b..686389d710c25199309e744052d33222d5db5337 100644 --- a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/App.java +++ b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/App.java @@ -26,4 +26,15 @@ public class App { log.debug("This config file 'log4j2.xml' will result in 'A1.log'"); log.debug("file containing logging output as well."); } + + /** + * This method purely exists for providing Junit tests. + * + * @param a first parameter + * @param b second parameter + * @return the sum of both parameters. + */ + public static int add(final int a, final int b) { + return a + b; + } } diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/test/java/AppTest.java b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/test/java/AppTest.java index e158e33c7d5ba5cec1f55aade2ee49fbf16747ec..6b7fb8955f53e8ad733cdadb2ef45b965823ef3f 100644 --- a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/test/java/AppTest.java +++ b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/test/java/AppTest.java @@ -1,7 +1,7 @@ package $package; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Unit test for simple App. @@ -12,6 +12,6 @@ public class AppTest { */ @Test public void testApp() { - Assert.assertTrue( true ); + Assertions.assertEquals( 33, App.add(30, 3)); } }