From 8f8fcdc46b0701745a84fc005514be721158a57d Mon Sep 17 00:00:00 2001 From: Matthew Chapman Date: Mon, 27 May 2024 15:09:34 -0400 Subject: [PATCH] add maven project --- backend-java/pom.xml | 169 ++++++++++++++++++ .../src/main/java/dev/mdchap/App.java | 41 +++++ .../src/test/java/dev/mdchap/AppTest.java | 20 +++ 3 files changed, 230 insertions(+) create mode 100644 backend-java/pom.xml create mode 100644 backend-java/src/main/java/dev/mdchap/App.java create mode 100644 backend-java/src/test/java/dev/mdchap/AppTest.java diff --git a/backend-java/pom.xml b/backend-java/pom.xml new file mode 100644 index 0000000..fe962ef --- /dev/null +++ b/backend-java/pom.xml @@ -0,0 +1,169 @@ + + + + 4.0.0 + + dev.mdchap + pubapptest + 1.0-SNAPSHOT + + pubapptest + https://github.com/mdchap/pubapptest + + + UTF-8 + 21 + 21 + + + + + + + org.apache.commons + commons-lang3 + 3.14.0 + + + + + org.apache.commons + commons-collections4 + 4.5.0-M1 + + + + + org.apache.commons + commons-text + 1.12.0 + + + + + org.apache.commons + commons-compress + 1.26.2 + + + + + commons-io + commons-io + 2.16.1 + + + + + commons-cli + commons-cli + 1.8.0 + + + + + com.google.guava + guava + 33.2.0-jre + + + + + org.slf4j + slf4j-api + 2.1.0-alpha1 + + + + + ch.qos.logback + logback-classic + 1.4.12 + + + + + junit + junit + 4.13.2 + 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/backend-java/src/main/java/dev/mdchap/App.java b/backend-java/src/main/java/dev/mdchap/App.java new file mode 100644 index 0000000..5dc84a7 --- /dev/null +++ b/backend-java/src/main/java/dev/mdchap/App.java @@ -0,0 +1,41 @@ +package dev.mdchap; + +import java.util.logging.Logger; + + +/** + * Run the app. + */ +public class App { + private static final Logger logger = Logger.getLogger(App.class.getName()); + private AppState state = AppState.CREATED; + + public App() { + } + + public static void main(String[] args) { + App app = new App(); + app.start(); + app.end(); + } + + private void start() { + logger.fine("Starting app..."); + // TODO: startup app + state = AppState.STARTED; + } + + private void end() { + logger.fine("Ending app..."); + // TODO: tear down app + state = AppState.ENDED; + } + + public AppState getState() { + return state; + } + + public enum AppState { + CREATED, STARTED, ENDED + } +} diff --git a/backend-java/src/test/java/dev/mdchap/AppTest.java b/backend-java/src/test/java/dev/mdchap/AppTest.java new file mode 100644 index 0000000..c3637e0 --- /dev/null +++ b/backend-java/src/test/java/dev/mdchap/AppTest.java @@ -0,0 +1,20 @@ +package dev.mdchap; + +import org.junit.Test; + +import static org.junit.Assert.assertSame; + + +/** + * Unit tests for App. + */ +public class AppTest { + /** + * Create an App and check its state is CREATED. + */ + @Test + public void shouldAnswerWithTrue() { + App app = new App(); + assertSame("State is not CREATED", app.getState(), App.AppState.CREATED); + } +}