Compare commits
20 Commits
ManageTask
...
654305f2cd
| Author | SHA1 | Date | |
|---|---|---|---|
| 654305f2cd | |||
| a390509f87 | |||
| 85446bc230 | |||
| f0da7b0f9a | |||
| c85d55ce7d | |||
| a875f24e83 | |||
| bb71c7e329 | |||
| 2af4f4b7a4 | |||
| 79df3d300e | |||
| 7201f66214 | |||
| 0db43fe51a | |||
| 90fbacadaa | |||
|
|
57144fa772 | ||
|
|
d3488f1f1c | ||
|
|
382aad70f7 | ||
|
|
dbebcad97d | ||
|
|
ec0abd85b9 | ||
|
|
04f2087456 | ||
|
|
0c4f092312 | ||
|
|
bc0e30860c |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
|
build/
|
||||||
.gradle/
|
.gradle/
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.gradle/8.14/executionHistory/executionHistory.bin
Normal file
BIN
.gradle/8.14/executionHistory/executionHistory.bin
Normal file
Binary file not shown.
Binary file not shown.
BIN
.gradle/8.14/expanded/expanded.lock
Normal file
BIN
.gradle/8.14/expanded/expanded.lock
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.gradle/8.14/fileHashes/resourceHashesCache.bin
Normal file
BIN
.gradle/8.14/fileHashes/resourceHashesCache.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/checksums/checksums.lock
Normal file
BIN
.gradle/9.1.0/checksums/checksums.lock
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/checksums/md5-checksums.bin
Normal file
BIN
.gradle/9.1.0/checksums/md5-checksums.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/checksums/sha1-checksums.bin
Normal file
BIN
.gradle/9.1.0/checksums/sha1-checksums.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/executionHistory/executionHistory.bin
Normal file
BIN
.gradle/9.1.0/executionHistory/executionHistory.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/executionHistory/executionHistory.lock
Normal file
BIN
.gradle/9.1.0/executionHistory/executionHistory.lock
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/expanded/expanded.lock
Normal file
BIN
.gradle/9.1.0/expanded/expanded.lock
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/fileHashes/fileHashes.bin
Normal file
BIN
.gradle/9.1.0/fileHashes/fileHashes.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/fileHashes/fileHashes.lock
Normal file
BIN
.gradle/9.1.0/fileHashes/fileHashes.lock
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/fileHashes/resourceHashesCache.bin
Normal file
BIN
.gradle/9.1.0/fileHashes/resourceHashesCache.bin
Normal file
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
|||||||
#Wed Dec 03 17:27:55 CET 2025
|
#Wed Dec 03 20:34:21 CET 2025
|
||||||
gradle.version=8.14
|
gradle.version=8.14
|
||||||
|
|||||||
BIN
.gradle/file-system.probe
Normal file
BIN
.gradle/file-system.probe
Normal file
Binary file not shown.
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@@ -5,6 +5,8 @@
|
|||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleHome" value="C:\Gradle\gradle-9.0.0" />
|
||||||
|
<option name="gradleJvm" value="17" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
|
|||||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
|||||||
<component name="FrameworkDetectionExcludesConfiguration">
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
<file type="web" url="file://$PROJECT_DIR$" />
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="homebrew-17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
8
.idea/modules/Template.test.iml
generated
Normal file
8
.idea/modules/Template.test.iml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="AdditionalModuleElements">
|
||||||
|
<content url="file://$MODULE_DIR$/../../src/test" dumb="true">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/../../src/test/resources" type="java-test-resource" />
|
||||||
|
</content>
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@@ -14,6 +14,7 @@ dependencies {
|
|||||||
testImplementation platform('org.junit:junit-bom:5.10.0')
|
testImplementation platform('org.junit:junit-bom:5.10.0')
|
||||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||||
|
implementation 'com.mysql:mysql-connector-j:9.5.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
jacoco {
|
jacoco {
|
||||||
|
|||||||
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.
@@ -23,7 +23,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox" id="tests">
|
<div class="infoBox" id="tests">
|
||||||
<div class="counter">6</div>
|
<div class="counter">8</div>
|
||||||
<p>tests</p>
|
<p>tests</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox" id="duration">
|
<div class="infoBox" id="duration">
|
||||||
<div class="counter">0.057s</div>
|
<div class="counter">0.036s</div>
|
||||||
<p>duration</p>
|
<p>duration</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -63,6 +63,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="#">Tests</a>
|
<a href="#">Tests</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#">Standard output</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<h2>Tests</h2>
|
<h2>Tests</h2>
|
||||||
@@ -78,41 +81,60 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="success">Assert Add Task is programmed defensively</td>
|
<td class="success">Assert Add Task is programmed defensively</td>
|
||||||
<td class="success">assertAddTaskOnlyAcceptsValidParameters()</td>
|
<td class="success">assertAddTaskOnlyAcceptsValidParameters()</td>
|
||||||
<td class="success">0.002s</td>
|
<td class="success">0.003s</td>
|
||||||
<td class="success">passed</td>
|
<td class="success">passed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="success">Assert only existing tasks can be edited</td>
|
<td class="success">Assert only existing tasks can be edited</td>
|
||||||
<td class="success">assertEditOnlyExistingTasks()</td>
|
<td class="success">assertEditOnlyExistingTasks()</td>
|
||||||
<td class="success">0.002s</td>
|
<td class="success">0.003s</td>
|
||||||
|
<td class="success">passed</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="success">Assert non-existent commands are recognized as such</td>
|
||||||
|
<td class="success">assertInvalidCommandsDontCrash()</td>
|
||||||
|
<td class="success">0.004s</td>
|
||||||
<td class="success">passed</td>
|
<td class="success">passed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="success">Assert List isn't empty after adding a task</td>
|
<td class="success">Assert List isn't empty after adding a task</td>
|
||||||
<td class="success">assertListNowEmptyAfterAdd()</td>
|
<td class="success">assertListNowEmptyAfterAdd()</td>
|
||||||
<td class="success">0.046s</td>
|
<td class="success">0.015s</td>
|
||||||
<td class="success">passed</td>
|
<td class="success">passed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="success">Assert that added tasks can't be Null</td>
|
<td class="success">Assert that added tasks can't be Null</td>
|
||||||
<td class="success">assertNewTasksAreNotNull()</td>
|
<td class="success">assertNewTasksAreNotNull()</td>
|
||||||
<td class="success">0.002s</td>
|
<td class="success">0.001s</td>
|
||||||
<td class="success">passed</td>
|
<td class="success">passed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="success">Assert that Remove Task is programmed defensively</td>
|
<td class="success">Assert that Remove Task is programmed defensively</td>
|
||||||
<td class="success">assertRemoveTaskOnlyAcceptsValidParameters()</td>
|
<td class="success">assertRemoveTaskOnlyAcceptsValidParameters()</td>
|
||||||
<td class="success">0.003s</td>
|
<td class="success">0.006s</td>
|
||||||
|
<td class="success">passed</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="success">Assert that removing a non-existent worker throws an Exception</td>
|
||||||
|
<td class="success">assertRemovingNonExistentWorkerFails()</td>
|
||||||
|
<td class="success">0.001s</td>
|
||||||
<td class="success">passed</td>
|
<td class="success">passed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="success">Assert that un-/finishing a Task only works with valid parameters</td>
|
<td class="success">Assert that un-/finishing a Task only works with valid parameters</td>
|
||||||
<td class="success">assertTaskStateChangesOnlyAcceptsValidParameters()</td>
|
<td class="success">assertTaskStateChangesOnlyAcceptsValidParameters()</td>
|
||||||
<td class="success">0.002s</td>
|
<td class="success">0.003s</td>
|
||||||
<td class="success">passed</td>
|
<td class="success">passed</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab">
|
||||||
|
<h2>Standard output</h2>
|
||||||
|
<span class="code">
|
||||||
|
<pre>Unknown command. Type 'help' for available commands.
|
||||||
|
</pre>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<p>
|
<p>
|
||||||
@@ -121,7 +143,7 @@
|
|||||||
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
||||||
</label>
|
</label>
|
||||||
</div>Generated by
|
</div>Generated by
|
||||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 03.12.2025, 19:35:34</p>
|
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 20:04:07</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox" id="tests">
|
<div class="infoBox" id="tests">
|
||||||
<div class="counter">7</div>
|
<div class="counter">13</div>
|
||||||
<p>tests</p>
|
<p>tests</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox" id="duration">
|
<div class="infoBox" id="duration">
|
||||||
<div class="counter">0.007s</div>
|
<div class="counter">0.047s</div>
|
||||||
<p>duration</p>
|
<p>duration</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -63,6 +63,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="#">Tests</a>
|
<a href="#">Tests</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#">Standard output</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<h2>Tests</h2>
|
<h2>Tests</h2>
|
||||||
@@ -76,24 +79,60 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="success">Check that every required surface command actually works</td>
|
||||||
|
<td class="success">assertCommandsAreRecognized()</td>
|
||||||
|
<td class="success">0.015s</td>
|
||||||
|
<td class="success">passed</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="success">Assert deleted Tasks no longer show up in the List</td>
|
<td class="success">Assert deleted Tasks no longer show up in the List</td>
|
||||||
<td class="success">assertDeletedTasksDisappear()</td>
|
<td class="success">assertDeletedTasksDisappear()</td>
|
||||||
<td class="success">0s</td>
|
<td class="success">0.003s</td>
|
||||||
|
<td class="success">passed</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="success">Check that editing is possible through UI</td>
|
||||||
|
<td class="success">assertEditingTasksIsPossibleThroughUi()</td>
|
||||||
|
<td class="success">0.008s</td>
|
||||||
<td class="success">passed</td>
|
<td class="success">passed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="success">Assert existing Tasks can be edited</td>
|
<td class="success">Assert existing Tasks can be edited</td>
|
||||||
<td class="success">assertExistingTasksCanBeEdited()</td>
|
<td class="success">assertExistingTasksCanBeEdited()</td>
|
||||||
<td class="success">0s</td>
|
<td class="success">0.001s</td>
|
||||||
|
<td class="success">passed</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="success">Check that every task command works</td>
|
||||||
|
<td class="success">assertFinishingTasksIsPossibleThroughUi()</td>
|
||||||
|
<td class="success">0.004s</td>
|
||||||
<td class="success">passed</td>
|
<td class="success">passed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="success">Check Getters</td>
|
<td class="success">Check Getters</td>
|
||||||
<td class="success">assertGettersWorkCorrectly()</td>
|
<td class="success">assertGettersWorkCorrectly()</td>
|
||||||
|
<td class="success">0.004s</td>
|
||||||
|
<td class="success">passed</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="success">Assert that removing a worker removes the worker from the worker list</td>
|
||||||
|
<td class="success">assertRemoveWorkerActuallyRemoves()</td>
|
||||||
|
<td class="success">0.002s</td>
|
||||||
|
<td class="success">passed</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="success">Assert that removing Workers is possible through the UI</td>
|
||||||
|
<td class="success">assertRemovingWorkersIsPossibleThroughUI()</td>
|
||||||
<td class="success">0.003s</td>
|
<td class="success">0.003s</td>
|
||||||
<td class="success">passed</td>
|
<td class="success">passed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="success">Assert that the Scanner is actually started when AM calls start</td>
|
||||||
|
<td class="success">assertScannerExists()</td>
|
||||||
|
<td class="success">0.001s</td>
|
||||||
|
<td class="success">passed</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="success">Assert that Task State is actually changed when submitted as finished</td>
|
<td class="success">Assert that Task State is actually changed when submitted as finished</td>
|
||||||
<td class="success">assertTaskStateChanges()</td>
|
<td class="success">assertTaskStateChanges()</td>
|
||||||
<td class="success">0.002s</td>
|
<td class="success">0.002s</td>
|
||||||
@@ -108,7 +147,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="success">Assert that a Worker can add a Task</td>
|
<td class="success">Assert that a Worker can add a Task</td>
|
||||||
<td class="success">assertWorkerCanAddTask()</td>
|
<td class="success">assertWorkerCanAddTask()</td>
|
||||||
<td class="success">0.001s</td>
|
<td class="success">0.003s</td>
|
||||||
<td class="success">passed</td>
|
<td class="success">passed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -119,6 +158,83 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab">
|
||||||
|
<h2>Standard output</h2>
|
||||||
|
<span class="code">
|
||||||
|
<pre>Enter task ID:
|
||||||
|
Task 1 (Run) selected
|
||||||
|
Commands: finish, unfinish, remove, edit, back
|
||||||
|
Enter new name;description:
|
||||||
|
Task edited
|
||||||
|
=== Available Commands ===
|
||||||
|
General:
|
||||||
|
help, ? - Show this help
|
||||||
|
exit - Exit the program
|
||||||
|
createworker - Create a new worker
|
||||||
|
createtask - Create a new task
|
||||||
|
selecttask - Select a task to work with
|
||||||
|
listworkers - List all workers
|
||||||
|
listtasks - List all tasks with status
|
||||||
|
listfinished - List only finished tasks
|
||||||
|
listunfinished - List only unfinished tasks
|
||||||
|
|
||||||
|
When a task is selected:
|
||||||
|
finish - Mark task as finished
|
||||||
|
unfinish - Mark task as unfinished
|
||||||
|
remove - Remove the task
|
||||||
|
edit - Edit task name and description
|
||||||
|
back - Return to main menu
|
||||||
|
|
||||||
|
When a worker is selected:
|
||||||
|
remove - Remove the worker
|
||||||
|
back - Return to main menu
|
||||||
|
=== Available Commands ===
|
||||||
|
General:
|
||||||
|
help, ? - Show this help
|
||||||
|
exit - Exit the program
|
||||||
|
createworker - Create a new worker
|
||||||
|
createtask - Create a new task
|
||||||
|
selecttask - Select a task to work with
|
||||||
|
listworkers - List all workers
|
||||||
|
listtasks - List all tasks with status
|
||||||
|
listfinished - List only finished tasks
|
||||||
|
listunfinished - List only unfinished tasks
|
||||||
|
|
||||||
|
When a task is selected:
|
||||||
|
finish - Mark task as finished
|
||||||
|
unfinish - Mark task as unfinished
|
||||||
|
remove - Remove the task
|
||||||
|
edit - Edit task name and description
|
||||||
|
back - Return to main menu
|
||||||
|
|
||||||
|
When a worker is selected:
|
||||||
|
remove - Remove the worker
|
||||||
|
back - Return to main menu
|
||||||
|
Enter worker name:
|
||||||
|
Created worker with ID: 1001
|
||||||
|
Enter task ID:
|
||||||
|
Invalid input. Please enter a task ID or 'back':
|
||||||
|
Invalid input. Please enter a task ID or 'back':
|
||||||
|
Enter task ID:
|
||||||
|
Task 1 (Run) selected
|
||||||
|
Commands: finish, unfinish, remove, edit, back
|
||||||
|
Task marked as finished
|
||||||
|
Task marked as unfinished
|
||||||
|
Task removed
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
|
||||||
|
Available workers:
|
||||||
|
1001: Alfred
|
||||||
|
1002: Balfred
|
||||||
|
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
</pre>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<p>
|
<p>
|
||||||
@@ -127,7 +243,7 @@
|
|||||||
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
||||||
</label>
|
</label>
|
||||||
</div>Generated by
|
</div>Generated by
|
||||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 03.12.2025, 19:35:34</p>
|
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 20:04:07</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,174 +0,0 @@
|
|||||||
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-size: 12pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
body, a, a:visited {
|
|
||||||
color: #303030;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content {
|
|
||||||
padding: 30px 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content h1 {
|
|
||||||
font-size: 160%;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#footer {
|
|
||||||
margin-top: 100px;
|
|
||||||
font-size: 80%;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
#footer, #footer a {
|
|
||||||
color: #a0a0a0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#line-wrapping-toggle {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
#label-for-line-wrapping-toggle {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1, h2, h3 {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 120%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-container .tab-container {
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.tabLinks {
|
|
||||||
padding: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
overflow: auto;
|
|
||||||
min-width: 800px;
|
|
||||||
width: auto;
|
|
||||||
border-bottom: solid 1px #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.tabLinks li {
|
|
||||||
float: left;
|
|
||||||
height: 100%;
|
|
||||||
list-style: none;
|
|
||||||
padding: 5px 10px;
|
|
||||||
border-radius: 7px 7px 0 0;
|
|
||||||
border: solid 1px transparent;
|
|
||||||
border-bottom: none;
|
|
||||||
margin-right: 6px;
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.tabLinks li.deselected > a {
|
|
||||||
color: #6d6d6d;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.tabLinks li:hover {
|
|
||||||
background-color: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.tabLinks li.selected {
|
|
||||||
background-color: #c5f0f5;
|
|
||||||
border-color: #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.tabLinks a {
|
|
||||||
font-size: 120%;
|
|
||||||
display: block;
|
|
||||||
outline: none;
|
|
||||||
text-decoration: none;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.tabLinks li h2 {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.tab {
|
|
||||||
}
|
|
||||||
|
|
||||||
div.selected {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.deselected {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.tab table {
|
|
||||||
min-width: 350px;
|
|
||||||
width: auto;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.tab th, div.tab table {
|
|
||||||
border-bottom: solid 1px #d0d0d0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.tab th {
|
|
||||||
text-align: left;
|
|
||||||
white-space: nowrap;
|
|
||||||
padding-left: 6em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.tab th:first-child {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.tab td {
|
|
||||||
white-space: nowrap;
|
|
||||||
padding-left: 6em;
|
|
||||||
padding-top: 5px;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.tab td:first-child {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.tab td.numeric, div.tab th.numeric {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.code {
|
|
||||||
display: inline-block;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.code pre {
|
|
||||||
font-size: 11pt;
|
|
||||||
padding: 10px;
|
|
||||||
margin: 0;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
border: solid 1px #d0d0d0;
|
|
||||||
min-width: 700px;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.wrapped pre {
|
|
||||||
word-wrap: break-word;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
|
|
||||||
label.hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
@@ -20,13 +20,13 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox" id="tests">
|
<div class="infoBox" id="tests">
|
||||||
<div class="counter">13</div>
|
<div class="counter">25</div>
|
||||||
<p>tests</p>
|
<p>tests</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox" id="failures">
|
<div class="infoBox" id="failures">
|
||||||
<div class="counter">0</div>
|
<div class="counter">3</div>
|
||||||
<p>failures</p>
|
<p>failures</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox" id="duration">
|
<div class="infoBox" id="duration">
|
||||||
<div class="counter">0.064s</div>
|
<div class="counter">1.048s</div>
|
||||||
<p>duration</p>
|
<p>duration</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -47,8 +47,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox success" id="successRate">
|
<div class="infoBox failures" id="successRate">
|
||||||
<div class="percent">100%</div>
|
<div class="percent">88%</div>
|
||||||
<p>successful</p>
|
<p>successful</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -58,6 +58,9 @@
|
|||||||
<div class="tab-container">
|
<div class="tab-container">
|
||||||
<ul class="tabLinks">
|
<ul class="tabLinks">
|
||||||
<li>
|
<li>
|
||||||
|
<a href="#">Failed tests</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
<a href="#">Packages</a>
|
<a href="#">Packages</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -65,6 +68,23 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
|
<h2>Failed tests</h2>
|
||||||
|
<ul class="linkList">
|
||||||
|
<li>
|
||||||
|
<a href="classes/hhn.temp.project.DatabaseGoodCasesTest.html">DatabaseGoodCasesTest</a>.
|
||||||
|
<a href="classes/hhn.temp.project.DatabaseGoodCasesTest.html#assertConnectToDatabase()">Assert connecting to database</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="classes/hhn.temp.project.DatabaseGoodCasesTest.html">DatabaseGoodCasesTest</a>.
|
||||||
|
<a href="classes/hhn.temp.project.DatabaseGoodCasesTest.html#assertGetTestClass()">Assert that the TestClass could be inserted into the database</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="classes/hhn.temp.project.DatabaseGoodCasesTest.html">DatabaseGoodCasesTest</a>.
|
||||||
|
<a href="classes/hhn.temp.project.DatabaseGoodCasesTest.html#assertInsertTestClass()">Assert that the TestClass could be inserted into the database</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="tab">
|
||||||
<h2>Packages</h2>
|
<h2>Packages</h2>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
@@ -79,14 +99,14 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="success">
|
<td class="failures">
|
||||||
<a href="packages/hhn.temp.project.html">hhn.temp.project</a>
|
<a href="packages/hhn.temp.project.html">hhn.temp.project</a>
|
||||||
</td>
|
</td>
|
||||||
<td>13</td>
|
<td>25</td>
|
||||||
|
<td>3</td>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
<td>0</td>
|
<td>1.048s</td>
|
||||||
<td>0.064s</td>
|
<td class="failures">88%</td>
|
||||||
<td class="success">100%</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -109,20 +129,40 @@
|
|||||||
<td class="success">
|
<td class="success">
|
||||||
<a href="classes/hhn.temp.project.BadCasesTest.html">hhn.temp.project.BadCasesTest</a>
|
<a href="classes/hhn.temp.project.BadCasesTest.html">hhn.temp.project.BadCasesTest</a>
|
||||||
</td>
|
</td>
|
||||||
<td>6</td>
|
<td>8</td>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
<td>0.057s</td>
|
<td>0.036s</td>
|
||||||
<td class="success">100%</td>
|
<td class="success">100%</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="success">
|
<td class="success">
|
||||||
|
<a href="classes/hhn.temp.project.DatabaseBadCasesTest.html">hhn.temp.project.DatabaseBadCasesTest</a>
|
||||||
|
</td>
|
||||||
|
<td>1</td>
|
||||||
|
<td>0</td>
|
||||||
|
<td>0</td>
|
||||||
|
<td>0.051s</td>
|
||||||
|
<td class="success">100%</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="failures">
|
||||||
|
<a href="classes/hhn.temp.project.DatabaseGoodCasesTest.html">hhn.temp.project.DatabaseGoodCasesTest</a>
|
||||||
|
</td>
|
||||||
|
<td>3</td>
|
||||||
|
<td>3</td>
|
||||||
|
<td>0</td>
|
||||||
|
<td>0.914s</td>
|
||||||
|
<td class="failures">0%</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="success">
|
||||||
<a href="classes/hhn.temp.project.GoodCasesTest.html">hhn.temp.project.GoodCasesTest</a>
|
<a href="classes/hhn.temp.project.GoodCasesTest.html">hhn.temp.project.GoodCasesTest</a>
|
||||||
</td>
|
</td>
|
||||||
<td>7</td>
|
<td>13</td>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
<td>0.007s</td>
|
<td>0.047s</td>
|
||||||
<td class="success">100%</td>
|
<td class="success">100%</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -136,7 +176,7 @@
|
|||||||
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
||||||
</label>
|
</label>
|
||||||
</div>Generated by
|
</div>Generated by
|
||||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 03.12.2025, 19:35:34</p>
|
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 20:04:07</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -22,13 +22,13 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox" id="tests">
|
<div class="infoBox" id="tests">
|
||||||
<div class="counter">13</div>
|
<div class="counter">25</div>
|
||||||
<p>tests</p>
|
<p>tests</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox" id="failures">
|
<div class="infoBox" id="failures">
|
||||||
<div class="counter">0</div>
|
<div class="counter">3</div>
|
||||||
<p>failures</p>
|
<p>failures</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox" id="duration">
|
<div class="infoBox" id="duration">
|
||||||
<div class="counter">0.064s</div>
|
<div class="counter">1.048s</div>
|
||||||
<p>duration</p>
|
<p>duration</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -49,8 +49,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="infoBox success" id="successRate">
|
<div class="infoBox failures" id="successRate">
|
||||||
<div class="percent">100%</div>
|
<div class="percent">88%</div>
|
||||||
<p>successful</p>
|
<p>successful</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -60,10 +60,30 @@
|
|||||||
<div class="tab-container">
|
<div class="tab-container">
|
||||||
<ul class="tabLinks">
|
<ul class="tabLinks">
|
||||||
<li>
|
<li>
|
||||||
|
<a href="#">Failed tests</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
<a href="#">Classes</a>
|
<a href="#">Classes</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
|
<h2>Failed tests</h2>
|
||||||
|
<ul class="linkList">
|
||||||
|
<li>
|
||||||
|
<a href="../classes/hhn.temp.project.DatabaseGoodCasesTest.html">DatabaseGoodCasesTest</a>.
|
||||||
|
<a href="../classes/hhn.temp.project.DatabaseGoodCasesTest.html#assertConnectToDatabase()">Assert connecting to database</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="../classes/hhn.temp.project.DatabaseGoodCasesTest.html">DatabaseGoodCasesTest</a>.
|
||||||
|
<a href="../classes/hhn.temp.project.DatabaseGoodCasesTest.html#assertGetTestClass()">Assert that the TestClass could be inserted into the database</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="../classes/hhn.temp.project.DatabaseGoodCasesTest.html">DatabaseGoodCasesTest</a>.
|
||||||
|
<a href="../classes/hhn.temp.project.DatabaseGoodCasesTest.html#assertInsertTestClass()">Assert that the TestClass could be inserted into the database</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="tab">
|
||||||
<h2>Classes</h2>
|
<h2>Classes</h2>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
@@ -80,20 +100,40 @@
|
|||||||
<td class="success">
|
<td class="success">
|
||||||
<a href="../classes/hhn.temp.project.BadCasesTest.html">BadCasesTest</a>
|
<a href="../classes/hhn.temp.project.BadCasesTest.html">BadCasesTest</a>
|
||||||
</td>
|
</td>
|
||||||
<td>6</td>
|
<td>8</td>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
<td>0.057s</td>
|
<td>0.036s</td>
|
||||||
<td class="success">100%</td>
|
<td class="success">100%</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="success">
|
<td class="success">
|
||||||
|
<a href="../classes/hhn.temp.project.DatabaseBadCasesTest.html">DatabaseBadCasesTest</a>
|
||||||
|
</td>
|
||||||
|
<td>1</td>
|
||||||
|
<td>0</td>
|
||||||
|
<td>0</td>
|
||||||
|
<td>0.051s</td>
|
||||||
|
<td class="success">100%</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="failures">
|
||||||
|
<a href="../classes/hhn.temp.project.DatabaseGoodCasesTest.html">DatabaseGoodCasesTest</a>
|
||||||
|
</td>
|
||||||
|
<td>3</td>
|
||||||
|
<td>3</td>
|
||||||
|
<td>0</td>
|
||||||
|
<td>0.914s</td>
|
||||||
|
<td class="failures">0%</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="success">
|
||||||
<a href="../classes/hhn.temp.project.GoodCasesTest.html">GoodCasesTest</a>
|
<a href="../classes/hhn.temp.project.GoodCasesTest.html">GoodCasesTest</a>
|
||||||
</td>
|
</td>
|
||||||
<td>7</td>
|
<td>13</td>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
<td>0.007s</td>
|
<td>0.047s</td>
|
||||||
<td class="success">100%</td>
|
<td class="success">100%</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -106,7 +146,7 @@
|
|||||||
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
||||||
</label>
|
</label>
|
||||||
</div>Generated by
|
</div>Generated by
|
||||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 03.12.2025, 19:35:34</p>
|
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 20:04:07</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<testsuite name="hhn.temp.project.BadCasesTest" tests="6" skipped="0" failures="0" errors="0" timestamp="2025-12-03T18:35:34.515Z" hostname="KEVIN-THINKPAD" time="0.067">
|
<testsuite name="hhn.temp.project.BadCasesTest" tests="8" skipped="0" failures="0" errors="0" timestamp="2026-01-06T19:04:07.051Z" hostname="KEVIN-THINKPAD" time="0.047">
|
||||||
<properties/>
|
<properties/>
|
||||||
<testcase name="Assert List isn't empty after adding a task" classname="hhn.temp.project.BadCasesTest" time="0.046"/>
|
<testcase name="Assert List isn't empty after adding a task" classname="hhn.temp.project.BadCasesTest" time="0.015"/>
|
||||||
<testcase name="Assert that Remove Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.003"/>
|
<testcase name="Assert non-existent commands are recognized as such" classname="hhn.temp.project.BadCasesTest" time="0.004"/>
|
||||||
<testcase name="Assert Add Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.002"/>
|
<testcase name="Assert that Remove Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.006"/>
|
||||||
<testcase name="Assert only existing tasks can be edited" classname="hhn.temp.project.BadCasesTest" time="0.002"/>
|
<testcase name="Assert that removing a non-existent worker throws an Exception" classname="hhn.temp.project.BadCasesTest" time="0.001"/>
|
||||||
<testcase name="Assert that un-/finishing a Task only works with valid parameters" classname="hhn.temp.project.BadCasesTest" time="0.002"/>
|
<testcase name="Assert Add Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.003"/>
|
||||||
<testcase name="Assert that added tasks can't be Null" classname="hhn.temp.project.BadCasesTest" time="0.002"/>
|
<testcase name="Assert only existing tasks can be edited" classname="hhn.temp.project.BadCasesTest" time="0.003"/>
|
||||||
<system-out><![CDATA[]]></system-out>
|
<testcase name="Assert that un-/finishing a Task only works with valid parameters" classname="hhn.temp.project.BadCasesTest" time="0.003"/>
|
||||||
|
<testcase name="Assert that added tasks can't be Null" classname="hhn.temp.project.BadCasesTest" time="0.001"/>
|
||||||
|
<system-out><![CDATA[Unknown command. Type 'help' for available commands.
|
||||||
|
]]></system-out>
|
||||||
<system-err><![CDATA[]]></system-err>
|
<system-err><![CDATA[]]></system-err>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
|||||||
@@ -1,13 +1,90 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<testsuite name="hhn.temp.project.GoodCasesTest" tests="7" skipped="0" failures="0" errors="0" timestamp="2025-12-03T18:35:34.587Z" hostname="KEVIN-THINKPAD" time="0.013">
|
<testsuite name="hhn.temp.project.GoodCasesTest" tests="13" skipped="0" failures="0" errors="0" timestamp="2026-01-06T19:04:07.158Z" hostname="KEVIN-THINKPAD" time="0.062">
|
||||||
<properties/>
|
<properties/>
|
||||||
<testcase name="Check Getters" classname="hhn.temp.project.GoodCasesTest" time="0.003"/>
|
<testcase name="Check Getters" classname="hhn.temp.project.GoodCasesTest" time="0.004"/>
|
||||||
|
<testcase name="Check that editing is possible through UI" classname="hhn.temp.project.GoodCasesTest" time="0.008"/>
|
||||||
|
<testcase name="Check that every required surface command actually works" classname="hhn.temp.project.GoodCasesTest" time="0.015"/>
|
||||||
<testcase name="Assert that added Tasks are added to the List" classname="hhn.temp.project.GoodCasesTest" time="0.001"/>
|
<testcase name="Assert that added Tasks are added to the List" classname="hhn.temp.project.GoodCasesTest" time="0.001"/>
|
||||||
<testcase name="Assert that Worker can remove Task" classname="hhn.temp.project.GoodCasesTest" time="0.0"/>
|
<testcase name="Assert that Worker can remove Task" classname="hhn.temp.project.GoodCasesTest" time="0.0"/>
|
||||||
<testcase name="Assert that a Worker can add a Task" classname="hhn.temp.project.GoodCasesTest" time="0.001"/>
|
<testcase name="Check that every task command works" classname="hhn.temp.project.GoodCasesTest" time="0.004"/>
|
||||||
<testcase name="Assert existing Tasks can be edited" classname="hhn.temp.project.GoodCasesTest" time="0.0"/>
|
<testcase name="Assert that a Worker can add a Task" classname="hhn.temp.project.GoodCasesTest" time="0.003"/>
|
||||||
|
<testcase name="Assert that removing Workers is possible through the UI" classname="hhn.temp.project.GoodCasesTest" time="0.003"/>
|
||||||
|
<testcase name="Assert existing Tasks can be edited" classname="hhn.temp.project.GoodCasesTest" time="0.001"/>
|
||||||
|
<testcase name="Assert that removing a worker removes the worker from the worker list" classname="hhn.temp.project.GoodCasesTest" time="0.002"/>
|
||||||
|
<testcase name="Assert that the Scanner is actually started when AM calls start" classname="hhn.temp.project.GoodCasesTest" time="0.001"/>
|
||||||
<testcase name="Assert that Task State is actually changed when submitted as finished" classname="hhn.temp.project.GoodCasesTest" time="0.002"/>
|
<testcase name="Assert that Task State is actually changed when submitted as finished" classname="hhn.temp.project.GoodCasesTest" time="0.002"/>
|
||||||
<testcase name="Assert deleted Tasks no longer show up in the List" classname="hhn.temp.project.GoodCasesTest" time="0.0"/>
|
<testcase name="Assert deleted Tasks no longer show up in the List" classname="hhn.temp.project.GoodCasesTest" time="0.003"/>
|
||||||
<system-out><![CDATA[]]></system-out>
|
<system-out><![CDATA[Enter task ID:
|
||||||
|
Task 1 (Run) selected
|
||||||
|
Commands: finish, unfinish, remove, edit, back
|
||||||
|
Enter new name;description:
|
||||||
|
Task edited
|
||||||
|
=== Available Commands ===
|
||||||
|
General:
|
||||||
|
help, ? - Show this help
|
||||||
|
exit - Exit the program
|
||||||
|
createworker - Create a new worker
|
||||||
|
createtask - Create a new task
|
||||||
|
selecttask - Select a task to work with
|
||||||
|
listworkers - List all workers
|
||||||
|
listtasks - List all tasks with status
|
||||||
|
listfinished - List only finished tasks
|
||||||
|
listunfinished - List only unfinished tasks
|
||||||
|
|
||||||
|
When a task is selected:
|
||||||
|
finish - Mark task as finished
|
||||||
|
unfinish - Mark task as unfinished
|
||||||
|
remove - Remove the task
|
||||||
|
edit - Edit task name and description
|
||||||
|
back - Return to main menu
|
||||||
|
|
||||||
|
When a worker is selected:
|
||||||
|
remove - Remove the worker
|
||||||
|
back - Return to main menu
|
||||||
|
=== Available Commands ===
|
||||||
|
General:
|
||||||
|
help, ? - Show this help
|
||||||
|
exit - Exit the program
|
||||||
|
createworker - Create a new worker
|
||||||
|
createtask - Create a new task
|
||||||
|
selecttask - Select a task to work with
|
||||||
|
listworkers - List all workers
|
||||||
|
listtasks - List all tasks with status
|
||||||
|
listfinished - List only finished tasks
|
||||||
|
listunfinished - List only unfinished tasks
|
||||||
|
|
||||||
|
When a task is selected:
|
||||||
|
finish - Mark task as finished
|
||||||
|
unfinish - Mark task as unfinished
|
||||||
|
remove - Remove the task
|
||||||
|
edit - Edit task name and description
|
||||||
|
back - Return to main menu
|
||||||
|
|
||||||
|
When a worker is selected:
|
||||||
|
remove - Remove the worker
|
||||||
|
back - Return to main menu
|
||||||
|
Enter worker name:
|
||||||
|
Created worker with ID: 1001
|
||||||
|
Enter task ID:
|
||||||
|
Invalid input. Please enter a task ID or 'back':
|
||||||
|
Invalid input. Please enter a task ID or 'back':
|
||||||
|
Enter task ID:
|
||||||
|
Task 1 (Run) selected
|
||||||
|
Commands: finish, unfinish, remove, edit, back
|
||||||
|
Task marked as finished
|
||||||
|
Task marked as unfinished
|
||||||
|
Task removed
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
|
||||||
|
Available workers:
|
||||||
|
1001: Alfred
|
||||||
|
1002: Balfred
|
||||||
|
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
Unknown command. Type 'help' for available commands.
|
||||||
|
]]></system-out>
|
||||||
<system-err><![CDATA[]]></system-err>
|
<system-err><![CDATA[]]></system-err>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
|||||||
Binary file not shown.
@@ -1,20 +0,0 @@
|
|||||||
Manifest-Version: 1.0
|
|
||||||
Created-By: Apache Maven Bundle Plugin 6.0.0
|
|
||||||
Build-Jdk-Spec: 21
|
|
||||||
Build-Tool-Jdk-Spec: 21
|
|
||||||
Automatic-Module-Name: org.jacoco.agent
|
|
||||||
Bnd-LastModified: 1743583180503
|
|
||||||
Bundle-Description: JaCoCo Agent
|
|
||||||
Bundle-License: https://www.eclipse.org/legal/epl-2.0/
|
|
||||||
Bundle-ManifestVersion: 2
|
|
||||||
Bundle-Name: JaCoCo Agent
|
|
||||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
|
||||||
Bundle-SymbolicName: org.jacoco.agent
|
|
||||||
Bundle-Vendor: Mountainminds GmbH & Co. KG
|
|
||||||
Bundle-Version: 0.8.13.202504020838
|
|
||||||
Eclipse-SourceReferences: scm:git:git://github.com/jacoco/jacoco.git;pat
|
|
||||||
h="org.jacoco.agent";commitId=78d5eff856bbe6129f05012e40c13d1840e20598
|
|
||||||
Export-Package: org.jacoco.agent;version="0.8.13"
|
|
||||||
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.5))"
|
|
||||||
Tool: Bnd-7.0.0.202310060912
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
artifactId=org.jacoco.agent
|
|
||||||
groupId=org.jacoco
|
|
||||||
version=0.8.13
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (c) 2009, 2025 Mountainminds GmbH & Co. KG and Contributors
|
|
||||||
This program and the accompanying materials are made available under
|
|
||||||
the terms of the Eclipse Public License 2.0 which is available at
|
|
||||||
http://www.eclipse.org/legal/epl-2.0
|
|
||||||
|
|
||||||
SPDX-License-Identifier: EPL-2.0
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Evgeny Mandrikov - initial API and implementation
|
|
||||||
-->
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>org.jacoco</groupId>
|
|
||||||
<artifactId>org.jacoco.build</artifactId>
|
|
||||||
<version>0.8.13</version>
|
|
||||||
<relativePath>../org.jacoco.build</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>org.jacoco.agent</artifactId>
|
|
||||||
|
|
||||||
<name>JaCoCo :: Agent</name>
|
|
||||||
<description>JaCoCo Agent</description>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<sourceDirectory>src</sourceDirectory>
|
|
||||||
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>prepare-package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>copy</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<artifactItems>
|
|
||||||
<artifactItem>
|
|
||||||
<groupId>${project.groupId}</groupId>
|
|
||||||
<artifactId>org.jacoco.agent.rt</artifactId>
|
|
||||||
<classifier>all</classifier>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
<destFileName>jacocoagent.jar</destFileName>
|
|
||||||
</artifactItem>
|
|
||||||
</artifactItems>
|
|
||||||
<outputDirectory>${project.build.directory}/classes</outputDirectory>
|
|
||||||
<overWriteReleases>false</overWriteReleases>
|
|
||||||
<overWriteSnapshots>false</overWriteSnapshots>
|
|
||||||
<overWriteIfNewer>true</overWriteIfNewer>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>build-helper-maven-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-artifacts</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>attach-artifact</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<artifacts>
|
|
||||||
<artifact>
|
|
||||||
<file>${project.build.directory}/classes/jacocoagent.jar</file>
|
|
||||||
<type>jar</type>
|
|
||||||
<classifier>runtime</classifier>
|
|
||||||
</artifact>
|
|
||||||
</artifacts>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.felix</groupId>
|
|
||||||
<artifactId>maven-bundle-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>process-classes</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>manifest</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<archive>
|
|
||||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
|
||||||
</archive>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>About</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
||||||
</head>
|
|
||||||
<body lang="EN-US">
|
|
||||||
<h2>About This Content</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
2025/04/02
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>License</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
All Content in this distribution is made available by Mountainminds GmbH & Co.
|
|
||||||
KG, Munich. Unless otherwise indicated below, the Content is provided to you
|
|
||||||
under the terms and conditions of the Eclipse Public License Version 2.0
|
|
||||||
("EPL"). A copy of the EPL is available at
|
|
||||||
<a href="https://www.eclipse.org/legal/epl-2.0/">https://www.eclipse.org/legal/epl-2.0/</a>.
|
|
||||||
For purposes of the EPL, "Program" will mean the Content.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Third Party Content</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The Content includes items that have been sourced from third parties as set
|
|
||||||
out below.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h4>ASM</h4>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<a href="https://asm.ow2.io/">ASM 9.8</a> is subject to the terms and
|
|
||||||
conditions of the following license:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
ASM: a very small and fast Java bytecode manipulation framework
|
|
||||||
Copyright (c) 2000-2011 INRIA, France Telecom
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions
|
|
||||||
are met:
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
3. Neither the name of the copyright holders nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
|
||||||
THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
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,2 +0,0 @@
|
|||||||
Manifest-Version: 1.0
|
|
||||||
|
|
||||||
44
git show bc0e30860cb3697296a4ef6ee22735a5c83cf522
Normal file
44
git show bc0e30860cb3697296a4ef6ee22735a5c83cf522
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
[33mcommit bc0e30860cb3697296a4ef6ee22735a5c83cf522[m[33m ([m[1;36mHEAD[m[33m -> [m[1;32mdatabase[m[33m)[m
|
||||||
|
Author: Riley Schneider <88947587+Ferryry@users.noreply.github.com>
|
||||||
|
Date: Wed Dec 3 17:30:33 2025 +0100
|
||||||
|
|
||||||
|
First database tests
|
||||||
|
|
||||||
|
[33mcommit 26f7ecbee653b98739e75eb8c4707745f252a1a8[m[33m ([m[1;31morigin/main[m[33m, [m[1;31morigin/HEAD[m[33m, [m[1;32mmain[m[33m)[m
|
||||||
|
Merge: 668a76e2 eed1390c
|
||||||
|
Author: Ferryry <rileymika99@gmail.com>
|
||||||
|
Date: Wed Dec 3 16:44:45 2025 +0100
|
||||||
|
|
||||||
|
Merge pull request 'Skeleton' (#1) from Skeleton into main
|
||||||
|
|
||||||
|
Reviewed-on: https://home.luithardt.cloud:5400/KevinSchoenmayer/GseTDDUebungKCLR/pulls/1
|
||||||
|
|
||||||
|
[33mcommit eed1390c6513f1b5e827fd6e09c91f54da7be463[m[33m ([m[1;31morigin/Skeleton[m[33m, [m[1;32mSkeleton[m[33m)[m
|
||||||
|
Author: Riley Schneider <88947587+Ferryry@users.noreply.github.com>
|
||||||
|
Date: Wed Dec 3 16:42:41 2025 +0100
|
||||||
|
|
||||||
|
Remove database folder
|
||||||
|
|
||||||
|
[33mcommit b732d8d4b50abc5893d138c6a574fef0025981e0[m
|
||||||
|
Author: Riley Schneider <88947587+Ferryry@users.noreply.github.com>
|
||||||
|
Date: Wed Dec 3 16:38:10 2025 +0100
|
||||||
|
|
||||||
|
Initial Commit
|
||||||
|
|
||||||
|
[33mcommit c5e26bf594b282ab3d665590d0535b61afa18247[m
|
||||||
|
Author: KevinSchoenmayer <kschoenmay@stud.hs-heilbronn.de>
|
||||||
|
Date: Wed Dec 3 16:28:17 2025 +0100
|
||||||
|
|
||||||
|
Rough Skeleton for Tests and Classes
|
||||||
|
|
||||||
|
[33mcommit 668a76e26cfd908499bb74a7732269206062df86[m
|
||||||
|
Author: KevinSchoenmayer <kschoenmay@stud.hs-heilbronn.de>
|
||||||
|
Date: Wed Dec 3 15:26:09 2025 +0100
|
||||||
|
|
||||||
|
Initial Test Push
|
||||||
|
|
||||||
|
[33mcommit 2d963c7fd8ab188625c0e2bc9203c4d55ee07aa3[m
|
||||||
|
Author: KevinSchoenmayer <kschoenmay@stud.hs-heilbronn.de>
|
||||||
|
Date: Wed Dec 3 15:18:41 2025 +0100
|
||||||
|
|
||||||
|
Initial commit
|
||||||
@@ -6,28 +6,40 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class AssignmentManager {
|
public class AssignmentManager {
|
||||||
Map<Integer, Worker> workerMap;
|
private Map<Integer, Worker> workerMap;
|
||||||
Map<Integer, Task> taskMap;
|
private Map<Integer, Task> taskMap;
|
||||||
int workerIdCounter;
|
private int workerIdCounter;
|
||||||
int taskIdCounter;
|
private int taskIdCounter;
|
||||||
|
private UserCommands userInterface;
|
||||||
|
|
||||||
public AssignmentManager() {
|
public AssignmentManager() {
|
||||||
workerMap = new HashMap<>();
|
workerMap = new HashMap<>();
|
||||||
taskMap = new HashMap<>();
|
taskMap = new HashMap<>();
|
||||||
int workerIdCounter = 1000;
|
workerIdCounter = 1000;
|
||||||
int taskIdCounter = 0;
|
taskIdCounter = 0;
|
||||||
|
userInterface = new UserCommands(this);
|
||||||
}
|
}
|
||||||
|
public Map<Integer, Task> getTaskMap() {
|
||||||
|
return taskMap;
|
||||||
|
}
|
||||||
|
public Map<Integer, Worker> getWorkerMap() {return workerMap;}
|
||||||
|
|
||||||
public int createWorker(String name) {
|
public int createWorker(String name) {
|
||||||
Worker worker = new Worker(name, ++workerIdCounter);
|
Worker worker = new Worker(name, ++workerIdCounter);
|
||||||
workerMap.put(workerIdCounter, worker);
|
workerMap.put(workerIdCounter, worker);
|
||||||
return workerIdCounter;
|
return workerIdCounter;
|
||||||
}
|
}
|
||||||
|
public void removeWorker(int workerId) {
|
||||||
|
if (!workerMap.containsKey(workerId)) {
|
||||||
|
throw new IllegalArgumentException("WorkerId must exist in order to remove it");
|
||||||
|
}
|
||||||
|
workerMap.remove(workerId);
|
||||||
|
}
|
||||||
public int addTask(int workerId, String name, String description) {
|
public int addTask(int workerId, String name, String description) {
|
||||||
if (!workerMap.containsKey(workerId) || name == null || description == null) {
|
if (!workerMap.containsKey(workerId) || name == null || description == null) {
|
||||||
throw new IllegalArgumentException("WorkerId must exist and name or description can't be null");
|
throw new IllegalArgumentException("WorkerId must exist and name or description can't be null");
|
||||||
}
|
}
|
||||||
Task task = new Task(++taskIdCounter, workerId, name, description, this);
|
Task task = new Task(++taskIdCounter, workerId, name, description);
|
||||||
taskMap.put(taskIdCounter, task);
|
taskMap.put(taskIdCounter, task);
|
||||||
return taskIdCounter;
|
return taskIdCounter;
|
||||||
}
|
}
|
||||||
@@ -37,8 +49,11 @@ public class AssignmentManager {
|
|||||||
}
|
}
|
||||||
return taskMap.get(taskId);
|
return taskMap.get(taskId);
|
||||||
}
|
}
|
||||||
public Map<Integer, Task> getTaskMap() {
|
public Worker getWorker(int workerId) {
|
||||||
return taskMap;
|
if (!workerMap.containsKey(workerId)) {
|
||||||
|
throw new IllegalArgumentException("Worker Id does not exist");
|
||||||
|
}
|
||||||
|
return workerMap.get(workerId);
|
||||||
}
|
}
|
||||||
public void editTask(int workerId, int taskId, String name, String description) {
|
public void editTask(int workerId, int taskId, String name, String description) {
|
||||||
if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {
|
if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {
|
||||||
@@ -68,5 +83,16 @@ public class AssignmentManager {
|
|||||||
Task task = taskMap.get(taskId);
|
Task task = taskMap.get(taskId);
|
||||||
task.setTaskState(TaskState.IN_PROGRESS);
|
task.setTaskState(TaskState.IN_PROGRESS);
|
||||||
}
|
}
|
||||||
|
public UserCommands getUserCommands() {
|
||||||
|
return userInterface;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startCLI() {
|
||||||
|
userInterface.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stopCLI() {
|
||||||
|
userInterface.stop();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/main/java/hhn/temp/project/Main.java
Normal file
10
src/main/java/hhn/temp/project/Main.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class Main {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
AssignmentManager manager = new AssignmentManager();
|
||||||
|
manager.startCLI();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
package hhn.temp.project;
|
package hhn.temp.project;
|
||||||
|
|
||||||
public class Task {
|
public class Task {
|
||||||
String name;
|
private String name;
|
||||||
String description;
|
private String description;
|
||||||
int taskId;
|
private int taskId;
|
||||||
int workerId;
|
private int workerId;
|
||||||
AssignmentManager manager;
|
private TaskState state;
|
||||||
TaskState state;
|
public Task(int taskId, int workerId, String name, String description) {
|
||||||
public Task(int taskId, int workerId, String name, String description, AssignmentManager manager) {
|
|
||||||
this.manager = manager;
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.taskId = taskId;
|
this.taskId = taskId;
|
||||||
|
|||||||
444
src/main/java/hhn/temp/project/UserCommands.java
Normal file
444
src/main/java/hhn/temp/project/UserCommands.java
Normal file
@@ -0,0 +1,444 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
|
public class UserCommands implements Runnable {
|
||||||
|
private Scanner scanner;
|
||||||
|
private AssignmentManager manager;
|
||||||
|
private Integer selectedTaskId = null;
|
||||||
|
private Integer selectedWorkerId = null;
|
||||||
|
private AtomicBoolean running = new AtomicBoolean(false);
|
||||||
|
private Thread cliThread;
|
||||||
|
|
||||||
|
private enum InputState {
|
||||||
|
MAIN_MENU,
|
||||||
|
TASK_SELECTED,
|
||||||
|
WORKER_SELECTED,
|
||||||
|
AWAITING_EDIT_INPUT,
|
||||||
|
AWAITING_CREATE_TASK_WORKER,
|
||||||
|
AWAITING_CREATE_TASK_NAME,
|
||||||
|
AWAITING_CREATE_TASK_DESC,
|
||||||
|
AWAITING_CREATE_WORKER_NAME,
|
||||||
|
AWAITING_TASK_SELECTION
|
||||||
|
}
|
||||||
|
|
||||||
|
private InputState currentState = InputState.MAIN_MENU;
|
||||||
|
private Integer tempWorkerId = null;
|
||||||
|
private String tempTaskName = null;
|
||||||
|
|
||||||
|
public UserCommands(AssignmentManager manager) {
|
||||||
|
this.manager = manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
scanner = new Scanner(System.in);
|
||||||
|
running.set(true);
|
||||||
|
|
||||||
|
while (running.get()) {
|
||||||
|
printPrompt();
|
||||||
|
String input = scanner.nextLine().trim();
|
||||||
|
|
||||||
|
if ("exit".equalsIgnoreCase(input)) {
|
||||||
|
stop();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
handleInput(input);
|
||||||
|
}
|
||||||
|
scanner.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
if (cliThread == null || !cliThread.isAlive()) {
|
||||||
|
cliThread = new Thread(this, "CLI-Thread");
|
||||||
|
cliThread.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stop() {
|
||||||
|
running.set(false);
|
||||||
|
if (cliThread != null) {
|
||||||
|
cliThread.interrupt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printPrompt() {
|
||||||
|
if (!running.get()) return;
|
||||||
|
|
||||||
|
switch (currentState) {
|
||||||
|
case MAIN_MENU:
|
||||||
|
System.out.println("Type '?' or 'help' for a list of commands");
|
||||||
|
break;
|
||||||
|
case TASK_SELECTED:
|
||||||
|
System.out.println("Task " + selectedTaskId + " selected. Commands: finish, unfinish, remove, edit, back");
|
||||||
|
break;
|
||||||
|
case WORKER_SELECTED:
|
||||||
|
if (selectedWorkerId != null) {
|
||||||
|
System.out.println("Worker " + selectedWorkerId + " selected. Commands: remove, back");
|
||||||
|
} else {
|
||||||
|
System.out.println("Enter worker ID to select (or 'back'):");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case AWAITING_EDIT_INPUT:
|
||||||
|
System.out.println("Enter new name;description:");
|
||||||
|
break;
|
||||||
|
case AWAITING_CREATE_WORKER_NAME:
|
||||||
|
System.out.println("Enter worker name:");
|
||||||
|
break;
|
||||||
|
case AWAITING_CREATE_TASK_WORKER:
|
||||||
|
System.out.println("Enter worker ID:");
|
||||||
|
break;
|
||||||
|
case AWAITING_CREATE_TASK_NAME:
|
||||||
|
System.out.println("Enter task name:");
|
||||||
|
break;
|
||||||
|
case AWAITING_CREATE_TASK_DESC:
|
||||||
|
System.out.println("Enter task description:");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
System.out.print("> ");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void handleInput(String input) {
|
||||||
|
if (input == null || input.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("?".equals(input) || "help".equalsIgnoreCase(input)) {
|
||||||
|
showHelp();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
switch (currentState) {
|
||||||
|
case MAIN_MENU:
|
||||||
|
handleMainMenuInput(input);
|
||||||
|
break;
|
||||||
|
case TASK_SELECTED:
|
||||||
|
handleTaskSelectionInput(input);
|
||||||
|
break;
|
||||||
|
case WORKER_SELECTED:
|
||||||
|
handleWorkerSelectionInput(input);
|
||||||
|
break;
|
||||||
|
case AWAITING_EDIT_INPUT:
|
||||||
|
handleEditInput(input);
|
||||||
|
break;
|
||||||
|
case AWAITING_CREATE_TASK_WORKER:
|
||||||
|
handleCreateTaskWorkerInput(input);
|
||||||
|
break;
|
||||||
|
case AWAITING_CREATE_TASK_NAME:
|
||||||
|
handleCreateTaskNameInput(input);
|
||||||
|
break;
|
||||||
|
case AWAITING_CREATE_TASK_DESC:
|
||||||
|
handleCreateTaskDescInput(input);
|
||||||
|
break;
|
||||||
|
case AWAITING_CREATE_WORKER_NAME:
|
||||||
|
handleCreateWorkerNameInput(input);
|
||||||
|
break;
|
||||||
|
case AWAITING_TASK_SELECTION:
|
||||||
|
handleTaskIdInput(input);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("Error: " + e.getMessage());
|
||||||
|
resetToMainMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showHelp() {
|
||||||
|
System.out.println("=== Available Commands ===");
|
||||||
|
System.out.println("General:");
|
||||||
|
System.out.println(" help, ? - Show this help");
|
||||||
|
System.out.println(" exit - Exit the program");
|
||||||
|
System.out.println(" createworker - Create a new worker");
|
||||||
|
System.out.println(" createtask - Create a new task");
|
||||||
|
System.out.println(" selecttask - Select a task to work with");
|
||||||
|
System.out.println(" listworkers - List all workers");
|
||||||
|
System.out.println(" listtasks - List all tasks with status");
|
||||||
|
System.out.println(" listfinished - List only finished tasks");
|
||||||
|
System.out.println(" listunfinished - List only unfinished tasks");
|
||||||
|
|
||||||
|
System.out.println("\nWhen a task is selected:");
|
||||||
|
System.out.println(" finish - Mark task as finished");
|
||||||
|
System.out.println(" unfinish - Mark task as unfinished");
|
||||||
|
System.out.println(" remove - Remove the task");
|
||||||
|
System.out.println(" edit - Edit task name and description");
|
||||||
|
System.out.println(" back - Return to main menu");
|
||||||
|
|
||||||
|
System.out.println("\nWhen a worker is selected:");
|
||||||
|
System.out.println(" remove - Remove the worker");
|
||||||
|
System.out.println(" back - Return to main menu");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleMainMenuInput(String input) {
|
||||||
|
switch (input.toLowerCase()) {
|
||||||
|
case "createworker":
|
||||||
|
System.out.println("Enter worker name:");
|
||||||
|
currentState = InputState.AWAITING_CREATE_WORKER_NAME;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "createtask":
|
||||||
|
System.out.println("Enter worker ID:");
|
||||||
|
currentState = InputState.AWAITING_CREATE_TASK_WORKER;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "selecttask":
|
||||||
|
System.out.println("Enter task ID:");
|
||||||
|
currentState = InputState.AWAITING_TASK_SELECTION;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "listworkers":
|
||||||
|
listWorkers();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "listtasks":
|
||||||
|
listAllTasks();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "listfinished":
|
||||||
|
listTasksByStatus(TaskState.FINISHED);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "listunfinished":
|
||||||
|
listTasksByStatus(TaskState.IN_PROGRESS);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
System.out.println("Unknown command. Type 'help' for available commands.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listWorkers() {
|
||||||
|
System.out.println("\nAvailable workers:");
|
||||||
|
if (manager.getWorkerMap().isEmpty()) {
|
||||||
|
System.out.println(" No workers found.");
|
||||||
|
} else {
|
||||||
|
for (Worker w : manager.getWorkerMap().values()) {
|
||||||
|
System.out.println(" " + w.getId() + ": " + w.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listAllTasks() {
|
||||||
|
System.out.println("\nAll tasks:");
|
||||||
|
if (manager.getTaskMap().isEmpty()) {
|
||||||
|
System.out.println(" No tasks found.");
|
||||||
|
} else {
|
||||||
|
for (Task task : manager.getTaskMap().values()) {
|
||||||
|
Worker worker = manager.getWorker(task.getWorkerId());
|
||||||
|
String status = task.getTaskState() == TaskState.FINISHED ? "[FINISHED]" : "[IN PROGRESS]";
|
||||||
|
System.out.println(String.format(" %d: %s - %s (Worker: %d - %s)",
|
||||||
|
task.getTaskId(), status, task.getName(),
|
||||||
|
worker.getId(), worker.getName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listTasksByStatus(TaskState status) {
|
||||||
|
System.out.println("\nTasks with status: " + status);
|
||||||
|
boolean found = false;
|
||||||
|
|
||||||
|
for (Task task : manager.getTaskMap().values()) {
|
||||||
|
if (task.getTaskState() == status) {
|
||||||
|
Worker worker = manager.getWorker(task.getWorkerId());
|
||||||
|
System.out.println(String.format(" %d: %s (Worker: %d - %s)",
|
||||||
|
task.getTaskId(), task.getName(),
|
||||||
|
worker.getId(), worker.getName()));
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found) {
|
||||||
|
System.out.println(" No tasks found with this status.");
|
||||||
|
}
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleWorkerSelectionInput(String input) {
|
||||||
|
if ("back".equalsIgnoreCase(input)) {
|
||||||
|
resetToMainMenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
int workerId = Integer.parseInt(input.trim());
|
||||||
|
Worker worker = manager.getWorker(workerId);
|
||||||
|
if (worker != null) {
|
||||||
|
selectedWorkerId = workerId;
|
||||||
|
System.out.println("Worker " + workerId + " (" + worker.getName() + ") selected");
|
||||||
|
System.out.println("Commands: remove, back");
|
||||||
|
} else {
|
||||||
|
System.out.println("Worker not found. Please enter a valid worker ID:");
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
if (selectedWorkerId != null) {
|
||||||
|
handleWorkerCommand(input);
|
||||||
|
} else {
|
||||||
|
System.out.println("Invalid input. Please enter a worker ID or 'back':");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleWorkerCommand(String input) {
|
||||||
|
switch (input.toLowerCase()) {
|
||||||
|
case "remove":
|
||||||
|
manager.removeWorker(selectedWorkerId);
|
||||||
|
System.out.println("Worker removed");
|
||||||
|
resetToMainMenu();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "back":
|
||||||
|
resetToMainMenu();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
System.out.println("Unknown command. Available commands: remove, back");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleCreateWorkerNameInput(String input) {
|
||||||
|
int workerId = manager.createWorker(input.trim());
|
||||||
|
System.out.println("Created worker with ID: " + workerId);
|
||||||
|
resetToMainMenu();
|
||||||
|
}
|
||||||
|
private void handleTaskIdInput(String input) {
|
||||||
|
if ("back".equalsIgnoreCase(input)) {
|
||||||
|
resetToMainMenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
int taskId = Integer.parseInt(input.trim());
|
||||||
|
Task task = manager.getTask(taskId);
|
||||||
|
if (task != null) {
|
||||||
|
selectedTaskId = taskId;
|
||||||
|
currentState = InputState.TASK_SELECTED;
|
||||||
|
System.out.println("Task " + taskId + " (" + task.getName() + ") selected");
|
||||||
|
System.out.println("Commands: finish, unfinish, remove, edit, back");
|
||||||
|
} else {
|
||||||
|
System.out.println("Task not found. Please enter a valid task ID:");
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
System.out.println("Invalid input. Please enter a task ID or 'back':");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void handleCreateTaskWorkerInput(String input) {
|
||||||
|
try {
|
||||||
|
tempWorkerId = Integer.parseInt(input.trim());
|
||||||
|
System.out.println("Enter task name:");
|
||||||
|
currentState = InputState.AWAITING_CREATE_TASK_NAME;
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
System.out.println("Invalid worker ID. Please enter a number:");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleCreateTaskNameInput(String input) {
|
||||||
|
tempTaskName = input.trim();
|
||||||
|
System.out.println("Enter task description:");
|
||||||
|
currentState = InputState.AWAITING_CREATE_TASK_DESC;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleCreateTaskDescInput(String input) {
|
||||||
|
int taskId = manager.addTask(tempWorkerId, tempTaskName, input.trim());
|
||||||
|
System.out.println("Created task with ID: " + taskId);
|
||||||
|
resetToMainMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetToMainMenu() {
|
||||||
|
currentState = InputState.MAIN_MENU;
|
||||||
|
selectedTaskId = null;
|
||||||
|
selectedWorkerId = null;
|
||||||
|
tempWorkerId = null;
|
||||||
|
tempTaskName = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleTaskSelectionInput(String input) {
|
||||||
|
if ("back".equalsIgnoreCase(input)) {
|
||||||
|
resetToMainMenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
int taskId = Integer.parseInt(input.trim());
|
||||||
|
Task task = manager.getTask(taskId);
|
||||||
|
if (task != null) {
|
||||||
|
selectedTaskId = taskId;
|
||||||
|
currentState = InputState.TASK_SELECTED;
|
||||||
|
System.out.println("Task " + taskId + " (" + task.getName() + ") selected");
|
||||||
|
System.out.println("Commands: finish, unfinish, remove, edit, back");
|
||||||
|
} else {
|
||||||
|
System.out.println("Task not found. Please enter a valid task ID:");
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
if (selectedTaskId != null) {
|
||||||
|
handleTaskCommand(input);
|
||||||
|
} else {
|
||||||
|
System.out.println("Invalid input. Please enter a task ID or 'back':");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleTaskCommand(String input) {
|
||||||
|
switch (input.toLowerCase()) {
|
||||||
|
case "finish":
|
||||||
|
manager.finishTask(manager.getTask(selectedTaskId).getWorkerId(),selectedTaskId);
|
||||||
|
System.out.println("Task marked as finished");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "unfinish":
|
||||||
|
manager.unfinishTask(manager.getTask(selectedTaskId).getWorkerId(),selectedTaskId);
|
||||||
|
System.out.println("Task marked as unfinished");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "remove":
|
||||||
|
manager.removeTask(selectedTaskId);
|
||||||
|
System.out.println("Task removed");
|
||||||
|
resetToMainMenu();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "edit":
|
||||||
|
System.out.println("Enter new name;description:");
|
||||||
|
currentState = InputState.AWAITING_EDIT_INPUT;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "back":
|
||||||
|
resetToMainMenu();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
System.out.println("Unknown command. Type 'help' for available commands.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleEditInput(String input) {
|
||||||
|
String[] parts = input.split(";", 2);
|
||||||
|
if (parts.length == 2) {
|
||||||
|
manager.editTask(manager.getTask(selectedTaskId).getWorkerId(), selectedTaskId, parts[0], parts[1]);
|
||||||
|
System.out.println("Task edited");
|
||||||
|
} else {
|
||||||
|
System.out.println("Invalid format. Use: name;description");
|
||||||
|
System.out.println("Please try again:");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
currentState = InputState.TASK_SELECTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Scanner getScanner() {
|
||||||
|
return scanner;
|
||||||
|
}
|
||||||
|
|
||||||
|
//only for testing
|
||||||
|
public void setScanner(Scanner scanner) {
|
||||||
|
this.scanner = scanner;
|
||||||
|
}
|
||||||
|
|
||||||
|
//only for testing
|
||||||
|
public boolean isRunning() {
|
||||||
|
return running.get();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package hhn.temp.project;
|
package hhn.temp.project;
|
||||||
|
|
||||||
public class Worker {
|
public class Worker {
|
||||||
String name;
|
private String name;
|
||||||
int workerId;
|
private int workerId;
|
||||||
public Worker(String name, int workerId) {
|
public Worker(String name, int workerId) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.workerId = workerId;
|
this.workerId = workerId;
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package hhn.temp.project.provider;
|
package hhn.temp.project.provider;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
public interface Database {
|
public interface Database {
|
||||||
public boolean connect();
|
public void connect() throws SQLException, IOException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package hhn.temp.project.provider;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.DriverManager;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SimpleDatabaseManager<E> implements DatabaseManager<E> {
|
||||||
|
|
||||||
|
private Connection connection;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveObjects(Collection<E> objects) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<E> getObjects() {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveObject(E object) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public E getObject(int id) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void connect() throws SQLException, IOException {
|
||||||
|
connection = DriverManager.getConnection("jdbc:mysql://sql7.freesqldatabase.com/sql7810540?user=sql7810540&password=mXdJCFtDZz");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -52,4 +52,20 @@ public class BadCasesTest {
|
|||||||
assertThrows(IllegalArgumentException.class, () -> manager.finishTask(20405, 21034));
|
assertThrows(IllegalArgumentException.class, () -> manager.finishTask(20405, 21034));
|
||||||
assertThrows(IllegalArgumentException.class, () -> manager.unfinishTask(20405, 21034));
|
assertThrows(IllegalArgumentException.class, () -> manager.unfinishTask(20405, 21034));
|
||||||
}
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that removing a non-existent worker throws an Exception")
|
||||||
|
public void assertRemovingNonExistentWorkerFails() {
|
||||||
|
assertThrows(IllegalArgumentException.class, () -> manager.removeWorker(34054));
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert non-existent commands are recognized as such")
|
||||||
|
public void assertInvalidCommandsDontCrash() {
|
||||||
|
int workerId = manager.createWorker("Alfred");
|
||||||
|
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||||
|
try {
|
||||||
|
manager.getUserCommands().handleInput("baum");
|
||||||
|
} catch (Exception e) {
|
||||||
|
fail("Should not crash just because a command is invalid");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
39
test/hhn/temp/project/DatabaseBadCasesTest.java
Normal file
39
test/hhn/temp/project/DatabaseBadCasesTest.java
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
import hhn.temp.project.provider.DatabaseManager;
|
||||||
|
import hhn.temp.project.provider.SimpleDatabaseManager;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
public class DatabaseBadCasesTest {
|
||||||
|
|
||||||
|
private DatabaseManager<DatabaseGoodCasesTest.TestClass> databaseManager;
|
||||||
|
|
||||||
|
public class TestClass {
|
||||||
|
private int id;
|
||||||
|
private String dataString;
|
||||||
|
private int dataInteger;
|
||||||
|
|
||||||
|
public TestClass(int id, String dataString, int dataInteger) {
|
||||||
|
this.id = id;
|
||||||
|
this.dataString = dataString;
|
||||||
|
this.dataInteger = dataInteger;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void setup() {
|
||||||
|
databaseManager = new SimpleDatabaseManager<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert connection failed")
|
||||||
|
public void assertConnectionFailed() {
|
||||||
|
assertThrows(SQLException.class, () -> databaseManager.connect());
|
||||||
|
}
|
||||||
|
}
|
||||||
56
test/hhn/temp/project/DatabaseGoodCasesTest.java
Normal file
56
test/hhn/temp/project/DatabaseGoodCasesTest.java
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
import hhn.temp.project.provider.DatabaseManager;
|
||||||
|
import hhn.temp.project.provider.SimpleDatabaseManager;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class DatabaseGoodCasesTest {
|
||||||
|
|
||||||
|
private DatabaseManager<DatabaseGoodCasesTest.TestClass> databaseManager;
|
||||||
|
|
||||||
|
public class TestClass {
|
||||||
|
private int id;
|
||||||
|
private String dataString;
|
||||||
|
private int dataInteger;
|
||||||
|
|
||||||
|
public TestClass(int id, String dataString, int dataInteger) {
|
||||||
|
this.id = id;
|
||||||
|
this.dataString = dataString;
|
||||||
|
this.dataInteger = dataInteger;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void setup() {
|
||||||
|
databaseManager = new SimpleDatabaseManager<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that the TestClass could be inserted into the database")
|
||||||
|
public void assertGetTestClass() throws SQLException, IOException {
|
||||||
|
TestClass testClass = new TestClass(1, "Hello World", 123);
|
||||||
|
|
||||||
|
databaseManager.connect();
|
||||||
|
databaseManager.getObject(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that the TestClass could be inserted into the database")
|
||||||
|
public void assertInsertTestClass() throws SQLException, IOException {
|
||||||
|
TestClass testClass = new TestClass(1, "Hello World", 123);
|
||||||
|
|
||||||
|
databaseManager.connect();
|
||||||
|
databaseManager.saveObject(testClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert connecting to database")
|
||||||
|
public void assertConnectToDatabase() throws SQLException, IOException {
|
||||||
|
databaseManager.connect();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,8 @@ import org.junit.jupiter.api.BeforeEach;
|
|||||||
import org.junit.jupiter.api.DisplayName;
|
import org.junit.jupiter.api.DisplayName;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
public class GoodCasesTest {
|
public class GoodCasesTest {
|
||||||
@@ -13,6 +15,7 @@ public class GoodCasesTest {
|
|||||||
public void setup() {
|
public void setup() {
|
||||||
manager = new AssignmentManager();
|
manager = new AssignmentManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("Assert that a Worker can add a Task")
|
@DisplayName("Assert that a Worker can add a Task")
|
||||||
public void assertWorkerCanAddTask() {
|
public void assertWorkerCanAddTask() {
|
||||||
@@ -30,6 +33,7 @@ public class GoodCasesTest {
|
|||||||
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||||
assertEquals(sizeCount + 1, manager.getTaskMap().size());
|
assertEquals(sizeCount + 1, manager.getTaskMap().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("Assert existing Tasks can be edited")
|
@DisplayName("Assert existing Tasks can be edited")
|
||||||
public void assertExistingTasksCanBeEdited() {
|
public void assertExistingTasksCanBeEdited() {
|
||||||
@@ -50,6 +54,7 @@ public class GoodCasesTest {
|
|||||||
manager.removeTask(taskId);
|
manager.removeTask(taskId);
|
||||||
assertEquals(sizeCount, manager.getTaskMap().size());
|
assertEquals(sizeCount, manager.getTaskMap().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("Assert deleted Tasks no longer show up in the List")
|
@DisplayName("Assert deleted Tasks no longer show up in the List")
|
||||||
public void assertDeletedTasksDisappear() {
|
public void assertDeletedTasksDisappear() {
|
||||||
@@ -58,18 +63,20 @@ public class GoodCasesTest {
|
|||||||
manager.removeTask(taskId);
|
manager.removeTask(taskId);
|
||||||
assertThrows(IllegalArgumentException.class, () -> manager.getTask(taskId));
|
assertThrows(IllegalArgumentException.class, () -> manager.getTask(taskId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("Check Getters")
|
@DisplayName("Check Getters")
|
||||||
public void assertGettersWorkCorrectly() {
|
public void assertGettersWorkCorrectly() {
|
||||||
int workerId = manager.createWorker("Alfred");
|
int workerId = manager.createWorker("Alfred");
|
||||||
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||||
assertEquals("Alfred", manager.workerMap.get(workerId).getName());
|
assertEquals("Alfred", manager.getWorkerMap().get(workerId).getName());
|
||||||
//This one may be somewhat nonsensical, but it ensures the getId works so one may iterate over the workerMap
|
//This one may be somewhat nonsensical, but it ensures the getId works so one may iterate over the workerMap
|
||||||
assertEquals(manager.workerMap.get(workerId).getId(), workerId);
|
assertEquals(manager.getWorkerMap().get(workerId).getId(), workerId);
|
||||||
assertEquals(manager.getTask(taskId).getTaskId(), taskId);
|
assertEquals(manager.getTask(taskId).getTaskId(), taskId);
|
||||||
assertEquals(manager.getTask(taskId).getWorkerId(), workerId);
|
assertEquals(manager.getTask(taskId).getWorkerId(), workerId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("Assert that Task State is actually changed when submitted as finished")
|
@DisplayName("Assert that Task State is actually changed when submitted as finished")
|
||||||
public void assertTaskStateChanges() {
|
public void assertTaskStateChanges() {
|
||||||
@@ -81,4 +88,68 @@ public class GoodCasesTest {
|
|||||||
assertSame(TaskState.IN_PROGRESS, manager.getTask(taskId).getTaskState());
|
assertSame(TaskState.IN_PROGRESS, manager.getTask(taskId).getTaskState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that the Scanner is actually started when AM calls start")
|
||||||
|
public void assertScannerExists() {
|
||||||
|
try {
|
||||||
|
Scanner scanner = manager.getUserCommands().getScanner();
|
||||||
|
} catch (Exception e) {
|
||||||
|
fail("Scanner does not exists or can't be gotten by getScanner()");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Check that every required surface command actually works")
|
||||||
|
public void assertCommandsAreRecognized() {
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("?"));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("help"));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("createWorker"));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("createTask"));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("selectTask"));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("listWorkers"));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("exit"));
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Check that every task command works")
|
||||||
|
public void assertFinishingTasksIsPossibleThroughUi() {
|
||||||
|
int workerId = manager.createWorker("Alfred");
|
||||||
|
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||||
|
manager.getUserCommands().handleInput("selectTask");
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput(taskId + ""));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("finish"));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("unfinish"));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("remove"));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("back"));
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("edit"));
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Check that editing is possible through UI")
|
||||||
|
public void assertEditingTasksIsPossibleThroughUi() {
|
||||||
|
int workerId = manager.createWorker("Alfred");
|
||||||
|
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||||
|
manager.getUserCommands().handleInput("selectTask");
|
||||||
|
manager.getUserCommands().handleInput(taskId + "");
|
||||||
|
manager.getUserCommands().handleInput("edit");
|
||||||
|
manager.getUserCommands().handleInput("Walk;Walk 3 Miles");
|
||||||
|
assertEquals("Walk", manager.getTask(taskId).getName());
|
||||||
|
assertEquals("Walk 3 Miles", manager.getTask(taskId).getDescription());
|
||||||
|
manager.getUserCommands().handleInput("back");
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that removing Workers is possible through the UI")
|
||||||
|
public void assertRemovingWorkersIsPossibleThroughUI() {
|
||||||
|
int workerId = manager.createWorker("Alfred");
|
||||||
|
int workerId2 = manager.createWorker("Balfred");
|
||||||
|
manager.getUserCommands().handleInput("listWorkers");
|
||||||
|
manager.getUserCommands().handleInput(workerId + "");
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("remove"));
|
||||||
|
manager.getUserCommands().handleInput(workerId2 + "");
|
||||||
|
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("back"));
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that removing a worker removes the worker from the worker list")
|
||||||
|
public void assertRemoveWorkerActuallyRemoves() {
|
||||||
|
int workerId = manager.createWorker("Alfred");
|
||||||
|
manager.removeWorker(workerId);
|
||||||
|
assertThrows(IllegalArgumentException.class, () -> manager.getWorker(workerId)); // Use getWorker
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user