From a397e43742d67622171f096037966029bbe594dd Mon Sep 17 00:00:00 2001 From: Gianmarco Pettinato Date: Sun, 3 Apr 2022 20:03:17 +0200 Subject: [PATCH] super important library --- .gitignore | 1 + .vscode/settings.json | 3 + pom.xml | 75 +++++++++++++++++++ .../gitlesson/demolibrary/TestLibrary.java | 11 +++ .../com/gitlesson/demolibrary/AppTest.java | 21 ++++++ 5 files changed, 111 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 pom.xml create mode 100644 src/main/java/com/gitlesson/demolibrary/TestLibrary.java create mode 100644 src/test/java/com/gitlesson/demolibrary/AppTest.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1de5659 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4f81299 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "automatic" +} diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..71a03a4 --- /dev/null +++ b/pom.xml @@ -0,0 +1,75 @@ + + + + 4.0.0 + + com.gitlesson.demolibrary + demolibrary + 1.0 + + demolibrary + + http://www.example.com + + + UTF-8 + 1.7 + 1.7 + + + + + junit + junit + 4.11 + test + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/src/main/java/com/gitlesson/demolibrary/TestLibrary.java b/src/main/java/com/gitlesson/demolibrary/TestLibrary.java new file mode 100644 index 0000000..f8d80b1 --- /dev/null +++ b/src/main/java/com/gitlesson/demolibrary/TestLibrary.java @@ -0,0 +1,11 @@ +package com.gitlesson.demolibrary; + +/** + * Hello world! + * + */ +public class TestLibrary { + public static String getText() { + return "Hello from library!"; + } +} diff --git a/src/test/java/com/gitlesson/demolibrary/AppTest.java b/src/test/java/com/gitlesson/demolibrary/AppTest.java new file mode 100644 index 0000000..4e31155 --- /dev/null +++ b/src/test/java/com/gitlesson/demolibrary/AppTest.java @@ -0,0 +1,21 @@ +package com.gitlesson.demolibrary; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +/** + * Unit test for simple App. + */ +public class AppTest { + private String ExpectedString = "Hello from library!"; + + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() { + String result = TestLibrary.getText(); + assertEquals(ExpectedString, result); + } +}