Add all exercises

This commit is contained in:
Simon 2019-06-18 13:40:26 +02:00
parent 2c4a91eda2
commit 03d84984a0
42 changed files with 790 additions and 195 deletions

8
.idea/modules.xml Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/tn-05.iml" filepath="$PROJECT_DIR$/.idea/tn-05.iml" />
</modules>
</component>
</project>

9
.idea/tn-05.iml Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

264
.idea/workspace.xml Normal file
View file

@ -0,0 +1,264 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="05af099f-8321-4e4b-9fdb-73919b26cfc1" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="225">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/de.hhn.ai.prog2.blatt7.junit/src/view/MainFrame.java">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/de.hhn.ai.prog2.blatt7.junit/src/view/PizzaConfiguratorPanel.java">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/de.hhn.ai.prog2.blatt7.junit/src/view/PizzaListPanel.java">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/de.hhn.ai.prog2.blatt7.junit/src/services/io/PizzaIOHandler.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="16" selection-start-line="16" selection-end-line="16" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="2239" />
<option name="y" value="161" />
<option name="width" value="1390" />
<option name="height" value="999" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="tn-05" type="b2602c69:ProjectViewProjectNode" />
<item name="tn-05" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="tn-05" type="b2602c69:ProjectViewProjectNode" />
<item name="tn-05" type="462c0819:PsiDirectoryNode" />
<item name="de.hhn.ai.prog2.blatt7.junit" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="tn-05" type="b2602c69:ProjectViewProjectNode" />
<item name="tn-05" type="462c0819:PsiDirectoryNode" />
<item name="de.hhn.ai.prog2.blatt7.junit" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="tn-05" type="b2602c69:ProjectViewProjectNode" />
<item name="tn-05" type="462c0819:PsiDirectoryNode" />
<item name="de.hhn.ai.prog2.blatt7.junit" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="services" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="tn-05" type="b2602c69:ProjectViewProjectNode" />
<item name="tn-05" type="462c0819:PsiDirectoryNode" />
<item name="de.hhn.ai.prog2.blatt7.junit" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="services" type="462c0819:PsiDirectoryNode" />
<item name="io" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="tn-05" type="b2602c69:ProjectViewProjectNode" />
<item name="tn-05" type="462c0819:PsiDirectoryNode" />
<item name="de.hhn.ai.prog2.blatt7.junit" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="view" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$/de.hhn.ai.prog2.blatt7.junit" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="05af099f-8321-4e4b-9fdb-73919b26cfc1" name="Default Changelist" comment="" />
<created>1561645894129</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1561645894129</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="1280" y="0" width="2560" height="1410" extended-state="6" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.46795887" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" />
<window_info id="UI Designer" order="4" />
<window_info id="Capture Tool" order="5" />
<window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Terminal" order="7" />
<window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
<window_info anchor="bottom" id="Version Control" order="9" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Palette" order="3" />
<window_info anchor="right" id="Capture Analysis" order="4" />
<window_info anchor="right" id="Theme Preview" order="5" />
<window_info anchor="right" id="Maven" order="6" />
<window_info anchor="right" id="Palette&#9;" order="7" />
</layout>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/de.hhn.ai.prog2.blatt7.junit/src/view/MainFrame.java">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/de.hhn.ai.prog2.blatt7.junit/src/view/PizzaConfiguratorPanel.java">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/de.hhn.ai.prog2.blatt7.junit/src/view/PizzaListPanel.java">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/de.hhn.ai.prog2.blatt7.junit/src/services/io/PizzaIOHandler.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="16" selection-start-line="16" selection-end-line="16" />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8.0_212" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View file

@ -1,7 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="ce5d9264-6543-4dfb-9894-4df6c2616d5e" name="Default" comment="" />
<list default="true" id="ce5d9264-6543-4dfb-9894-4df6c2616d5e" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PizzaProject.iml" beforeDir="false" afterPath="$PROJECT_DIR$/PizzaProject.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/PizzaProject/model/Order$OrderState.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/PizzaProject/model/Order$OrderState.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/PizzaProject/model/Order.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/PizzaProject/model/Order.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/PizzaProject/model/Pizza$Size.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/PizzaProject/model/Pizza$Size.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/PizzaProject/model/Pizza$Toppings.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/PizzaProject/model/Pizza$Toppings.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/PizzaProject/model/Pizza.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/PizzaProject/model/Pizza.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/PizzaProject/services/dummy/PizzaServiceDummy.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/PizzaProject/services/dummy/PizzaServiceDummy.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/PizzaProject/services/impl/OrderService.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/PizzaProject/services/impl/OrderService.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/model/Order$OrderState.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/model/Order.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/model/Pizza$Size.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/model/Pizza$Toppings.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/model/Pizza.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/model/exceptions/OrderException.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/services/dummy/PizzaServiceDummy.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/services/impl/OrderService.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/services/impl/PizzaService.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/services/interfaces/IPizzaService.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/services/io/PizzaIOHandler.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/view/MainFrame.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/view/PizzaConfiguratorPanel.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TestGPI2/view/PizzaListPanel.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/test/PizzaProject/model/OrderTest.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/test/PizzaProject/model/OrderTest.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/test/PizzaProject/model/PizzaTest.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/test/PizzaProject/model/PizzaTest.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/test/PizzaProject/services/OrderServiceTest.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/test/PizzaProject/services/OrderServiceTest.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/test/TestGPI2/model/OrderTest.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/test/TestGPI2/model/PizzaTest.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/test/TestGPI2/services/OrderServiceTest.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/model/Order.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/model/Order.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/model/Pizza.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/model/Pizza.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/services/dummy/PizzaServiceDummy.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/services/dummy/PizzaServiceDummy.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/services/impl/OrderService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/services/impl/OrderService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tests/model/OrderTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/tests/model/OrderTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tests/model/PizzaTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/tests/model/PizzaTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tests/services/OrderServiceTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/tests/services/OrderServiceTest.java" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
@ -10,74 +48,124 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DefaultGradleProjectSettings">
<option name="testRunner" value="GRADLE" />
<option name="delegatedBuild" value="true" />
<option name="isMigrated" value="true" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/view/PizzaListPanel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="11" column="13" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="13" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/view/PizzaConfiguratorPanel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="8" column="38" selection-start-line="8" selection-start-column="38" selection-end-line="8" selection-end-column="38" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tests/model/OrderTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="525">
<caret line="37" column="5" selection-start-line="37" selection-start-column="5" selection-end-line="37" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/model/Order.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="960">
<caret line="78" selection-start-line="78" selection-end-line="78" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/model/Pizza.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="686">
<caret line="83" column="32" selection-start-line="83" selection-start-column="32" selection-end-line="83" selection-end-column="32" />
<folding>
<element signature="e#1978#1979#0" expanded="true" />
<element signature="e#2017#2018#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
<splitter split-orientation="horizontal" split-proportion="0.5">
<split-first>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tests/model/PizzaTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="767">
<caret line="54" selection-start-line="54" selection-end-line="54" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#377#378#0" expanded="true" />
<element signature="e#440#441#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/services/dummy/PizzaServiceDummy.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="495">
<caret line="42" selection-start-line="42" selection-end-line="42" />
<folding>
<element signature="e#1846#1847#0" expanded="true" />
<element signature="e#1930#1931#0" expanded="true" />
<element signature="e#2043#2044#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tests/model/OrderTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1200">
<caret line="80" column="40" selection-start-line="80" selection-start-column="40" selection-end-line="80" selection-end-column="40" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/tests/services/OrderServiceTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="842">
<caret line="75" column="22" selection-start-line="75" selection-start-column="22" selection-end-line="75" selection-end-column="22" />
</state>
</provider>
</entry>
</file>
</leaf>
</split-first>
<split-second>
<leaf>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/model/Pizza.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="692">
<caret line="100" column="5" selection-start-line="100" selection-start-column="5" selection-end-line="100" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#781#782#0" expanded="true" />
<element signature="e#821#822#0" expanded="true" />
<element signature="e#850#851#0" expanded="true" />
<element signature="e#877#878#0" expanded="true" />
<element signature="e#915#916#0" expanded="true" />
<element signature="e#947#948#0" expanded="true" />
<element signature="e#1978#1979#0" expanded="true" />
<element signature="e#2017#2018#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/model/Order.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="752">
<caret line="102" column="7" selection-start-line="102" selection-start-column="7" selection-end-line="102" selection-end-column="7" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/services/impl/OrderService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="435">
<caret line="33" column="39" selection-start-line="33" selection-start-column="39" selection-end-line="33" selection-end-column="39" />
<folding>
<element signature="e#274#275#0" expanded="true" />
<element signature="e#310#311#0" expanded="true" />
<element signature="e#379#380#0" expanded="true" />
<element signature="e#407#408#0" expanded="true" />
<element signature="e#448#449#0" expanded="true" />
<element signature="e#469#470#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</split-second>
</splitter>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="JUnit5 Test Class" />
<option value="Class" />
<option value="Interface" />
<option value="Class" />
</list>
</option>
</component>
@ -89,24 +177,24 @@
<list>
<option value="$PROJECT_DIR$/src/model/Adress.java" />
<option value="$PROJECT_DIR$/src/model/Customer.java" />
<option value="$PROJECT_DIR$/tests/services/OrderServiceTest.java" />
<option value="$PROJECT_DIR$/tests/model/PizzaTest.java" />
<option value="$PROJECT_DIR$/src/services/PizzaService.java" />
<option value="$PROJECT_DIR$/src/model/OrderException.java" />
<option value="$PROJECT_DIR$/src/services/OrderService.java" />
<option value="$PROJECT_DIR$/src/services/IPizzaService.java" />
<option value="$PROJECT_DIR$/src/view/PizzaListPanel.java" />
<option value="$PROJECT_DIR$/src/model/exceptions/OrderException.java" />
<option value="$PROJECT_DIR$/src/services/dummy/PizzaServiceDummy.java" />
<option value="$PROJECT_DIR$/src/services/impl/OrderService.java" />
<option value="$PROJECT_DIR$/src/services/impl/PizzaService.java" />
<option value="$PROJECT_DIR$/src/services/interfaces/IPizzaService.java" />
<option value="$PROJECT_DIR$/src/services/io/PizzaIOHandler.java" />
<option value="$PROJECT_DIR$/src/view/MainFrame.java" />
<option value="$PROJECT_DIR$/src/view/PizzaConfiguratorPanel.java" />
<option value="$PROJECT_DIR$/tests/model/OrderTest.java" />
<option value="$PROJECT_DIR$/src/model/Order.java" />
<option value="$PROJECT_DIR$/src/model/Pizza.java" />
<option value="$PROJECT_DIR$/src/services/dummy/PizzaServiceDummy.java" />
<option value="$PROJECT_DIR$/src/model/Order.java" />
<option value="$PROJECT_DIR$/tests/model/PizzaTest.java" />
<option value="$PROJECT_DIR$/tests/model/OrderTest.java" />
<option value="$PROJECT_DIR$/src/services/impl/OrderService.java" />
<option value="$PROJECT_DIR$/tests/services/OrderServiceTest.java" />
</list>
</option>
</component>
@ -116,36 +204,10 @@
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectConfigurationFiles">
<option name="files">
<list>
<option value="$PROJECT_DIR$/.idea/vcs.xml" />
<option value="$PROJECT_DIR$/.idea/saveactions_settings.xml" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="240" />
<option name="y" value="131" />
<option name="width" value="1440" />
<option name="height" value="786" />
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
<State>
<id>Kotlin</id>
</State>
<State>
<id>Style issuesKotlin</id>
</State>
</expanded-state>
</profile-state>
</entry>
<option name="x" value="1280" />
<option name="width" value="2560" />
<option name="height" value="1410" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
@ -153,7 +215,6 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
@ -179,6 +240,13 @@
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="services" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="de.hhn.ai.prog2.blatt7.junit" type="b2602c69:ProjectViewProjectNode" />
<item name="de.hhn.ai.prog2.blatt7.junit" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="services" type="462c0819:PsiDirectoryNode" />
<item name="impl" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="de.hhn.ai.prog2.blatt7.junit" type="b2602c69:ProjectViewProjectNode" />
<item name="de.hhn.ai.prog2.blatt7.junit" type="462c0819:PsiDirectoryNode" />
@ -190,11 +258,17 @@
<item name="tests" type="462c0819:PsiDirectoryNode" />
<item name="model" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="de.hhn.ai.prog2.blatt7.junit" type="b2602c69:ProjectViewProjectNode" />
<item name="de.hhn.ai.prog2.blatt7.junit" type="462c0819:PsiDirectoryNode" />
<item name="tests" type="462c0819:PsiDirectoryNode" />
<item name="services" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="AndroidView" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
@ -203,6 +277,7 @@
<property name="Repository.Attach.Annotations" value="false" />
<property name="Repository.Attach.JavaDocs" value="false" />
<property name="Repository.Attach.Sources" value="false" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit5" />
@ -212,7 +287,7 @@
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="settings.saveactions" />
<property name="settings.editor.selected.configurable" value="editor.preferences.fonts.default" />
</component>
<component name="RecentsManager">
<key name="CreateTestDialog.RecentsKey">
@ -226,6 +301,7 @@
<recent name="" />
</key>
<key name="CreateClassDialog.RecentsKey">
<recent name="services" />
<recent name="model.exceptions" />
</key>
</component>
@ -241,13 +317,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="JUnit.OrderTest">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file id="idea.log" enabled="true" />
</configuration>
<component name="RunManager" selected="JUnit.OrderServiceTest">
<configuration default="true" type="Applet">
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<method v="2">
@ -267,22 +337,24 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="PizzaServiceDummy" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="services.dummy.PizzaServiceDummy" />
<module name="TestGPI2" />
<configuration default="true" type="Application" factoryName="Application">
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="services.dummy.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<configuration name="OrderServiceTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="PizzaProject" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="services.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="services" />
<option name="MAIN_CLASS_NAME" value="services.OrderServiceTest" />
<option name="TEST_OBJECT" value="class" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<method v="2">
<option name="Make" enabled="true" />
</method>
@ -303,6 +375,39 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="PizzaTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="PizzaProject" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="model.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="model" />
<option name="MAIN_CLASS_NAME" value="model.PizzaTest" />
<option name="TEST_OBJECT" value="class" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="PizzaTest.removeTopping" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="PizzaProject" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="model.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="model" />
<option name="MAIN_CLASS_NAME" value="model.PizzaTest" />
<option name="METHOD_NAME" value="removeTopping" />
<option name="TEST_OBJECT" value="method" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<option name="TEST_OBJECT" value="class" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
@ -319,16 +424,29 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file enabled="true" id="idea.log" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<list>
<item itemvalue="Application.Order" />
<item itemvalue="Application.PizzaServiceDummy" />
<item itemvalue="JUnit.OrderTest" />
<item itemvalue="JUnit.PizzaTest" />
<item itemvalue="JUnit.PizzaTest.removeTopping" />
<item itemvalue="JUnit.OrderServiceTest" />
</list>
<recent_temporary>
<list>
<item itemvalue="JUnit.OrderServiceTest" />
<item itemvalue="JUnit.OrderTest" />
<item itemvalue="JUnit.PizzaTest" />
<item itemvalue="JUnit.PizzaTest.removeTopping" />
<item itemvalue="Application.Order" />
<item itemvalue="Application.PizzaServiceDummy" />
</list>
</recent_temporary>
</component>
@ -356,18 +474,45 @@
<servers />
</component>
<component name="TestHistory">
<history-entry file="OrderTest - 2019.06.18 at 11h 42m 41s.xml">
<history-entry file="OrderTest - 2019.06.27 at 18h 03m 27s.xml">
<configuration name="OrderTest" configurationId="JUnit" />
</history-entry>
<history-entry file="OrderTest - 2019.06.27 at 18h 05m 40s.xml">
<configuration name="OrderTest" configurationId="JUnit" />
</history-entry>
<history-entry file="PizzaTest - 2019.06.27 at 18h 06m 59s.xml">
<configuration name="PizzaTest" configurationId="JUnit" />
</history-entry>
<history-entry file="PizzaTest - 2019.06.27 at 18h 07m 13s.xml">
<configuration name="PizzaTest" configurationId="JUnit" />
</history-entry>
<history-entry file="PizzaTest - 2019.06.27 at 18h 09m 12s.xml">
<configuration name="PizzaTest" configurationId="JUnit" />
</history-entry>
<history-entry file="OrderTest - 2019.06.27 at 18h 09m 20s.xml">
<configuration name="OrderTest" configurationId="JUnit" />
</history-entry>
<history-entry file="OrderTest - 2019.06.27 at 18h 09m 56s.xml">
<configuration name="OrderTest" configurationId="JUnit" />
</history-entry>
<history-entry file="OrderServiceTest - 2019.06.27 at 18h 21m 46s.xml">
<configuration name="OrderServiceTest" configurationId="JUnit" />
</history-entry>
<history-entry file="OrderServiceTest - 2019.06.27 at 18h 22m 35s.xml">
<configuration name="OrderServiceTest" configurationId="JUnit" />
</history-entry>
<history-entry file="OrderServiceTest - 2019.06.27 at 18h 22m 57s.xml">
<configuration name="OrderServiceTest" configurationId="JUnit" />
</history-entry>
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="21861000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1920" height="1048" extended-state="6" />
<frame x="1280" y="0" width="2560" height="1410" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2768903" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.12619048" />
<window_info id="Structure" order="1" weight="0.25" />
<window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" />
@ -376,7 +521,7 @@
<window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.3286638" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.28892332" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@ -384,7 +529,7 @@
<window_info anchor="bottom" id="Terminal" order="7" weight="0.3297414" />
<window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
<window_info anchor="bottom" id="Version Control" order="9" />
<window_info anchor="bottom" id="Messages" order="10" weight="0.3286638" />
<window_info anchor="bottom" id="Messages" order="10" weight="0.32842758" />
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@ -439,34 +584,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/services/dummy/PizzaServiceDummy.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="65" selection-start-line="65" selection-end-line="65" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tests/model/PizzaTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="27" column="20" selection-start-line="27" selection-start-column="20" selection-end-line="27" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tests/services/OrderServiceTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="32" column="5" selection-start-line="32" selection-start-column="5" selection-end-line="32" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/services/impl/OrderService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="364">
<caret line="25" column="5" selection-start-line="25" selection-start-column="5" selection-end-line="25" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/services/impl/PizzaService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315">
@ -502,13 +619,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/view/PizzaListPanel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="11" column="13" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/view/PizzaConfiguratorPanel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
@ -516,37 +626,111 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tests/model/OrderTest.java">
<entry file="file://$PROJECT_DIR$/src/view/PizzaListPanel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="525">
<caret line="37" column="5" selection-start-line="37" selection-start-column="5" selection-end-line="37" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="105">
<caret line="11" column="13" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/model/Order.java">
<entry file="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.5.0-RC2/junit-jupiter-api-5.5.0-RC2.jar!/org/junit/jupiter/api/function/Executable.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="960">
<caret line="78" selection-start-line="78" selection-end-line="78" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="240">
<caret line="16" column="9" selection-start-line="16" selection-start-column="9" selection-end-line="16" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/model/Pizza.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="686">
<caret line="83" column="32" selection-start-line="83" selection-start-column="32" selection-end-line="83" selection-end-column="32" />
<state relative-caret-position="692">
<caret line="100" column="5" selection-start-line="100" selection-start-column="5" selection-end-line="100" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#781#782#0" expanded="true" />
<element signature="e#821#822#0" expanded="true" />
<element signature="e#850#851#0" expanded="true" />
<element signature="e#877#878#0" expanded="true" />
<element signature="e#915#916#0" expanded="true" />
<element signature="e#947#948#0" expanded="true" />
<element signature="e#1978#1979#0" expanded="true" />
<element signature="e#2017#2018#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tests/model/PizzaTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="767">
<caret line="54" selection-start-line="54" selection-end-line="54" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#377#378#0" expanded="true" />
<element signature="e#440#441#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/services/dummy/PizzaServiceDummy.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="495">
<caret line="42" selection-start-line="42" selection-end-line="42" />
<folding>
<element signature="e#1846#1847#0" expanded="true" />
<element signature="e#1930#1931#0" expanded="true" />
<element signature="e#2043#2044#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/services/Date.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="13" selection-start-line="2" selection-start-column="13" selection-end-line="2" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/model/Order.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="752">
<caret line="102" column="7" selection-start-line="102" selection-start-column="7" selection-end-line="102" selection-end-column="7" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tests/model/OrderTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1200">
<caret line="80" column="40" selection-start-line="80" selection-start-column="40" selection-end-line="80" selection-end-column="40" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/services/impl/OrderService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="435">
<caret line="33" column="39" selection-start-line="33" selection-start-column="39" selection-end-line="33" selection-end-column="39" />
<folding>
<element signature="e#274#275#0" expanded="true" />
<element signature="e#310#311#0" expanded="true" />
<element signature="e#379#380#0" expanded="true" />
<element signature="e#407#408#0" expanded="true" />
<element signature="e#448#449#0" expanded="true" />
<element signature="e#469#470#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tests/services/OrderServiceTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="842">
<caret line="75" column="22" selection-start-line="75" selection-start-column="22" selection-end-line="75" selection-end-column="22" />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>

View file

@ -32,5 +32,17 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library name="JUnit5.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.5.0-RC2/junit-jupiter-api-5.5.0-RC2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.5.0-RC2/junit-platform-commons-1.5.0-RC2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

View file

@ -22,6 +22,7 @@ public class Order {
this.customer = customer;
this.pizzas = pizzas;
this.date = date;
state = OrderState.IN_PROGRESS;
}
public String getCustomer() {
@ -73,6 +74,8 @@ public class Order {
this.state = state;
}
public OrderState getOrderState() {return this.state;}
public Date getDate() {
return date;
}

View file

@ -21,10 +21,13 @@ public class Pizza {
* Add a topping to the pizza. The same topping can be added twice to duplicate the amount.
*
* @param t
* @throws IllegalArgumentException more than 2 toppings of the same type aren't allowed
*/
public void addTopping(Toppings t) {
if (Collections.frequency(toppings, t) < 2)
this.toppings.add(t);
else
throw new IllegalArgumentException();
}

View file

@ -33,7 +33,10 @@ public class PizzaServiceDummy implements IPizzaService {
for (int i = 0; i < toppingCounter; i++) {
Pizza.Toppings t = getRandomTopping();
p.addTopping(t);
try {
p.addTopping(t);
} catch (IllegalArgumentException e) {}
}
p.setSize(getRandomSize());
p.setName(generateRandomName());

View file

@ -3,6 +3,7 @@ package services.impl;
import model.Order;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import java.util.ArrayList;
import java.util.List;
public class OrderService {
@ -11,29 +12,31 @@ public class OrderService {
public OrderService(List<Order> orders) {
this.orders = orders;
//TODO
throw new NotImplementedException();
}
public void addOrder(Order o) {
//TODO
throw new NotImplementedException();
orders.add(o);
}
public void removeOrder(Order o) {
//TODO
throw new NotImplementedException();
orders.remove(o);
}
public List<Order> getAllNonDeliverdOrder() {
//TODO
throw new NotImplementedException();
//return null;
List<Order> ret = new ArrayList<>();
for(Order order : orders) {
if(order.getOrderState() != Order.OrderState.DELIVERD)
ret.add(order);
}
return ret;
}
public List<Order> getAllDeliverdOder() {
//TODO
throw new NotImplementedException();
// return null;
public List<Order> getAllDeliverdOrder() {
List<Order> ret = new ArrayList<>();
for(Order order : orders) {
if(order.getOrderState() == Order.OrderState.DELIVERD)
ret.add(order);
}
return ret;
}
}

View file

@ -1,25 +1,49 @@
package model;
import model.exceptions.OrderException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.*;
import static org.junit.jupiter.api.Assertions.*;
class OrderTest {
private List<Pizza> pizzas;
private Order order;
@BeforeEach
void setUp() {
pizzas = new ArrayList<>(Arrays.asList(new Pizza(), new Pizza()));
order = new Order("Max Mustermann", pizzas, new Date());
}
@Test
void getCustomer() {
assertEquals("Max Mustermann", order.getCustomer());
assertNotEquals("Wrong", order.getCustomer());
}
@Test
void setCustomer() {
order.setCustomer("Max Mustermann 2");
assertEquals("Max Mustermann 2", order.getCustomer());
assertNotEquals("Max Mustermann", order.getCustomer());
}
@Test
void getPizzas() {
assertEquals(pizzas, order.getPizzas());
assertNotEquals(Arrays.asList(new Pizza(), new Pizza()), order.getPizzas());
}
@Test
void setPizzas() {
void setPizzas() throws OrderException {
List<Pizza> newPizzas = new ArrayList<>(Arrays.asList(new Pizza(), new Pizza()));
order.setPizzas(newPizzas);
assertEquals(newPizzas, order.getPizzas());
assertNotEquals(pizzas, order.getPizzas());
}
/**
@ -27,25 +51,35 @@ class OrderTest {
*/
@Test
void addPizzaAfterCompletion() {
order.setOrderState(Order.OrderState.DELIVERD);
assertThrows(OrderException.class, () -> order.setPizzas(pizzas));
}
/**
* Tests if the pizza is added to the pizza List.
*/
@Test
void addPizzaBeforCompletion() {
void addPizzaBeforeCompletion() throws OrderException {
order.addPizza(new Pizza());
}
@Test
void setOrderState() {
}
@Test
void getDate() {
order.setOrderState(Order.OrderState.DELIVERD);
assertEquals(Order.OrderState.DELIVERD, order.getOrderState());
assertNotEquals(Order.OrderState.WAIT, order.getOrderState());
}
@Test
void setDate() {
Date today = new Date();
Calendar c = Calendar.getInstance();
c.setTime(today);
c.add(Calendar.DAY_OF_MONTH, 21);
Date currentDatePlus21d = c.getTime();
assertThrows(IllegalArgumentException.class, () -> order.setDate(currentDatePlus21d));
c.add(Calendar.DAY_OF_MONTH, -2);
Date currentDatePlus19d = c.getTime();
assertDoesNotThrow(() -> order.setDate(currentDatePlus19d));
}
}

View file

@ -3,13 +3,17 @@ package model;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import services.dummy.PizzaServiceDummy;
import static org.junit.jupiter.api.Assertions.*;
class PizzaTest {
private PizzaServiceDummy pizzaServiceDummy = new PizzaServiceDummy();
private Pizza pizza;
@BeforeEach
void setUp() {
pizza = pizzaServiceDummy.generateRandomPizza();
}
@AfterEach
@ -18,17 +22,35 @@ class PizzaTest {
@Test
void addTopping() {
Pizza pizza2 = new Pizza();
Pizza.Toppings topping = pizzaServiceDummy.getRandomTopping();
pizza2.addTopping(topping);
pizza2.addTopping(topping);
assertThrows(IllegalArgumentException.class, () -> pizza2.addTopping(topping));
}
@Test
void setSize() {
Pizza.Size size = pizzaServiceDummy.getRandomSize();
pizza.setSize(size);
assertEquals(size, pizza.getSize());
pizza.setSize(Pizza.Size.LARGE);
assertNotEquals(Pizza.Size.SMALL, pizza.getSize());
}
@Test
void setName() {
pizza.setName("Test 123");
assertEquals("Test 123", pizza.getName());
assertNotEquals("Wrong", pizza.getName());
}
@Test
void removeTopping() {
Pizza pizza2 = new Pizza();
Pizza.Toppings topping = pizzaServiceDummy.getRandomTopping();
pizza2.addTopping(topping);
pizza2.removeTopping(topping);
assertFalse(pizza2.getToppings().contains(topping));
}
}

View file

@ -1,15 +1,43 @@
package services;
import model.Order;
import model.Pizza;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import services.impl.OrderService;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
class OrderServiceTest {
OrderService service;
List<Order> orders;
Order newOrder;
@BeforeEach
void setUp() {
orders = new ArrayList<>(Arrays.asList(
new Order(
"Max Mustermann",
new ArrayList<>(Arrays.asList(new Pizza(), new Pizza())),
new Date()
),
new Order(
"Frau Musterfrau",
new ArrayList<>(Arrays.asList(new Pizza(), new Pizza())),
new Date()
)));
service = new OrderService(orders);
newOrder = new Order(
"New Order",
new ArrayList<>(Arrays.asList(new Pizza(), new Pizza())),
new Date()
);
}
@AfterEach
@ -18,17 +46,33 @@ class OrderServiceTest {
@Test
void addOrder() {
assertFalse(service.getAllNonDeliverdOrder().contains(newOrder));
service.addOrder(newOrder);
assertTrue(service.getAllNonDeliverdOrder().contains(newOrder));
}
@Test
void removeOrder() {
assertFalse(service.getAllNonDeliverdOrder().contains(newOrder));
service.addOrder(newOrder);
assertTrue(service.getAllNonDeliverdOrder().contains(newOrder));
service.removeOrder(newOrder);
assertFalse(service.getAllNonDeliverdOrder().contains(newOrder));
}
@Test
void getAllNonDeliverdOrder() {
assertEquals(2, service.getAllNonDeliverdOrder().size());
newOrder.setOrderState(Order.OrderState.DELIVERD);
service.addOrder(newOrder);
assertEquals(2, service.getAllNonDeliverdOrder().size());
}
@Test
void getAllDeliverdOder() {
assertEquals(0, service.getAllDeliverdOrder().size());
newOrder.setOrderState(Order.OrderState.DELIVERD);
service.addOrder(newOrder);
assertEquals(1, service.getAllDeliverdOrder().size());
}
}