diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..00a51aff5e5a83d6313f3bd15fadc601a205b66f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# +# https://help.github.com/articles/dealing-with-line-endings/ +# +# These are explicitly windows files and should use crlf +*.bat text eol=crlf + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f198ec547b9190a094cdd1e56458a0ed7b8c23c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,216 @@ +# Created by https://www.gitignore.io/api/java,gradle,eclipse,intellij,visualstudiocode +# Edit at https://www.gitignore.io/?templates=java,gradle,eclipse,intellij,visualstudiocode + +### 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/ + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/**/sonarlint/ + +# SonarQube Plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator/ + +### 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* + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history + +### Gradle ### +.gradle +build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +### Gradle Patch ### +**/build/ + +# End of https://www.gitignore.io/api/java,gradle,eclipse,intellij,visualstudiocode \ No newline at end of file diff --git a/bin/main/io/fp/warehouse/App.class b/bin/main/io/fp/warehouse/App.class deleted file mode 100644 index 087b0bacb4269b6b52275a48ab64d50074f9447c..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/warehouse/App.class and /dev/null differ diff --git a/bin/main/io/fp/warehouse/PriceLevel.class b/bin/main/io/fp/warehouse/PriceLevel.class deleted file mode 100644 index 2a57b6f1b69025283779d39325d8f4a98b74e3a5..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/warehouse/PriceLevel.class and /dev/null differ diff --git a/bin/main/io/fp/warehouse/Product.class b/bin/main/io/fp/warehouse/Product.class deleted file mode 100644 index 49b1dd5ff5f8f77c67abd56b29050720816d083e..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/warehouse/Product.class and /dev/null differ diff --git a/bin/main/io/fp/warehouse/ProductDescription.class b/bin/main/io/fp/warehouse/ProductDescription.class deleted file mode 100644 index 81c87ee939e8a2ae837827c7eb2a4175f5f50ba5..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/warehouse/ProductDescription.class and /dev/null differ diff --git a/bin/test/io/fp/warehouse/AppTest.class b/bin/test/io/fp/warehouse/AppTest.class deleted file mode 100644 index 3f6bd9b547fb0728ccb3156cc750600fb98e0747..0000000000000000000000000000000000000000 Binary files a/bin/test/io/fp/warehouse/AppTest.class and /dev/null differ diff --git a/build.gradle b/build.gradle index 8c741b65f51cbad4468a07ade0091111f72dd8fa..1c41cbc8ba4d69ba3a998053f3d6b817f4c348d7 100644 --- a/build.gradle +++ b/build.gradle @@ -3,14 +3,14 @@ * * This generated file contains a sample Java project to get you started. * For more details take a look at the Java Quickstart chapter in the Gradle - * User Manual available at https://docs.gradle.org/5.6.1/userguide/tutorial_java_projects.html + * User Manual available at https://docs.gradle.org/6.3/userguide/tutorial_java_projects.html */ plugins { // Apply the java plugin to add support for Java id 'java' - // Apply the application plugin to add support for building a CLI application + // Apply the application plugin to add support for building a CLI application. id 'application' } @@ -22,17 +22,17 @@ repositories { dependencies { // This dependency is used by the application. - implementation 'com.google.guava:guava:28.0-jre' + implementation 'com.google.guava:guava:28.2-jre' // Use JUnit Jupiter API for testing. - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' // Use JUnit Jupiter Engine for testing. - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } application { - // Define the main class for the application + // Define the main class for the application. mainClassName = 'io.fp.warehouse.App' } diff --git a/build/classes/java/main/io/fp/warehouse/App.class b/build/classes/java/main/io/fp/warehouse/App.class deleted file mode 100644 index 2b9dfee4c71fc00f186a1daa9d68eaa09596108e..0000000000000000000000000000000000000000 Binary files a/build/classes/java/main/io/fp/warehouse/App.class and /dev/null differ diff --git a/build/classes/java/main/io/fp/warehouse/PriceLevel.class b/build/classes/java/main/io/fp/warehouse/PriceLevel.class deleted file mode 100644 index b712dd938e2de64b8b1cbacd3bb1cb482808d711..0000000000000000000000000000000000000000 Binary files a/build/classes/java/main/io/fp/warehouse/PriceLevel.class and /dev/null differ diff --git a/build/classes/java/main/io/fp/warehouse/Product.class b/build/classes/java/main/io/fp/warehouse/Product.class deleted file mode 100644 index a8ba9c58d56ac5e57b17d86bed9d5f089dae848f..0000000000000000000000000000000000000000 Binary files a/build/classes/java/main/io/fp/warehouse/Product.class and /dev/null differ diff --git a/build/classes/java/main/io/fp/warehouse/ProductDescription.class b/build/classes/java/main/io/fp/warehouse/ProductDescription.class deleted file mode 100644 index 47e7880d7d4a46709d7c957dd9dad40a5506f20c..0000000000000000000000000000000000000000 Binary files a/build/classes/java/main/io/fp/warehouse/ProductDescription.class and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf016b3885f6930543d57b744ea8c220a1a..490fda8577df6c95960ba7077c43220e5bb2c0d9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 59b5f89288842bf8ef144d802e597dcf482b3d70..a4b4429748d92848a3d820c7b099fbeb941066ae 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 83f2acfdc319a24e8766cca78f32474ad7a22dd6..2fe81a7d95e4f9ad2c9b2a046707d36ceb3980b3 100644 --- a/gradlew +++ b/gradlew @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,14 +175,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 9618d8d9607cd91a0efb866bcac4810064ba6fac..62bd9b9ccefea2b65ae41e5d9a545e2021b90a1d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" diff --git a/settings.gradle b/settings.gradle index 248a2bf3df6e07f10e2ceb065ab79dea20a4b667..43621cc760e4afdf4cb9308dd5ac963f116b471d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,7 +4,7 @@ * The settings file is used to specify which projects to include in your build. * * Detailed information about configuring a multi-project build in Gradle can be found - * in the user manual at https://docs.gradle.org/5.6.1/userguide/multi_project_builds.html + * in the user manual at https://docs.gradle.org/6.3/userguide/multi_project_builds.html */ -rootProject.name = 'warehouse' +rootProject.name = 'campus' diff --git a/src/test/java/io/fp/warehouse/AppTest.java b/src/test/java/io/fp/warehouse/AppTest.java deleted file mode 100644 index df79c698ee70ebdcee528f86f7df8134c17a9089..0000000000000000000000000000000000000000 --- a/src/test/java/io/fp/warehouse/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This Java source file was generated by the Gradle 'init' task. - */ -package io.fp.warehouse; - -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - -class AppTest { - @Test void appHasAGreeting() { - App classUnderTest = new App(); - assertNotNull(classUnderTest.getGreeting(), "app should have a greeting"); - } -} diff --git a/src/test/java/io/fp/warehouse/WarehouseTest.java b/src/test/java/io/fp/warehouse/WarehouseTest.java new file mode 100644 index 0000000000000000000000000000000000000000..44ce71feb4c32ce8502283f824a2c230e7f963e8 --- /dev/null +++ b/src/test/java/io/fp/warehouse/WarehouseTest.java @@ -0,0 +1,30 @@ +package io.fp.warehouse; + + +import static org.junit.jupiter.api.Assertions.assertTrue; + + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class WarehouseTest { + + Product<ProductDescription> p1; + + @BeforeEach + void setUp() { + + p1 = new Product<>(new ProductDescription("Obst", "Apfel"), PriceLevel.LOW); + + } + + @Test + void priceChange() { + + p1.setPrice(PriceLevel.EXCLUSIVE); + + assertTrue(p1.getPrice().equals(PriceLevel.EXCLUSIVE)); + + } + +} \ No newline at end of file