From d7ce2a3ea234de3a040e762083db88aa3610f320 Mon Sep 17 00:00:00 2001 From: Kamal Wickramanayake Date: Sat, 27 Jun 2026 17:10:54 +0530 Subject: Added two JUnit sample apps --- junit/01-simple/.gitignore | 2 + junit/01-simple/.mvn/jvm.config | 0 junit/01-simple/.mvn/maven.config | 0 junit/01-simple/pom.xml | 90 ++++++++++++++++++++++ .../src/main/java/com/example/myapp/App.java | 10 +++ .../src/test/java/com/example/myapp/AppTest.java | 19 +++++ 6 files changed, 121 insertions(+) create mode 100644 junit/01-simple/.gitignore create mode 100644 junit/01-simple/.mvn/jvm.config create mode 100644 junit/01-simple/.mvn/maven.config create mode 100644 junit/01-simple/pom.xml create mode 100644 junit/01-simple/src/main/java/com/example/myapp/App.java create mode 100644 junit/01-simple/src/test/java/com/example/myapp/AppTest.java (limited to 'junit/01-simple') diff --git a/junit/01-simple/.gitignore b/junit/01-simple/.gitignore new file mode 100644 index 0000000..4e3ee4c --- /dev/null +++ b/junit/01-simple/.gitignore @@ -0,0 +1,2 @@ +.vscode +target diff --git a/junit/01-simple/.mvn/jvm.config b/junit/01-simple/.mvn/jvm.config new file mode 100644 index 0000000..e69de29 diff --git a/junit/01-simple/.mvn/maven.config b/junit/01-simple/.mvn/maven.config new file mode 100644 index 0000000..e69de29 diff --git a/junit/01-simple/pom.xml b/junit/01-simple/pom.xml new file mode 100644 index 0000000..d5bf4b5 --- /dev/null +++ b/junit/01-simple/pom.xml @@ -0,0 +1,90 @@ + + + 4.0.0 + + com.example.myapp + simple + 1.0-SNAPSHOT + + simple + + http://www.example.com + + + UTF-8 + 25 + + + + + + org.junit + junit-bom + 5.11.0 + pom + import + + + + + + + org.junit.jupiter + junit-jupiter-api + test + + + + org.junit.jupiter + junit-jupiter-params + test + + + + + + + + + maven-clean-plugin + 3.4.0 + + + + maven-resources-plugin + 3.3.1 + + + maven-compiler-plugin + 3.13.0 + + + maven-surefire-plugin + 3.3.0 + + + maven-jar-plugin + 3.4.2 + + + maven-install-plugin + 3.1.2 + + + maven-deploy-plugin + 3.1.2 + + + + maven-site-plugin + 3.12.1 + + + maven-project-info-reports-plugin + 3.6.1 + + + + + diff --git a/junit/01-simple/src/main/java/com/example/myapp/App.java b/junit/01-simple/src/main/java/com/example/myapp/App.java new file mode 100644 index 0000000..7a68705 --- /dev/null +++ b/junit/01-simple/src/main/java/com/example/myapp/App.java @@ -0,0 +1,10 @@ +package com.example.myapp; + +/** + * Hello world! + */ +public class App { + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/junit/01-simple/src/test/java/com/example/myapp/AppTest.java b/junit/01-simple/src/test/java/com/example/myapp/AppTest.java new file mode 100644 index 0000000..49a35aa --- /dev/null +++ b/junit/01-simple/src/test/java/com/example/myapp/AppTest.java @@ -0,0 +1,19 @@ +package com.example.myapp; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +/** + * Unit test for simple App. + */ +public class AppTest { + + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() { + assertTrue(true); + } +} -- cgit v1.2.3