diff --git a/.classpath b/.classpath deleted file mode 100644 index fd287e52da5b0bd1f409127fdbc3767a841d85b3..0000000000000000000000000000000000000000 --- a/.classpath +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" output="bin/main" path="src/main/java"> - <attributes> - <attribute name="gradle_scope" value="main"/> - <attribute name="gradle_used_by_scope" value="main,test"/> - </attributes> - </classpathentry> - <classpathentry kind="src" output="bin/main" path="src/main/resources"> - <attributes> - <attribute name="gradle_scope" value="main"/> - <attribute name="gradle_used_by_scope" value="main,test"/> - </attributes> - </classpathentry> - <classpathentry kind="src" output="bin/test" path="src/test/java"> - <attributes> - <attribute name="gradle_scope" value="test"/> - <attribute name="gradle_used_by_scope" value="test"/> - <attribute name="test" value="true"/> - </attributes> - </classpathentry> - <classpathentry kind="src" output="bin/test" path="src/test/resources"> - <attributes> - <attribute name="gradle_scope" value="test"/> - <attribute name="gradle_used_by_scope" value="test"/> - <attribute name="test" value="true"/> - </attributes> - </classpathentry> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12/"/> - <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/> - <classpathentry kind="output" path="bin/default"/> -</classpath> 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 index 1b6985c0094c8e3db5f1c6e2c4d66b82f325284f..f198ec547b9190a094cdd1e56458a0ed7b8c23c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,216 @@ -# Ignore Gradle project-specific cache directory +# 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/ -# Ignore Gradle build output directory -build +# End of https://www.gitignore.io/api/java,gradle,eclipse,intellij,visualstudiocode \ No newline at end of file diff --git a/.project b/.project index 239251cd558a4a23f39119559242d14d741bb4fb..dd9332e8fc5ba24701858e6591eea445bce4ae2e 100644 --- a/.project +++ b/.project @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name>shapes</name> - <comment>Project shapes created by Buildship.</comment> + <name>campus</name> + <comment>Project dormitory created by Buildship.</comment> <projects> </projects> <buildSpec> diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index e8895216fd3c0c3af4c4522334775f41b7deb42e..0000000000000000000000000000000000000000 --- a/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -connection.project.dir= -eclipse.preferences.version=1 diff --git a/bin/main/io/fp/shapes/App.class b/bin/main/io/fp/shapes/App.class deleted file mode 100644 index d7d5109e3eb7794ddd464f981c6a0eaf9500b4ab..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/shapes/App.class and /dev/null differ diff --git a/bin/main/io/fp/shapes/Circle.class b/bin/main/io/fp/shapes/Circle.class deleted file mode 100644 index 76cd77fa52fca2e664dfd691584f9997a6d81288..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/shapes/Circle.class and /dev/null differ diff --git a/bin/main/io/fp/shapes/Rectangle.class b/bin/main/io/fp/shapes/Rectangle.class deleted file mode 100644 index 53ac9f853b0cdcc5997b51c53d0cddf7862cea17..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/shapes/Rectangle.class and /dev/null differ diff --git a/bin/main/io/fp/shapes/RectangleCircle.class b/bin/main/io/fp/shapes/RectangleCircle.class deleted file mode 100644 index 7befa1ef0179a503b0e3a090108327da51a59409..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/shapes/RectangleCircle.class and /dev/null differ diff --git a/bin/main/io/fp/shapes/Shape.class b/bin/main/io/fp/shapes/Shape.class deleted file mode 100644 index 5c60efabe38059aeb88e941a10b047e21d7aaf03..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/shapes/Shape.class and /dev/null differ diff --git a/bin/main/io/fp/shapes/SizeException.class b/bin/main/io/fp/shapes/SizeException.class deleted file mode 100644 index 9c45d0463a15cbde0c1d1fb8a85ef73acbbf702a..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/shapes/SizeException.class and /dev/null differ diff --git a/bin/main/io/fp/shapes/Test.class b/bin/main/io/fp/shapes/Test.class deleted file mode 100644 index 054d037d4178d5d61d98c034543b5d6d96106ce8..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/shapes/Test.class and /dev/null differ diff --git a/bin/main/io/fp/shapes/Util.class b/bin/main/io/fp/shapes/Util.class deleted file mode 100644 index 6a5924e8f2a7cf7e0dbcdc890055fd57c839008f..0000000000000000000000000000000000000000 Binary files a/bin/main/io/fp/shapes/Util.class and /dev/null differ diff --git a/build.gradle b/build.gradle index 1ea3c0125035a653c466ae7c103f65e7e094e416..19132dc3a5f253f910a2f47e2247eba188ef8015 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.shapes.App' } 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 a7923e0712c8182ae20b03ec7ac675ee7ca5e175..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 = 'shapes' +rootProject.name = 'campus' diff --git a/src/test/java/io/fp/shapes/ShapesTest.java b/src/test/java/io/fp/shapes/ShapesTest.java new file mode 100644 index 0000000000000000000000000000000000000000..79ac978649271da2f4a63cc0b8e6b9b96f0f4e7d --- /dev/null +++ b/src/test/java/io/fp/shapes/ShapesTest.java @@ -0,0 +1,24 @@ +package io.fp.shapes; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.util.ArrayList; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + + +public class ShapesTest { + + + @Test + void testSizeExpetion(){ + + Assertions.assertThrows(SizeException.class,() ->{ + RectangleCircle rc = new RectangleCircle(2, 1, 1); + }); + } + + +} \ No newline at end of file