From d7e91c419540b239c6d305c761a0e55d4292c21a Mon Sep 17 00:00:00 2001 From: Mona Lisa Date: Thu, 10 Feb 2022 20:50:55 +0100 Subject: [PATCH] Feature: Get Full Name Method --- hello-world/.gitignore | 162 ++++++++++++++++++ hello-world/pom.xml | 81 +++++++++ .../de/hs_fulda/ciip/hello_world/App.java | 29 ++++ hello-world/src/site/site.xml | 26 +++ .../de/hs_fulda/ciip/hello_world/AppTest.java | 50 ++++++ 5 files changed, 348 insertions(+) create mode 100644 hello-world/.gitignore create mode 100644 hello-world/pom.xml create mode 100644 hello-world/src/main/java/de/hs_fulda/ciip/hello_world/App.java create mode 100644 hello-world/src/site/site.xml create mode 100644 hello-world/src/test/java/de/hs_fulda/ciip/hello_world/AppTest.java diff --git a/hello-world/.gitignore b/hello-world/.gitignore new file mode 100644 index 0000000..c1921c2 --- /dev/null +++ b/hello-world/.gitignore @@ -0,0 +1,162 @@ +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + + +# Created by https://www.gitignore.io/api/git,java,maven,eclipse,windows + +### Eclipse ### + +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +### Eclipse Patch ### +# Eclipse Core +.project + +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# Annotation Processing +.apt_generated + +.sts4-cache/ + +### Git ### +# Created by git for backups. To disable backups in Git: +# $ git config --global mergetool.keepBackup false +*.orig + +# Created by git when using merge tools for conflicts +*.BACKUP.* +*.BASE.* +*.LOCAL.* +*.REMOTE.* +*_BACKUP_*.txt +*_BASE_*.txt +*_LOCAL_*.txt +*_REMOTE_*.txt + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + diff --git a/hello-world/pom.xml b/hello-world/pom.xml new file mode 100644 index 0000000..530e3d6 --- /dev/null +++ b/hello-world/pom.xml @@ -0,0 +1,81 @@ + + + + 4.0.0 + + de.hs-fulda.ciip + hello-world + 0.0.1-SNAPSHOT + + hello-world + A simple hello-world. + + http://www.example.com + + + UTF-8 + 1.7 + 1.7 + + + + + junit + junit + 3.8.1 + + + + + + + + maven-clean-plugin + 3.1.0 + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.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-project-info-reports-plugin + + + + diff --git a/hello-world/src/main/java/de/hs_fulda/ciip/hello_world/App.java b/hello-world/src/main/java/de/hs_fulda/ciip/hello_world/App.java new file mode 100644 index 0000000..d981af8 --- /dev/null +++ b/hello-world/src/main/java/de/hs_fulda/ciip/hello_world/App.java @@ -0,0 +1,29 @@ +package de.hs_fulda.ciip.hello_world; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } + + private String firstName; + private String lastName; + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getFullName() { + return firstName + " " + lastName; + } + +} diff --git a/hello-world/src/site/site.xml b/hello-world/src/site/site.xml new file mode 100644 index 0000000..21b632c --- /dev/null +++ b/hello-world/src/site/site.xml @@ -0,0 +1,26 @@ + + + + + hello-world + https://maven.apache.org/images/apache-maven-project.png + https://www.apache.org/ + + + + https://maven.apache.org/images/maven-logo-black-on-white.png + https://maven.apache.org/ + + + + org.apache.maven.skins + maven-fluido-skin + 1.7 + + + + + + + \ No newline at end of file diff --git a/hello-world/src/test/java/de/hs_fulda/ciip/hello_world/AppTest.java b/hello-world/src/test/java/de/hs_fulda/ciip/hello_world/AppTest.java new file mode 100644 index 0000000..32f3931 --- /dev/null +++ b/hello-world/src/test/java/de/hs_fulda/ciip/hello_world/AppTest.java @@ -0,0 +1,50 @@ +package de.hs_fulda.ciip.hello_world; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest extends TestCase { + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest(String testName) { + super(testName); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() { + return new TestSuite(AppTest.class); + } + + /** + * Rigourous Test :-) + */ + public void testApp() { + assertTrue(true); + } + + + public void testFullName() { + // Arrange + String expected = "Maxim Volkov"; + String firstName = "Maxim"; + String lastName = "Volkov"; + + // Act + App m = new App(); + m.setFirstName(firstName); + m.setLastName(lastName); + String actual = m.getFullName(); + + // Assert + assertEquals(expected, actual); + } +}