diff --git a/de.hhn.ai.prog2.blatt7.junit/.idea/codeStyles/codeStyleConfig.xml b/de.hhn.ai.prog2.blatt7.junit/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..a55e7a1
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/de.hhn.ai.prog2.blatt7.junit/.idea/misc.xml b/de.hhn.ai.prog2.blatt7.junit/.idea/misc.xml
new file mode 100644
index 0000000..787fc23
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/de.hhn.ai.prog2.blatt7.junit/.idea/modules.xml b/de.hhn.ai.prog2.blatt7.junit/.idea/modules.xml
new file mode 100644
index 0000000..0c60a9e
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/de.hhn.ai.prog2.blatt7.junit/.idea/saveactions_settings.xml b/de.hhn.ai.prog2.blatt7.junit/.idea/saveactions_settings.xml
new file mode 100644
index 0000000..85aedc2
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/.idea/saveactions_settings.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/de.hhn.ai.prog2.blatt7.junit/.idea/uiDesigner.xml b/de.hhn.ai.prog2.blatt7.junit/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/de.hhn.ai.prog2.blatt7.junit/.idea/vcs.xml b/de.hhn.ai.prog2.blatt7.junit/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/de.hhn.ai.prog2.blatt7.junit/.idea/workspace.xml b/de.hhn.ai.prog2.blatt7.junit/.idea/workspace.xml
new file mode 100644
index 0000000..807f762
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/.idea/workspace.xml
@@ -0,0 +1,637 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Kotlin
+
+
+ Style issuesKotlin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1556781177162
+
+
+ 1556781177162
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No facets are configured
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+ PizzaProject
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/de.hhn.ai.prog2.blatt7.junit/PizzaProject.iml b/de.hhn.ai.prog2.blatt7.junit/PizzaProject.iml
new file mode 100644
index 0000000..e2f89a7
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/PizzaProject.iml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Order$OrderState.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Order$OrderState.class
new file mode 100644
index 0000000..8cf1ddb
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Order$OrderState.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Order.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Order.class
new file mode 100644
index 0000000..c90ee54
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Order.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Pizza$Size.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Pizza$Size.class
new file mode 100644
index 0000000..528adb7
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Pizza$Size.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Pizza$Toppings.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Pizza$Toppings.class
new file mode 100644
index 0000000..77beb91
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Pizza$Toppings.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Pizza.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Pizza.class
new file mode 100644
index 0000000..512d03f
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/Pizza.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/exceptions/OrderException.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/exceptions/OrderException.class
new file mode 100644
index 0000000..9b3bd44
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/model/exceptions/OrderException.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/dummy/PizzaServiceDummy.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/dummy/PizzaServiceDummy.class
new file mode 100644
index 0000000..e300bf0
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/dummy/PizzaServiceDummy.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/impl/OrderService.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/impl/OrderService.class
new file mode 100644
index 0000000..9bed23b
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/impl/OrderService.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/impl/PizzaService.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/impl/PizzaService.class
new file mode 100644
index 0000000..ca4f772
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/impl/PizzaService.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/interfaces/IPizzaService.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/interfaces/IPizzaService.class
new file mode 100644
index 0000000..ab6c942
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/interfaces/IPizzaService.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/io/PizzaIOHandler.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/io/PizzaIOHandler.class
new file mode 100644
index 0000000..deea7b1
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/services/io/PizzaIOHandler.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/view/MainFrame.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/view/MainFrame.class
new file mode 100644
index 0000000..1fd8fe8
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/view/MainFrame.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/view/PizzaConfiguratorPanel.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/view/PizzaConfiguratorPanel.class
new file mode 100644
index 0000000..885c035
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/view/PizzaConfiguratorPanel.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/view/PizzaListPanel.class b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/view/PizzaListPanel.class
new file mode 100644
index 0000000..736f794
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/PizzaProject/view/PizzaListPanel.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Order$OrderState.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Order$OrderState.class
new file mode 100644
index 0000000..b28225e
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Order$OrderState.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Order.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Order.class
new file mode 100644
index 0000000..b39ddb1
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Order.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Pizza$Size.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Pizza$Size.class
new file mode 100644
index 0000000..fbc7c08
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Pizza$Size.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Pizza$Toppings.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Pizza$Toppings.class
new file mode 100644
index 0000000..e4c71ff
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Pizza$Toppings.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Pizza.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Pizza.class
new file mode 100644
index 0000000..35838f2
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/Pizza.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/exceptions/OrderException.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/exceptions/OrderException.class
new file mode 100644
index 0000000..9b3bd44
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/model/exceptions/OrderException.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/dummy/PizzaServiceDummy.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/dummy/PizzaServiceDummy.class
new file mode 100644
index 0000000..91b7041
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/dummy/PizzaServiceDummy.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/impl/OrderService.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/impl/OrderService.class
new file mode 100644
index 0000000..f1497c2
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/impl/OrderService.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/impl/PizzaService.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/impl/PizzaService.class
new file mode 100644
index 0000000..ca4f772
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/impl/PizzaService.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/interfaces/IPizzaService.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/interfaces/IPizzaService.class
new file mode 100644
index 0000000..ab6c942
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/interfaces/IPizzaService.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/io/PizzaIOHandler.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/io/PizzaIOHandler.class
new file mode 100644
index 0000000..deea7b1
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/services/io/PizzaIOHandler.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/view/MainFrame.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/view/MainFrame.class
new file mode 100644
index 0000000..77623f0
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/view/MainFrame.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/view/PizzaConfiguratorPanel.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/view/PizzaConfiguratorPanel.class
new file mode 100644
index 0000000..d6679a0
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/view/PizzaConfiguratorPanel.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/view/PizzaListPanel.class b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/view/PizzaListPanel.class
new file mode 100644
index 0000000..8a6e6c1
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/production/TestGPI2/view/PizzaListPanel.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/test/PizzaProject/model/OrderTest.class b/de.hhn.ai.prog2.blatt7.junit/out/test/PizzaProject/model/OrderTest.class
new file mode 100644
index 0000000..eabf10b
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/test/PizzaProject/model/OrderTest.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/test/PizzaProject/model/PizzaTest.class b/de.hhn.ai.prog2.blatt7.junit/out/test/PizzaProject/model/PizzaTest.class
new file mode 100644
index 0000000..f53ad21
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/test/PizzaProject/model/PizzaTest.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/test/PizzaProject/services/OrderServiceTest.class b/de.hhn.ai.prog2.blatt7.junit/out/test/PizzaProject/services/OrderServiceTest.class
new file mode 100644
index 0000000..c674935
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/test/PizzaProject/services/OrderServiceTest.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/test/TestGPI2/model/OrderTest.class b/de.hhn.ai.prog2.blatt7.junit/out/test/TestGPI2/model/OrderTest.class
new file mode 100644
index 0000000..672f292
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/test/TestGPI2/model/OrderTest.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/test/TestGPI2/model/PizzaTest.class b/de.hhn.ai.prog2.blatt7.junit/out/test/TestGPI2/model/PizzaTest.class
new file mode 100644
index 0000000..f53ad21
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/test/TestGPI2/model/PizzaTest.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/out/test/TestGPI2/services/OrderServiceTest.class b/de.hhn.ai.prog2.blatt7.junit/out/test/TestGPI2/services/OrderServiceTest.class
new file mode 100644
index 0000000..c674935
Binary files /dev/null and b/de.hhn.ai.prog2.blatt7.junit/out/test/TestGPI2/services/OrderServiceTest.class differ
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/model/Order.java b/de.hhn.ai.prog2.blatt7.junit/src/model/Order.java
new file mode 100644
index 0000000..4a29a90
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/model/Order.java
@@ -0,0 +1,127 @@
+package model;
+
+import model.exceptions.OrderException;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * This class represent a typical order in our shop.
+ */
+public class Order {
+
+ private String customer;
+ private List pizzas;
+ private Date date;
+ private OrderState state;
+
+ public Order(String customer, List pizzas, Date date) {
+ this.customer = customer;
+ this.pizzas = pizzas;
+ this.date = date;
+ }
+
+ public String getCustomer() {
+ return customer;
+ }
+
+ /**
+ * Set the customer. This is not possible if the order is already deliverd
+ *
+ * @param customer
+ */
+ public void setCustomer(String customer) {
+ if(this.state == OrderState.IN_PROGRESS)
+ this.customer = customer;
+ }
+
+ public List getPizzas() {
+ return pizzas;
+ }
+
+ /**
+ * Set the pizzas.
+ *
+ * @param pizzas
+ * @throws OrderException if {@see state} is not in {@link OrderState#IN_PROGRESS}.
+ */
+ public void setPizzas(List pizzas) throws OrderException {
+ if(this.state == OrderState.IN_PROGRESS)
+ this.pizzas = pizzas;
+ else throw new OrderException();
+ }
+
+ /**
+ * Add pizza p to the order
+ *
+ * @param p
+ * @throws OrderException if {@see state} is not in {@link OrderState#IN_PROGRESS}.
+ */
+ public void addPizza(Pizza p) throws OrderException {
+ if(this.state == OrderState.IN_PROGRESS)
+ this.pizzas.add(p);
+ else throw new OrderException();
+ }
+
+ /**
+ * @param state the state to be set.
+ */
+ public void setOrderState(OrderState state) {
+ this.state = state;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ /**
+ * Set the Time of the Order
+ *
+ * @param date
+ * @throws IllegalArgumentException if the Order is in the future.
+ */
+ public void setDate(Date date) throws IllegalArgumentException {
+ Date today = new Date();
+ Calendar c = Calendar.getInstance();
+ c.setTime(today);
+ c.add(Calendar.DAY_OF_MONTH, 20);
+ Date currentDatePlus20d = c.getTime();
+
+ if(date.before(currentDatePlus20d))
+ this.date = date;
+ else throw new IllegalArgumentException();
+ }
+
+ /**
+ * State of the order.
+ */
+ public enum OrderState {
+ /**
+ * Customer enter all items
+ */
+ IN_PROGRESS,
+ /**
+ * Customer finish order, waiting to be prepared
+ */
+ WAIT,
+ /**
+ * Order is in preperatopion
+ */
+ IN_PREPERATION,
+ /**
+ * Order is cooked
+ */
+ ORDER_COMPLET,
+ /**
+ * Order is in delivery by the waiter or deliveryman
+ */
+ IN_DELIVERY,
+ /**
+ * Order is finished completely.
+ */
+ DELIVERD
+ }
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/model/Pizza.java b/de.hhn.ai.prog2.blatt7.junit/src/model/Pizza.java
new file mode 100644
index 0000000..3195020
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/model/Pizza.java
@@ -0,0 +1,103 @@
+package model;
+
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+public class Pizza {
+
+ private List toppings = new ArrayList<>();
+ private Size size;
+ private String name;
+
+ public List getToppings() {
+ return toppings;
+ }
+
+ /**
+ * Add a topping to the pizza. The same topping can be added twice to duplicate the amount.
+ *
+ * @param t
+ */
+ public void addTopping(Toppings t) {
+ if (Collections.frequency(toppings, t) < 2)
+ this.toppings.add(t);
+ }
+
+
+ public void setToppings(List toppings) {
+ this.toppings = toppings;
+ }
+
+ public Size getSize() {
+ return size;
+ }
+
+ public void setSize(Size size) {
+ this.size = size;
+ }
+
+ /**
+ * Set the pizza Size in cm.
+ * A pizza under 15cm is small.
+ * Between 15cm and 20cm medium and over 20 cm large.
+ *
+ * @param dimension
+ * @throws IllegalArgumentException if the size is above 25cm
+ */
+ public void setSize(int dimension) throws IllegalArgumentException {
+ if (dimension > 25)
+ throw new IllegalArgumentException();
+ else if (dimension > 20)
+ this.size = Size.LARGE;
+ else if (dimension >= 15)
+ this.size = Size.MEDIUM;
+ else
+ this.size = Size.SMALL;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set the name of the pizza. Also special charakters as !=?... are not allowed. If the name is empty a default name is set.
+ *
+ * @param name
+ */
+ public void setName(String name) {
+ if (name.isEmpty())
+ this.name = new Date().toString();
+ else
+ this.name = name;
+ }
+
+ /**
+ * Removes the topping t
+ *
+ * @param t
+ */
+ public void removeTopping(Toppings t) {
+ this.toppings.remove(t);
+ }
+
+ public String toString() {
+ String toppingString = "";
+ for (Toppings t : toppings) {
+
+ toppingString += t + "/";
+ }
+ return "Name " + getName() + ", Size :" + getSize() + "Toppings:" + toppingString;
+ }
+
+ public enum Toppings {Cheese, Tomato, Ham, Chicken, PineApple, Pepperonie}
+
+ ;
+
+ public enum Size {SMALL, MEDIUM, LARGE}
+
+ ;
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/model/exceptions/OrderException.java b/de.hhn.ai.prog2.blatt7.junit/src/model/exceptions/OrderException.java
new file mode 100644
index 0000000..d68181d
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/model/exceptions/OrderException.java
@@ -0,0 +1,5 @@
+package model.exceptions;
+
+public class OrderException extends Exception {
+
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/services/dummy/PizzaServiceDummy.java b/de.hhn.ai.prog2.blatt7.junit/src/services/dummy/PizzaServiceDummy.java
new file mode 100644
index 0000000..3ec45d8
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/services/dummy/PizzaServiceDummy.java
@@ -0,0 +1,76 @@
+package services.dummy;
+
+import model.Pizza;
+import services.interfaces.IPizzaService;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+public class PizzaServiceDummy implements IPizzaService {
+ private Random random = new Random();
+ private List pizzas;
+
+ public PizzaServiceDummy() {
+ pizzas = getListOfRandomPizzas(20);
+ }
+
+ public List getListOfRandomPizzas(int number) {
+ List list = new ArrayList<>();
+ for (int i = 0; i < number; i++) {
+ Pizza p = generateRandomPizza();
+ list.add(p);
+ }
+ return list;
+ }
+
+ public Pizza generateRandomPizza() {
+ Pizza p = new Pizza();
+
+ int toppingCounter = random.nextInt(10) + 1;
+ for (int i = 0; i < toppingCounter; i++) {
+
+ Pizza.Toppings t = getRandomTopping();
+ p.addTopping(t);
+ }
+ p.setSize(getRandomSize());
+ p.setName(generateRandomName());
+
+ return p;
+ }
+
+ public Pizza.Toppings getRandomTopping() {
+ Pizza.Toppings[] toppings = Pizza.Toppings.values();
+ int t = random.nextInt(toppings.length - 1);
+ return toppings[t];
+ }
+
+ public Pizza.Size getRandomSize() {
+ Pizza.Size[] sizes = Pizza.Size.values();
+ int t = random.nextInt(sizes.length - 1);
+ return sizes[t];
+ }
+
+ public String generateRandomName() {
+ byte[] array = new byte[7]; // length is bounded by 7
+ new Random().nextBytes(array);
+ return new String(array, Charset.forName("UTF-8"));
+ }
+
+ @Override
+ public void saveNewPizza(Pizza p) {
+ pizzas.add(p);
+ }
+
+ @Override
+ public List getAllPizzas() {
+ return pizzas;
+ }
+
+ @Override
+ public Pizza getPizzaByNAme(String name) {
+ throw new NotImplementedException();
+ }
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/services/impl/OrderService.java b/de.hhn.ai.prog2.blatt7.junit/src/services/impl/OrderService.java
new file mode 100644
index 0000000..5a2ac62
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/services/impl/OrderService.java
@@ -0,0 +1,39 @@
+package services.impl;
+
+import model.Order;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+import java.util.List;
+
+public class OrderService {
+
+ private List orders;
+
+ public OrderService(List orders) {
+ this.orders = orders;
+ //TODO
+ throw new NotImplementedException();
+ }
+
+ public void addOrder(Order o) {
+ //TODO
+ throw new NotImplementedException();
+ }
+
+ public void removeOrder(Order o) {
+ //TODO
+ throw new NotImplementedException();
+ }
+
+ public List getAllNonDeliverdOrder() {
+ //TODO
+ throw new NotImplementedException();
+ //return null;
+ }
+
+ public List getAllDeliverdOder() {
+ //TODO
+ throw new NotImplementedException();
+ // return null;
+ }
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/services/impl/PizzaService.java b/de.hhn.ai.prog2.blatt7.junit/src/services/impl/PizzaService.java
new file mode 100644
index 0000000..34162f9
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/services/impl/PizzaService.java
@@ -0,0 +1,25 @@
+package services.impl;
+
+import model.Pizza;
+import services.io.PizzaIOHandler;
+
+import java.util.List;
+
+public class PizzaService {
+ private PizzaIOHandler pizzaIOHandler;
+ private List pizzas;
+
+ public void saveNewPizza(Pizza p) {
+ pizzas.add(p);
+ pizzaIOHandler.savePizzas(pizzas);
+ }
+
+ public void loadPizzas() {
+ //Filechooser und
+ pizzas = pizzaIOHandler.loadPizzas("filename");
+ }
+
+ public List getAllPizzas() {
+ return pizzas;
+ }
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/services/interfaces/IPizzaService.java b/de.hhn.ai.prog2.blatt7.junit/src/services/interfaces/IPizzaService.java
new file mode 100644
index 0000000..4cf1f16
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/services/interfaces/IPizzaService.java
@@ -0,0 +1,26 @@
+package services.interfaces;
+
+import model.Pizza;
+
+import java.util.List;
+
+public interface IPizzaService {
+
+ /**
+ * Save the pizza p
+ *
+ * @param p
+ */
+ public void saveNewPizza(Pizza p);
+
+ /**
+ * @return all Pizzas that have been created
+ */
+ public List getAllPizzas();
+
+ /**
+ * @param name
+ * @return Pizza with the name name.
+ */
+ public Pizza getPizzaByNAme(String name);
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/services/io/PizzaIOHandler.java b/de.hhn.ai.prog2.blatt7.junit/src/services/io/PizzaIOHandler.java
new file mode 100644
index 0000000..51e953a
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/services/io/PizzaIOHandler.java
@@ -0,0 +1,16 @@
+package services.io;
+
+import model.Pizza;
+
+import java.util.List;
+
+public class PizzaIOHandler {
+
+ public void savePizzas(List p) {
+
+ }
+
+ public List loadPizzas(String filename) {
+ return null;
+ }
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/view/MainFrame.java b/de.hhn.ai.prog2.blatt7.junit/src/view/MainFrame.java
new file mode 100644
index 0000000..831d701
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/view/MainFrame.java
@@ -0,0 +1,16 @@
+package view;
+
+import javax.swing.*;
+
+/**
+ * Excample implementastion of a Main Frame.
+ */
+public class MainFrame extends JFrame {
+ private PizzaConfiguratorPanel configuratorPanel;
+ private PizzaListPanel listPanel;
+
+ public void updateAllViews() {
+ listPanel.update();
+ configuratorPanel.update();
+ }
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/view/PizzaConfiguratorPanel.java b/de.hhn.ai.prog2.blatt7.junit/src/view/PizzaConfiguratorPanel.java
new file mode 100644
index 0000000..99c7cee
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/view/PizzaConfiguratorPanel.java
@@ -0,0 +1,25 @@
+package view;
+
+import model.Pizza;
+import services.impl.PizzaService;
+
+import javax.swing.*;
+
+/**
+ * Example implementation of a custom Panel
+ */
+public class PizzaConfiguratorPanel extends JPanel {
+
+ private PizzaService service;
+ private MainFrame mainFrame;
+
+ private void saveNewPizza() {
+
+ //Todo
+ service.saveNewPizza(new Pizza());
+ mainFrame.updateAllViews();
+ }
+
+ public void update() {
+ }
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/src/view/PizzaListPanel.java b/de.hhn.ai.prog2.blatt7.junit/src/view/PizzaListPanel.java
new file mode 100644
index 0000000..7a6950b
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/src/view/PizzaListPanel.java
@@ -0,0 +1,22 @@
+package view;
+
+import model.Pizza;
+import services.impl.PizzaService;
+
+import javax.swing.*;
+import java.util.List;
+
+/**
+ * Example of a custom Panel
+ */
+public class PizzaListPanel extends JPanel {
+ PizzaService service;
+
+ private void displayAllServices() {
+ List pizzas = service.getAllPizzas();
+ }
+
+ public void update() {
+
+ }
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/tests/model/OrderTest.java b/de.hhn.ai.prog2.blatt7.junit/tests/model/OrderTest.java
new file mode 100644
index 0000000..61032d9
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/tests/model/OrderTest.java
@@ -0,0 +1,51 @@
+package model;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+class OrderTest {
+
+ @Test
+ void getCustomer() {
+ }
+
+ @Test
+ void setCustomer() {
+ }
+
+ @Test
+ void getPizzas() {
+ }
+
+ @Test
+ void setPizzas() {
+ }
+
+ /**
+ * Tests if the exception is thrown when order is not in {@link model.Order.OrderState#IN_PROGRESS}
+ */
+ @Test
+ void addPizzaAfterCompletion() {
+
+ }
+
+ /**
+ * Tests if the pizza is added to the pizza List.
+ */
+ @Test
+ void addPizzaBeforCompletion() {
+ }
+
+ @Test
+ void setOrderState() {
+ }
+
+ @Test
+ void getDate() {
+ }
+
+ @Test
+ void setDate() {
+ }
+}
diff --git a/de.hhn.ai.prog2.blatt7.junit/tests/model/PizzaTest.java b/de.hhn.ai.prog2.blatt7.junit/tests/model/PizzaTest.java
new file mode 100644
index 0000000..56c97a9
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/tests/model/PizzaTest.java
@@ -0,0 +1,34 @@
+package model;
+
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+class PizzaTest {
+
+ @BeforeEach
+ void setUp() {
+ }
+
+ @AfterEach
+ void tearDown() {
+ }
+
+ @Test
+ void addTopping() {
+ }
+
+ @Test
+ void setSize() {
+ }
+
+ @Test
+ void setName() {
+ }
+
+ @Test
+ void removeTopping() {
+ }
+}
\ No newline at end of file
diff --git a/de.hhn.ai.prog2.blatt7.junit/tests/services/OrderServiceTest.java b/de.hhn.ai.prog2.blatt7.junit/tests/services/OrderServiceTest.java
new file mode 100644
index 0000000..9b2e406
--- /dev/null
+++ b/de.hhn.ai.prog2.blatt7.junit/tests/services/OrderServiceTest.java
@@ -0,0 +1,34 @@
+package services;
+
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+class OrderServiceTest {
+
+ @BeforeEach
+ void setUp() {
+ }
+
+ @AfterEach
+ void tearDown() {
+ }
+
+ @Test
+ void addOrder() {
+ }
+
+ @Test
+ void removeOrder() {
+ }
+
+ @Test
+ void getAllNonDeliverdOrder() {
+ }
+
+ @Test
+ void getAllDeliverdOder() {
+ }
+}
\ No newline at end of file