my changes
commit
3bb8482a5a
|
@ -3,7 +3,8 @@
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_16" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -1,3 +0,0 @@
|
||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
|
@ -1,37 +0,0 @@
|
||||||
<?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$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library name="JUnit5.8.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.8.1/junit-jupiter-5.8.1.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.8.1/junit-jupiter-api-5.8.1.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.8.1/junit-platform-commons-1.8.1.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.8.1/junit-jupiter-params-5.8.1.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.8.1/junit-jupiter-engine-5.8.1.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.8.1/junit-platform-engine-1.8.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library name="JUnit4">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_16" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/src/out" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/Robot_Factory_PR.iml" filepath="$PROJECT_DIR$/.idea/Robot_Factory_PR.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,124 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Palette2">
|
|
||||||
<group name="Swing">
|
|
||||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="Button" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="RadioButton" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="CheckBox" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
|
||||||
<initial-values>
|
|
||||||
<property name="text" value="Label" />
|
|
||||||
</initial-values>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
||||||
<preferred-size width="150" height="-1" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
||||||
<preferred-size width="150" height="-1" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
||||||
<preferred-size width="150" height="-1" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
||||||
<preferred-size width="150" height="50" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
|
||||||
<preferred-size width="200" height="200" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
|
||||||
<preferred-size width="200" height="200" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
|
||||||
<preferred-size width="-1" height="20" />
|
|
||||||
</default-constraints>
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
|
||||||
</item>
|
|
||||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
||||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
|
||||||
</item>
|
|
||||||
</group>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,382 +0,0 @@
|
||||||
# Robot Factory for PR2
|
|
||||||
|
|
||||||
* [Teilnehmer](#teilnehmer)
|
|
||||||
|
|
||||||
* [Overview](#overview)
|
|
||||||
* [Packages](#packages)
|
|
||||||
* [Sidefiles](#sidefiles)
|
|
||||||
* [Aufgabe](#aufgabe)
|
|
||||||
|
|
||||||
|
|
||||||
## Teilnehmer:
|
|
||||||
|
|
||||||
- Philipp Kotte Matr. : 2211945;
|
|
||||||
- Cedric Hermann Matr. : 2210943;
|
|
||||||
|
|
||||||
# Overview
|
|
||||||
|
|
||||||
## Packages
|
|
||||||
* ### [Domain](#domain-1)
|
|
||||||
* [R2D2](#-classe-r2d2-)
|
|
||||||
* [R2D2Test](#-testclasse-r2d2test-)
|
|
||||||
* [C3P0](#-classe-c3po-)
|
|
||||||
* [C3POTest](#-testclasse-c3potest-)
|
|
||||||
* [RobotBasics](#-class-robotbasics-)
|
|
||||||
* ### [Facade](#facade-1)
|
|
||||||
* [Factrory](#-classe-factory-)
|
|
||||||
* ### [Infrastructure](#infratructure-1)
|
|
||||||
* [Persistenz](#-classe-persistenz-)
|
|
||||||
* ### [utility](#robot-1)
|
|
||||||
* ### [utility](#exceptions-1)
|
|
||||||
* [RobotException](#-class-robotexception-)
|
|
||||||
* [RobotIllegalStateException](#-class-robotillegalstateexception-)
|
|
||||||
* [RobotMagicValueException](#-class-robotmagicvalueexception-)
|
|
||||||
* ### [interfaces](#interfaces-1)
|
|
||||||
* [Robot](#-interface-robot-)
|
|
||||||
* [RobotControl](#-interface-robotcontroll-)
|
|
||||||
* [RobotInstructions](#-interface-robotinstructions-)
|
|
||||||
* [Sorting] vorläufig
|
|
||||||
* ### [UI](#ui-1)
|
|
||||||
* [UI](#-class-ui-)
|
|
||||||
|
|
||||||
## Sidefiles
|
|
||||||
* [Main](#-classe-main-)
|
|
||||||
* [makefile](#-makefile-for-Git-updates-)
|
|
||||||
|
|
||||||
# TO-Dos:
|
|
||||||
|
|
||||||
* Sortier Algorythem C3PO, R2D2 (mit Ausgabe) --[done]--
|
|
||||||
|
|
||||||
* Bei Erstellung eines Roboters wird einne SerienNr erstellt --[done]--
|
|
||||||
|
|
||||||
* Wichtige getter for Robots (getName) --[done]--
|
|
||||||
|
|
||||||
* Exception Classes (Throwable einfügen) --[done]--
|
|
||||||
|
|
||||||
* RobotFactory, die mit enum(RobotType) Objekt von R2D2 und C3PO erstellen kann --[abgewandelt für Exceptions]--
|
|
||||||
|
|
||||||
* Persistenz einrichten
|
|
||||||
|
|
||||||
* funktionalitäten der UI zusammenfassen
|
|
||||||
|
|
||||||
* funtkionalitäten der UI implementieren
|
|
||||||
|
|
||||||
* Nexus6(Singleton) implementieren, kann nichts (Illegal-State)
|
|
||||||
|
|
||||||
* JUnit5 Tests
|
|
||||||
|
|
||||||
* Wie fügt man weitere Roboter hinzu erklärung in einer Text Datei
|
|
||||||
|
|
||||||
|
|
||||||
## Domain
|
|
||||||
<h2 align="center"> Class R2D2 </h2>
|
|
||||||
|
|
||||||
### Variables:
|
|
||||||
`--not set yet--`
|
|
||||||
___
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
`public R2D2():R2D2`
|
|
||||||
|
|
||||||
<h2 align="center">
|
|
||||||
TestClass R2D2Test
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
### Variables:
|
|
||||||
|
|
||||||
`public int id`
|
|
||||||
|
|
||||||
`public String name`
|
|
||||||
|
|
||||||
`public R2D2 Herbert`
|
|
||||||
___
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
|
|
||||||
`@BeforeEach`
|
|
||||||
`setup():void`
|
|
||||||
|
|
||||||
`@Test`
|
|
||||||
|
|
||||||
`getId():void`
|
|
||||||
|
|
||||||
`getName():void`
|
|
||||||
|
|
||||||
`triggerPowerSwitch():void`
|
|
||||||
|
|
||||||
`iPowerOn():void`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 align="center">
|
|
||||||
Class C3PO
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
|
|
||||||
### Variables:
|
|
||||||
`--not set yet--`
|
|
||||||
___
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
`//construtor`
|
|
||||||
|
|
||||||
`public C3PO(): C3PO`
|
|
||||||
|
|
||||||
<h2 align="center">
|
|
||||||
TestClass C3PO
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
### Variables:
|
|
||||||
`public int id`
|
|
||||||
|
|
||||||
`public String name`
|
|
||||||
|
|
||||||
`public C3PO Herbert`
|
|
||||||
___
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
`@BeforeEach`
|
|
||||||
`setup():void`
|
|
||||||
|
|
||||||
`@Test`
|
|
||||||
|
|
||||||
`getId():void`
|
|
||||||
|
|
||||||
`getName():void`
|
|
||||||
|
|
||||||
`triggerPowerSwitch():void`
|
|
||||||
|
|
||||||
`iPowerOn():void`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 align="center">
|
|
||||||
Class RobotBasics
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
|
|
||||||
### Variables:
|
|
||||||
`private int id`
|
|
||||||
|
|
||||||
`private String name`
|
|
||||||
|
|
||||||
`private boolean power`
|
|
||||||
|
|
||||||
___
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
`public RobotBasics():RobotBasics`
|
|
||||||
|
|
||||||
`public getId():int`
|
|
||||||
|
|
||||||
`public getName():String`
|
|
||||||
|
|
||||||
`public triggerPowerSwitch():void`
|
|
||||||
|
|
||||||
`public ìsPowerOn():boolean`
|
|
||||||
|
|
||||||
`public speak():String`
|
|
||||||
|
|
||||||
`public think():int[]`
|
|
||||||
|
|
||||||
## facade
|
|
||||||
|
|
||||||
<h2 align="center"> Class Factory </h2>
|
|
||||||
|
|
||||||
### Variables:
|
|
||||||
`--not set yet--`
|
|
||||||
___
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
`--not set yet--`
|
|
||||||
|
|
||||||
## Infrastructure
|
|
||||||
|
|
||||||
<h2 align="center"> Class Persistenz </h2>
|
|
||||||
|
|
||||||
### Variables:
|
|
||||||
`--not set yet--`
|
|
||||||
___
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
`existsSavedData():boolean`
|
|
||||||
|
|
||||||
`saveFactoryData():void -> throws`
|
|
||||||
|
|
||||||
`loadFactoryData():Object -> throws`
|
|
||||||
|
|
||||||
## utility
|
|
||||||
|
|
||||||
### utility
|
|
||||||
|
|
||||||
<h2 align="center">
|
|
||||||
Class RobotException
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
#### Methods:
|
|
||||||
`public RobotException():Exception`
|
|
||||||
|
|
||||||
<h2 align="center"> Class RobotIllegalStateException </h2>
|
|
||||||
|
|
||||||
#### Methods:
|
|
||||||
`public RobotIllegalStateException():RobotException`
|
|
||||||
|
|
||||||
<h2 align="center"> Class RobotMagicValueException </h2>
|
|
||||||
|
|
||||||
#### Methods:
|
|
||||||
`public RobotMagicValueException():RobotException`
|
|
||||||
|
|
||||||
### interfaces
|
|
||||||
|
|
||||||
<h2 align="center">
|
|
||||||
Interface Robot </h2>
|
|
||||||
|
|
||||||
#### Methods:
|
|
||||||
`--not set yet--`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 align="center">
|
|
||||||
Interface RobotControl
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
`--not set yet--`
|
|
||||||
|
|
||||||
<h2 align="center">
|
|
||||||
Interface RobotInstructions </h2>
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
`--not set yet--`
|
|
||||||
|
|
||||||
|
|
||||||
## UI
|
|
||||||
|
|
||||||
<h2 align="center"> Class UI </h2>
|
|
||||||
|
|
||||||
### Variables:
|
|
||||||
`--not set yet--`
|
|
||||||
___
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
`--not set yet--`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 align="center"> Class Main </h2>
|
|
||||||
|
|
||||||
### Variables:
|
|
||||||
`--not set yet--`
|
|
||||||
___
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
`--not set yet--`
|
|
||||||
|
|
||||||
<h2 align="center"> makefile for Git updates </h2>
|
|
||||||
|
|
||||||
### Variables:
|
|
||||||
`--not set yet--`
|
|
||||||
___
|
|
||||||
|
|
||||||
### Methods:
|
|
||||||
|
|
||||||
`update_readme:`
|
|
||||||
|
|
||||||
`update_make:`
|
|
||||||
|
|
||||||
`update_all:`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Aufgabe
|
|
||||||
|
|
||||||
PR2-Aufgabe Roboterfabrik
|
|
||||||
(ursprüngliche Autoren: Sebastian Tschirpke und Steffen Hennhöfer; mit Erweiterungen von Oliver Hummel)
|
|
||||||
Nach Abschluss Ihres Bachelorstudiums sind Sie auf Jobsuche. In einem Zeitungsartikel
|
|
||||||
lesen Sie, dass die Firma ASDF123-Roboter AG, junge und kreative Mitarbeiter für den
|
|
||||||
Aufbau einer Roboterfabrik sucht. Von der Stellenausschreibung ganz hingerissen, machen
|
|
||||||
Sie sich sofort auf den Weg und reichen Ihre Bewerbungsunterlagen ein. Tatsächlich
|
|
||||||
meldet sich die Firma kurz darauf bei Ihnen und lädt Sie zu einem Bewerbungsgespräch ein.
|
|
||||||
Für Sie läuft scheinbar alles perfekt und Sie können es kaum erwarten Ihren zukünftigen
|
|
||||||
Arbeitgeber von Ihren Qualitäten zu überzeugen. Jedoch zeigt dieser keinerlei Interesse an
|
|
||||||
Ihren Zeugnissen, sondern knüpft vielmehr Ihre Einstellung an die Lösung folgender Aufgabe
|
|
||||||
für die Sie Klassen auf der Domänenebene implementieren und testen sollen:
|
|
||||||
Die Firma möchte eine neue Roboterfabrik aufbauen und benötigt dazu ein Softwaremodell,
|
|
||||||
welches den Produktionsprozess und die Roboter simuliert. Es handelt sich nur um eine
|
|
||||||
einzige Fabrik mit einer Fabrikmethode, die flexibel auf Bestellungen der Kunden reagieren
|
|
||||||
kann. Die Roboterfabrik bietet ihren Kunden zunächst zwei verschiedene Modelle an, beide
|
|
||||||
aus der Star-Wars-Produktreihe: die Modelle heißen C3PO und R2D2 und sollen gemeinsam
|
|
||||||
genutzte Funktionalität von einer Superklasse erben. Alle Roboter haben eine einfache
|
|
||||||
Schnittstelle Robot, mit der sie gesteuert werden können. Diese Schnittstelle besteht insgesamt
|
|
||||||
aus den folgenden Dateien:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Robot.java
|
|
||||||
* RobotControl.java
|
|
||||||
* RobotInstructions.java
|
|
||||||
|
|
||||||
Die Fabrik ist von ihren Fertigungsanlagen her so konzipiert, dass jeder Roboter einzeln
|
|
||||||
gefertigt wird. Übergeben wird lediglich das gewünschte Roboter-Modell und der Name und
|
|
||||||
schon erhält der Kunde den von ihm gewünschten Roboter (also in der Simulation eine Instanz).
|
|
||||||
Der Unterschied zwischen den angebotenen Modellen liegt in der Ausführung der Befehle aus
|
|
||||||
dem Interface RobotInstructions. Während R2D2 Arrays immer aufsteigend sortiert und bei der
|
|
||||||
Umwandlung in ein Array den Inhalt durch Kommas trennt (z.B. 1, 2, 3, 4, 5, 6), sortiert C3PO
|
|
||||||
Arrays stets absteigend und wandelt deren Inhalt in einen String mit Semikolon als Trennzeichen
|
|
||||||
um (z.B. 6; 5; 4; 3; 2; 1). R2D2 soll für die Sortierung der Daten einen selbst implementierten
|
|
||||||
SelectionSort-Algorithmus verwenden, C3PO InsertionSort. Die Zusammenstellung des Strings für
|
|
||||||
die Rückgabe soll in einer privaten Methode der Roboter- Basisklasse mit Hilfe eines Streams und
|
|
||||||
Lambda-Ausdrücken erfolgen.
|
|
||||||
Programmieren Sie zwei Klassen R2D2 und C3PO, die beide das Interface Robot implementieren.
|
|
||||||
Lesen Sie bitte sorgfältig die Dokumentation der Interfaces, damit Sie die beschriebene Semantik
|
|
||||||
in Ihrer Implementierung einhalten. Die Seriennummern der R2D2- Modelle bewegen sich im Bereich
|
|
||||||
von 0–9999, die der C3PO-Modelle von 10000–19999. Schreiben Sie ferner die in den Interfaces
|
|
||||||
referenzierten Klassen für die Ausnahmen. Sorgen Sie dafür, dass die Ausnahmen den Namen des
|
|
||||||
Roboters tragen, in dem sie entstanden sind und dass man diesen Namen über die Methode getRobotName()
|
|
||||||
wieder auslesen kann.
|
|
||||||
Auch für die Implementierung der Exceptions kann daher eine gemeinsame Superklasse hilfreich sein.
|
|
||||||
Entwickeln Sie eine Klasse RobotFactory mit deren Hilfe man Instanzen der beiden Roboter- Typen
|
|
||||||
erzeugen kann. Eine Enumeration mit dem Namen RobotType dient dazu, bei der Erzeugung anzugeben,
|
|
||||||
ob man einen R2D2- oder einen C3PO-Roboter haben möchte.
|
|
||||||
Vergessen Sie nicht, dass jeder Roboter eine Seriennummer aus dem jeweiligen Bereich benötigt und
|
|
||||||
dass er bei der Erzeugung seinen unveränderlichen Namen bekommt. Verbergen Sie die Implementierung
|
|
||||||
der Roboter vor dem Verwender und erlauben Sie nur Zugriff auf die Factory, die Interfaces und
|
|
||||||
die Ausnahmen. Wählen Sie entsprechende Pakete gemäß ihrem Schema, um dies zu realisieren.
|
|
||||||
Zusätzlich zu den beiden produzierten Roboter-Modellen R2D2 und C3PO steht in der Firma noch ein
|
|
||||||
alter Nexus-6-Roboter mit dem Namen “Pris“ (Seriennummer 19281982)herum, der leider seit einer
|
|
||||||
Begegnung mit einem Blade-Runner irreparabel defekt ist und nicht eingeschaltet werden kann (man kann
|
|
||||||
den Schalter zwar drücken, dies hat aber keine Wirkung). Da es nur dieses eine Exemplar gibt, können
|
|
||||||
auch keine weiteren Nexus-6- Modelle hergestellt werden. Implementieren Sie daher den Nexus-6-Roboter
|
|
||||||
(Klassenname Nexus6) als Singleton. Beachten Sie, dass die speak- und think-Methoden nicht funktionieren
|
|
||||||
sollen, sondern grundsätzlich eine Ausnahme Robot"-Illegal"-State"-Exception werfen.
|
|
||||||
Schreiben Sie automatisierte JUnit-Tests mit denen Sie die korrekte Funktionsweise der Implementierungen
|
|
||||||
und der Factory-Klasse überprüfen. Denken Sie daran, auch die Ausnahmen zu testen.
|
|
||||||
Angenommen, Ihre Firma möchte eine weitere Produktlinie eröffnen und in Zukunft auch noch T1000-Roboter
|
|
||||||
herstellen, die natürlich auch das Robot-Interface implementieren: Welche Änderungen müssten Sie an Ihrem
|
|
||||||
Projekt durchführen? Sie brauchen keine Implementierung dafür zu erstellen, legen Sie dafür bitte eine
|
|
||||||
Textdatei in Ihr Projekt, in der Sie die notwendigen Erweiterungen und evtl. Änderungen kurz erläutern.
|
|
||||||
* Mit Ihrer Implementierung sollten folgende Begrifflichkeiten abgedeckt sein:
|
|
||||||
* Singleton-Pattern,
|
|
||||||
* Factory-Pattern,
|
|
||||||
* Exceptions,
|
|
||||||
* Interfaces,
|
|
||||||
* abstrakte Klassen,
|
|
||||||
* JUnit- Tests,
|
|
||||||
* Enumerationen,
|
|
||||||
* Sortieralgorithmen,
|
|
||||||
* Streams & Lambdas.
|
|
||||||
* Achten Sie bei Ihrer Implementierung auf die Konsistenz der Sprache (Englisch/Deutsch).
|
|
||||||
* Kommentieren Sie Ihre Methoden ausführlich mit Javadoc-Kommentaren,
|
|
||||||
* wie in den Interfaces gezeigt (googlen Sie ggf. nach weiteren Details dafür).
|
|
||||||
* Bei der Implementierung von Methoden aus den Interfaces, dürfen Sie mit @see... auf deren Javadocs verweisen und müssen die Dokumentation nicht duplizieren.
|
|
||||||
* Sie müssen kein UML-Diagramm anfertigen, können dies aber gerne tun.
|
|
||||||
* Testen Sie Ihre Implementierung möglichst umfangreich. Wir werden es auf jeden Fall tun. !
|
|
||||||
* Nutzen Sie für die gemeinsame Arbeit an der Implementierung ein Git-Repository und nutzen Sie regelmäßig.
|
|
||||||
* Es müssen von allen Team-Mitgliedern jeweils mindestens fünf Commits mit substanziellem Inhalt auf den main-Branch gepusht werden.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Fragen an Hummel
|
|
||||||
|
|
||||||
Was ist mit der Umwandlung von zahlen in arrays den inhalt mit Kommas getrennt gemeint?
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,31 +0,0 @@
|
||||||
|
|
||||||
update_readme:
|
|
||||||
git add README.md
|
|
||||||
git commit -m "updated README"
|
|
||||||
git push -u origin main
|
|
||||||
update_make:
|
|
||||||
git add makefile
|
|
||||||
git commit -m "updated makefile"
|
|
||||||
git push -u origin main
|
|
||||||
update_all:
|
|
||||||
git add --all
|
|
||||||
git commit -m "Updated everything. Further explanation in README"
|
|
||||||
git push -u origin main
|
|
||||||
update_domain:
|
|
||||||
git add domain/
|
|
||||||
git commit -m "Updated domain. Further explanation in README"
|
|
||||||
git push -u origin main
|
|
||||||
update_exceptions:
|
|
||||||
git add robot/exceptions
|
|
||||||
git commit -m "Updated Exceptions"
|
|
||||||
git push -u origin main
|
|
||||||
update_interfaces:
|
|
||||||
git add robot/interfaces
|
|
||||||
git commit -m "updated interfaces"
|
|
||||||
git push -u origin main
|
|
||||||
update_ui:
|
|
||||||
git add ui/
|
|
||||||
git commit -m "updated ui"
|
|
||||||
git push -u origin main
|
|
||||||
fetch_git:
|
|
||||||
git pull origin main
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,8 +1,8 @@
|
||||||
package src.domain;
|
package domain;
|
||||||
|
|
||||||
import src.utility.robot_exceptions.ExceptionStorage;
|
import utility.robot_exceptions.ExceptionStorage;
|
||||||
import src.utility.robot_exceptions.RobotException;
|
import utility.robot_exceptions.RobotException;
|
||||||
import src.utility.robot_exceptions.robotExceptions;
|
import utility.robot_exceptions.robotExceptions;
|
||||||
|
|
||||||
public class C3PO extends Robot {
|
public class C3PO extends Robot {
|
||||||
public C3PO(int id, String name){
|
public C3PO(int id, String name){
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package src.domain;
|
package domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
package src.domain;
|
package domain;
|
||||||
import src.utility.robot_exceptions.ExceptionStorage;
|
import utility.robot_exceptions.ExceptionStorage;
|
||||||
import src.utility.robot_exceptions.RobotException;
|
import utility.robot_exceptions.RobotException;
|
||||||
import src.utility.robot_exceptions.robotExceptions;
|
import utility.robot_exceptions.robotExceptions;
|
||||||
|
|
||||||
public final class Nexus6 extends Robot {
|
public final class Nexus6 extends Robot {
|
||||||
|
|
||||||
private static final Nexus6 INSTANCE = new Nexus6();
|
private static final Nexus6 INSTANCE = new Nexus6("Pris");
|
||||||
|
|
||||||
private Nexus6() {
|
public Nexus6(String name) {
|
||||||
super(1, "Nexus-6", RobotType.Nexus6);
|
super(19281982, name, RobotType.Nexus6);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Nexus6 getInstance() {
|
public static Nexus6 getInstance() {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package src.domain;
|
package domain;
|
||||||
|
|
||||||
import src.utility.interfaces.RobotInstructions;
|
import utility.interfaces.RobotInstructions;
|
||||||
import src.utility.robot_exceptions.ExceptionStorage;
|
import utility.robot_exceptions.ExceptionStorage;
|
||||||
import src.utility.robot_exceptions.RobotException;
|
import utility.robot_exceptions.RobotException;
|
||||||
import src.utility.robot_exceptions.robotExceptions;
|
import utility.robot_exceptions.robotExceptions;
|
||||||
|
|
||||||
public class R2D2 extends Robot {
|
public class R2D2 extends Robot {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
package src.domain;
|
package domain;
|
||||||
|
|
||||||
import src.utility.robot_exceptions.ExceptionStorage;
|
import utility.robot_exceptions.ExceptionStorage;
|
||||||
import src.utility.robot_exceptions.RobotException;
|
import utility.robot_exceptions.RobotException;
|
||||||
import src.utility.robot_exceptions.robotExceptions;
|
import utility.robot_exceptions.robotExceptions;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
public abstract class Robot implements src.utility.interfaces.Robot, Serializable {
|
public abstract class Robot implements utility.interfaces.Robot, Serializable {
|
||||||
|
|
||||||
protected ExceptionStorage exceptions;
|
protected ExceptionStorage exceptions;
|
||||||
private int id;
|
private int id;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package src.domain;
|
package domain;
|
||||||
|
|
||||||
public enum RobotType {
|
public enum RobotType {
|
||||||
C3PO("C3PO"), R2D2("R2D2"), Nexus6("Nexus6");
|
C3PO("C3PO"), R2D2("R2D2"), Nexus6("Nexus6");
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package src.facade;
|
package facade;
|
||||||
|
|
||||||
import src.domain.Factory;
|
import domain.Factory;
|
||||||
import src.domain.Robot;
|
import domain.Robot;
|
||||||
import src.domain.RobotType;
|
import domain.RobotType;
|
||||||
import infrastructure.Persistenz;
|
import infrastructure.Persistenz;
|
||||||
|
|
||||||
public class FactorySystem {
|
public class FactorySystem {
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,8 +1,8 @@
|
||||||
package src.ui;
|
package ui;
|
||||||
|
|
||||||
import src.domain.Robot;
|
import domain.Robot;
|
||||||
import src.domain.RobotType;
|
import domain.RobotType;
|
||||||
import src.facade.FactorySystem;
|
import facade.FactorySystem;
|
||||||
import infrastructure.Persistenz;
|
import infrastructure.Persistenz;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* (c) 2012 Thomas Smits */
|
/* (c) 2012 Thomas Smits */
|
||||||
package src.utility.interfaces;
|
package utility.interfaces;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
package src.utility.interfaces;
|
package utility.interfaces;
|
||||||
import src.utility.robot_exceptions.RobotException;
|
import utility.robot_exceptions.RobotException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Das Interface repräsentiert einen einfachen Roboter mit seinen Funktionen.
|
* Das Interface repräsentiert einen einfachen Roboter mit seinen Funktionen.
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package src.utility.interfaces;
|
package utility.interfaces;
|
||||||
|
|
||||||
import src.utility.robot_exceptions.RobotException;
|
import utility.robot_exceptions.RobotException;
|
||||||
import src.utility.robot_exceptions.RobotIllegalStateException;
|
import utility.robot_exceptions.RobotIllegalStateException;
|
||||||
import src.utility.robot_exceptions.RobotMagicValueException;
|
import utility.robot_exceptions.RobotMagicValueException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package src.utility.robot_exceptions;
|
package utility.robot_exceptions;
|
||||||
|
|
||||||
public class ArrayEmptyException extends RobotException{
|
public class ArrayEmptyException extends RobotException{
|
||||||
public ArrayEmptyException(robotExceptions type,String errorMessage){
|
public ArrayEmptyException(robotExceptions type,String errorMessage){
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package src.utility.robot_exceptions;
|
package utility.robot_exceptions;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package src.utility.robot_exceptions;
|
package utility.robot_exceptions;
|
||||||
|
|
||||||
public class RobotException extends Exception{
|
public class RobotException extends Exception{
|
||||||
robotExceptions currentType;
|
robotExceptions currentType;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package src.utility.robot_exceptions;
|
package utility.robot_exceptions;
|
||||||
|
|
||||||
public class RobotIllegalStateException extends RobotException{
|
public class RobotIllegalStateException extends RobotException{
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package src.utility.robot_exceptions;
|
package utility.robot_exceptions;
|
||||||
|
|
||||||
public class RobotMagicValueException extends RobotException {
|
public class RobotMagicValueException extends RobotException {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package src.utility.robot_exceptions;
|
package utility.robot_exceptions;
|
||||||
|
|
||||||
public enum robotExceptions {
|
public enum robotExceptions {
|
||||||
ILLEGALSTATE("ist in einem illegalen Zustand"),
|
ILLEGALSTATE("ist in einem illegalen Zustand"),
|
||||||
|
|
Binary file not shown.
|
@ -1,8 +1,8 @@
|
||||||
package tests.tests;
|
package tests;
|
||||||
import src.domain.C3PO;
|
import domain.C3PO;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import src.utility.robot_exceptions.RobotException;
|
import utility.robot_exceptions.RobotException;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package tests.tests;
|
package tests;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
|
@ -0,0 +1,107 @@
|
||||||
|
package tests;
|
||||||
|
|
||||||
|
import domain.Nexus6;
|
||||||
|
import domain.R2D2;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import utility.robot_exceptions.RobotException;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class Nexus6Test {
|
||||||
|
|
||||||
|
Nexus6 nexus6;
|
||||||
|
int id = 19281982;
|
||||||
|
String name = "Pris";
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void setup(){
|
||||||
|
nexus6 = new Nexus6(name);
|
||||||
|
nexus6.triggerPowerSwitch();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getId() {
|
||||||
|
assertEquals(id, nexus6.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getName() {
|
||||||
|
assertEquals(name, nexus6.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void triggerPowerSwitch() {
|
||||||
|
assertTrue(nexus6.isPowerOn());
|
||||||
|
nexus6.triggerPowerSwitch();
|
||||||
|
assertFalse(nexus6.isPowerOn());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void R2D2SpeakTestEmpty() {
|
||||||
|
try{
|
||||||
|
String solution = nexus6.speak(new int[]{});
|
||||||
|
}catch(RobotException re){
|
||||||
|
assertEquals(0, "Pris ist in einem illegalen Zustand".compareTo(re.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void R2D2SpeakTestZeros() throws RobotException {
|
||||||
|
try{
|
||||||
|
String solution = nexus6.speak(new int[4]);
|
||||||
|
}catch(RobotException re){
|
||||||
|
assertEquals(0, "Pris ist in einem illegalen Zustand".compareTo(re.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void R2D2SpeakTestOneElement() throws RobotException {
|
||||||
|
try{
|
||||||
|
String solution = nexus6.speak(new int[]{1});
|
||||||
|
}catch(RobotException re){
|
||||||
|
assertEquals(0, "Pris ist in einem illegalen Zustand".compareTo(re.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void R2D2SpeakTestUnitElements() throws RobotException {
|
||||||
|
try{
|
||||||
|
String solution = nexus6.speak(new int[]{-1, 0, 1});
|
||||||
|
}catch(RobotException re){
|
||||||
|
assertEquals(0, "Pris ist in einem illegalen Zustand".compareTo(re.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void R2D2SpeakTestMagicNumberException() {
|
||||||
|
|
||||||
|
try{
|
||||||
|
String solution = nexus6.speak(new int[]{42});
|
||||||
|
}catch(RobotException re){
|
||||||
|
assertEquals(0, "Pris ist in einem illegalen Zustand".compareTo(re.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void speak(){
|
||||||
|
String solution = "12, 2, 4, 5, 12, 2, 4, 7, 56, 433, 23";
|
||||||
|
int[] input = {12, 2, 4, 5, 12, 2, 4, 7, 56, 433, 23};
|
||||||
|
try{
|
||||||
|
String array = nexus6.speak(input);
|
||||||
|
} catch(RobotException re) {
|
||||||
|
assertEquals(0, "Pris ist in einem illegalen Zustand".compareTo(re.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void think(){
|
||||||
|
int[] solution = { 2, 4, 4, 5, 7, 12, 23, 56, 433};
|
||||||
|
int[] input = { 4, 5, 12, 2, 4, 7, 56, 433, 23};
|
||||||
|
try{
|
||||||
|
int[] value = nexus6.think(input);
|
||||||
|
}catch(RobotException re){
|
||||||
|
assertEquals(0, "Pris ist in einem illegalen Zustand".compareTo(re.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,9 @@
|
||||||
package tests.tests;
|
package tests;
|
||||||
|
|
||||||
import src.domain.R2D2;
|
import domain.R2D2;
|
||||||
import src.domain.RobotType;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import src.utility.robot_exceptions.RobotException;
|
import org.junit.jupiter.api.Test;
|
||||||
import src.utility.robot_exceptions.RobotMagicValueException;
|
import utility.robot_exceptions.RobotException;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue