ScannerImplementation #5
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.
Binary file not shown.
Binary file not shown.
@@ -41,7 +41,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox" id="duration">
|
||||
<div class="counter">0.016s</div>
|
||||
<div class="counter">0.036s</div>
|
||||
<p>duration</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -81,7 +81,7 @@
|
||||
<tr>
|
||||
<td class="success">Assert Add Task is programmed defensively</td>
|
||||
<td class="success">assertAddTaskOnlyAcceptsValidParameters()</td>
|
||||
<td class="success">0.002s</td>
|
||||
<td class="success">0.003s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -93,31 +93,31 @@
|
||||
<tr>
|
||||
<td class="success">Assert non-existent commands are recognized as such</td>
|
||||
<td class="success">assertInvalidCommandsDontCrash()</td>
|
||||
<td class="success">0.001s</td>
|
||||
<td class="success">0.004s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="success">Assert List isn't empty after adding a task</td>
|
||||
<td class="success">assertListNowEmptyAfterAdd()</td>
|
||||
<td class="success">0.002s</td>
|
||||
<td class="success">0.015s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="success">Assert that added tasks can't be Null</td>
|
||||
<td class="success">assertNewTasksAreNotNull()</td>
|
||||
<td class="success">0.002s</td>
|
||||
<td class="success">0.001s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="success">Assert that Remove Task is programmed defensively</td>
|
||||
<td class="success">assertRemoveTaskOnlyAcceptsValidParameters()</td>
|
||||
<td class="success">0.001s</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.002s</td>
|
||||
<td class="success">0.001s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -143,7 +143,7 @@
|
||||
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
||||
</label>
|
||||
</div>Generated by
|
||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 19:34:44</p>
|
||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 20:04:07</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox" id="failures">
|
||||
<div class="counter">1</div>
|
||||
<div class="counter">0</div>
|
||||
<p>failures</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -41,7 +41,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox" id="duration">
|
||||
<div class="counter">0.085s</div>
|
||||
<div class="counter">0.047s</div>
|
||||
<p>duration</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -50,8 +50,8 @@
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox failures" id="successRate">
|
||||
<div class="percent">92%</div>
|
||||
<div class="infoBox success" id="successRate">
|
||||
<div class="percent">100%</div>
|
||||
<p>successful</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -61,9 +61,6 @@
|
||||
<div class="tab-container">
|
||||
<ul class="tabLinks">
|
||||
<li>
|
||||
<a href="#">Failed tests</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">Tests</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -71,25 +68,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab">
|
||||
<h2>Failed tests</h2>
|
||||
<div class="test">
|
||||
<a name="assertRemoveWorkerActuallyRemoves()"></a>
|
||||
<h3 class="failures">Assert that removing a worker removes the worker from the worker list</h3>
|
||||
<span class="code">
|
||||
<pre>org.opentest4j.AssertionFailedError: Expected java.lang.IllegalArgumentException to be thrown, but nothing was thrown.
|
||||
at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
|
||||
at app//org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:73)
|
||||
at app//org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:35)
|
||||
at app//org.junit.jupiter.api.Assertions.assertThrows(Assertions.java:3111)
|
||||
at app//hhn.temp.project.GoodCasesTest.assertRemoveWorkerActuallyRemoves(GoodCasesTest.java:153)
|
||||
at java.base@17.0.2/java.lang.reflect.Method.invoke(Method.java:568)
|
||||
at java.base@17.0.2/java.util.ArrayList.forEach(ArrayList.java:1511)
|
||||
at java.base@17.0.2/java.util.ArrayList.forEach(ArrayList.java:1511)
|
||||
</pre>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab">
|
||||
<h2>Tests</h2>
|
||||
<table>
|
||||
<thead>
|
||||
@@ -103,19 +81,19 @@
|
||||
<tr>
|
||||
<td class="success">Check that every required surface command actually works</td>
|
||||
<td class="success">assertCommandsAreRecognized()</td>
|
||||
<td class="success">0.017s</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">assertDeletedTasksDisappear()</td>
|
||||
<td class="success">0.001s</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.014s</td>
|
||||
<td class="success">0.008s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -127,25 +105,25 @@
|
||||
<tr>
|
||||
<td class="success">Check that every task command works</td>
|
||||
<td class="success">assertFinishingTasksIsPossibleThroughUi()</td>
|
||||
<td class="success">0.008s</td>
|
||||
<td class="success">0.004s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="success">Check Getters</td>
|
||||
<td class="success">assertGettersWorkCorrectly()</td>
|
||||
<td class="success">0.019s</td>
|
||||
<td class="success">0.004s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="failures">Assert that removing a worker removes the worker from the worker list</td>
|
||||
<td class="failures">assertRemoveWorkerActuallyRemoves()</td>
|
||||
<td class="failures">0.012s</td>
|
||||
<td class="failures">failed</td>
|
||||
<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.005s</td>
|
||||
<td class="success">0.003s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -175,7 +153,7 @@
|
||||
<tr>
|
||||
<td class="success">Assert that Worker can remove Task</td>
|
||||
<td class="success">assertWorkerCanRemoveOwnTask()</td>
|
||||
<td class="success">0.001s</td>
|
||||
<td class="success">0s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -192,13 +170,13 @@ Task edited
|
||||
General:
|
||||
help, ? - Show this help
|
||||
exit - Exit the program
|
||||
listworkers - List all workers and select one
|
||||
selecttask - Select a task by ID
|
||||
createtask - Create a new task
|
||||
createworker - Create a new worker
|
||||
listtasks - List all tasks
|
||||
listunfinished - List unfinished tasks
|
||||
listfinished - List finished tasks
|
||||
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
|
||||
@@ -214,13 +192,13 @@ When a worker is selected:
|
||||
General:
|
||||
help, ? - Show this help
|
||||
exit - Exit the program
|
||||
listworkers - List all workers and select one
|
||||
selecttask - Select a task by ID
|
||||
createtask - Create a new task
|
||||
createworker - Create a new worker
|
||||
listtasks - List all tasks
|
||||
listunfinished - List unfinished tasks
|
||||
listfinished - List finished tasks
|
||||
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
|
||||
@@ -233,7 +211,7 @@ When a worker is selected:
|
||||
remove - Remove the worker
|
||||
back - Return to main menu
|
||||
Enter worker name:
|
||||
Created worker with ID: 1
|
||||
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':
|
||||
@@ -245,13 +223,13 @@ Task marked as unfinished
|
||||
Task removed
|
||||
Unknown command. Type 'help' for available commands.
|
||||
Unknown command. Type 'help' for available commands.
|
||||
|
||||
Available workers:
|
||||
1: Alfred
|
||||
2: Balfred
|
||||
Enter worker ID to select (or 'back'):
|
||||
Worker 1 (Alfred) selected
|
||||
Commands: remove, back
|
||||
Worker removed
|
||||
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>
|
||||
@@ -265,7 +243,7 @@ Unknown command. Type 'help' for available commands.
|
||||
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
||||
</label>
|
||||
</div>Generated by
|
||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 19:34:44</p>
|
||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 20:04:07</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox" id="failures">
|
||||
<div class="counter">4</div>
|
||||
<div class="counter">3</div>
|
||||
<p>failures</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -38,7 +38,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox" id="duration">
|
||||
<div class="counter">1.063s</div>
|
||||
<div class="counter">1.048s</div>
|
||||
<p>duration</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -48,7 +48,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox failures" id="successRate">
|
||||
<div class="percent">84%</div>
|
||||
<div class="percent">88%</div>
|
||||
<p>successful</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -82,10 +82,6 @@
|
||||
<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>
|
||||
<li>
|
||||
<a href="classes/hhn.temp.project.GoodCasesTest.html">GoodCasesTest</a>.
|
||||
<a href="classes/hhn.temp.project.GoodCasesTest.html#assertRemoveWorkerActuallyRemoves()">Assert that removing a worker removes the worker from the worker list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab">
|
||||
@@ -107,10 +103,10 @@
|
||||
<a href="packages/hhn.temp.project.html">hhn.temp.project</a>
|
||||
</td>
|
||||
<td>25</td>
|
||||
<td>4</td>
|
||||
<td>3</td>
|
||||
<td>0</td>
|
||||
<td>1.063s</td>
|
||||
<td class="failures">84%</td>
|
||||
<td>1.048s</td>
|
||||
<td class="failures">88%</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -136,7 +132,7 @@
|
||||
<td>8</td>
|
||||
<td>0</td>
|
||||
<td>0</td>
|
||||
<td>0.016s</td>
|
||||
<td>0.036s</td>
|
||||
<td class="success">100%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -146,7 +142,7 @@
|
||||
<td>1</td>
|
||||
<td>0</td>
|
||||
<td>0</td>
|
||||
<td>0.070s</td>
|
||||
<td>0.051s</td>
|
||||
<td class="success">100%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -156,18 +152,18 @@
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>0</td>
|
||||
<td>0.892s</td>
|
||||
<td>0.914s</td>
|
||||
<td class="failures">0%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="failures">
|
||||
<td class="success">
|
||||
<a href="classes/hhn.temp.project.GoodCasesTest.html">hhn.temp.project.GoodCasesTest</a>
|
||||
</td>
|
||||
<td>13</td>
|
||||
<td>1</td>
|
||||
<td>0</td>
|
||||
<td>0.085s</td>
|
||||
<td class="failures">92%</td>
|
||||
<td>0</td>
|
||||
<td>0.047s</td>
|
||||
<td class="success">100%</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -180,7 +176,7 @@
|
||||
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
||||
</label>
|
||||
</div>Generated by
|
||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 19:34:44</p>
|
||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 20:04:07</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox" id="failures">
|
||||
<div class="counter">4</div>
|
||||
<div class="counter">3</div>
|
||||
<p>failures</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -40,7 +40,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox" id="duration">
|
||||
<div class="counter">1.063s</div>
|
||||
<div class="counter">1.048s</div>
|
||||
<p>duration</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -50,7 +50,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox failures" id="successRate">
|
||||
<div class="percent">84%</div>
|
||||
<div class="percent">88%</div>
|
||||
<p>successful</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -81,10 +81,6 @@
|
||||
<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>
|
||||
<li>
|
||||
<a href="../classes/hhn.temp.project.GoodCasesTest.html">GoodCasesTest</a>.
|
||||
<a href="../classes/hhn.temp.project.GoodCasesTest.html#assertRemoveWorkerActuallyRemoves()">Assert that removing a worker removes the worker from the worker list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab">
|
||||
@@ -107,7 +103,7 @@
|
||||
<td>8</td>
|
||||
<td>0</td>
|
||||
<td>0</td>
|
||||
<td>0.016s</td>
|
||||
<td>0.036s</td>
|
||||
<td class="success">100%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -117,7 +113,7 @@
|
||||
<td>1</td>
|
||||
<td>0</td>
|
||||
<td>0</td>
|
||||
<td>0.070s</td>
|
||||
<td>0.051s</td>
|
||||
<td class="success">100%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -127,18 +123,18 @@
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>0</td>
|
||||
<td>0.892s</td>
|
||||
<td>0.914s</td>
|
||||
<td class="failures">0%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="failures">
|
||||
<td class="success">
|
||||
<a href="../classes/hhn.temp.project.GoodCasesTest.html">GoodCasesTest</a>
|
||||
</td>
|
||||
<td>13</td>
|
||||
<td>1</td>
|
||||
<td>0</td>
|
||||
<td>0.085s</td>
|
||||
<td class="failures">92%</td>
|
||||
<td>0</td>
|
||||
<td>0.047s</td>
|
||||
<td class="success">100%</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -150,7 +146,7 @@
|
||||
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
|
||||
</label>
|
||||
</div>Generated by
|
||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 19:34:44</p>
|
||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 20:04:07</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite name="hhn.temp.project.BadCasesTest" tests="8" skipped="0" failures="0" errors="0" timestamp="2026-01-06T18:34:44.742Z" hostname="KEVIN-THINKPAD" time="0.026">
|
||||
<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/>
|
||||
<testcase name="Assert List isn't empty after adding a task" classname="hhn.temp.project.BadCasesTest" time="0.002"/>
|
||||
<testcase name="Assert non-existent commands are recognized as such" classname="hhn.temp.project.BadCasesTest" time="0.001"/>
|
||||
<testcase name="Assert that Remove Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.001"/>
|
||||
<testcase name="Assert that removing a non-existent worker throws an Exception" classname="hhn.temp.project.BadCasesTest" time="0.002"/>
|
||||
<testcase name="Assert Add Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.002"/>
|
||||
<testcase name="Assert List isn't empty after adding a task" classname="hhn.temp.project.BadCasesTest" time="0.015"/>
|
||||
<testcase name="Assert non-existent commands are recognized as such" classname="hhn.temp.project.BadCasesTest" time="0.004"/>
|
||||
<testcase name="Assert that Remove Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.006"/>
|
||||
<testcase name="Assert that removing a non-existent worker throws an Exception" classname="hhn.temp.project.BadCasesTest" time="0.001"/>
|
||||
<testcase name="Assert Add Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.003"/>
|
||||
<testcase name="Assert only existing tasks can be edited" classname="hhn.temp.project.BadCasesTest" time="0.003"/>
|
||||
<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.002"/>
|
||||
<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>
|
||||
|
||||
@@ -1,30 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuite name="hhn.temp.project.GoodCasesTest" tests="13" skipped="0" failures="1" errors="0" timestamp="2026-01-06T18:34:44.633Z" hostname="KEVIN-THINKPAD" time="0.105">
|
||||
<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/>
|
||||
<testcase name="Check Getters" classname="hhn.temp.project.GoodCasesTest" time="0.019"/>
|
||||
<testcase name="Check that editing is possible through UI" classname="hhn.temp.project.GoodCasesTest" time="0.014"/>
|
||||
<testcase name="Check that every required surface command actually works" classname="hhn.temp.project.GoodCasesTest" time="0.017"/>
|
||||
<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 Worker can remove Task" classname="hhn.temp.project.GoodCasesTest" time="0.001"/>
|
||||
<testcase name="Check that every task command works" classname="hhn.temp.project.GoodCasesTest" time="0.008"/>
|
||||
<testcase name="Assert that Worker can remove Task" classname="hhn.temp.project.GoodCasesTest" time="0.0"/>
|
||||
<testcase name="Check that every task command works" classname="hhn.temp.project.GoodCasesTest" time="0.004"/>
|
||||
<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.005"/>
|
||||
<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.012">
|
||||
<failure message="org.opentest4j.AssertionFailedError: Expected java.lang.IllegalArgumentException to be thrown, but nothing was thrown." type="org.opentest4j.AssertionFailedError">org.opentest4j.AssertionFailedError: Expected java.lang.IllegalArgumentException to be thrown, but nothing was thrown.
|
||||
at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
|
||||
at app//org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:73)
|
||||
at app//org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:35)
|
||||
at app//org.junit.jupiter.api.Assertions.assertThrows(Assertions.java:3111)
|
||||
at app//hhn.temp.project.GoodCasesTest.assertRemoveWorkerActuallyRemoves(GoodCasesTest.java:153)
|
||||
at java.base@17.0.2/java.lang.reflect.Method.invoke(Method.java:568)
|
||||
at java.base@17.0.2/java.util.ArrayList.forEach(ArrayList.java:1511)
|
||||
at java.base@17.0.2/java.util.ArrayList.forEach(ArrayList.java:1511)
|
||||
</failure>
|
||||
</testcase>
|
||||
<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 deleted Tasks no longer show up in the List" classname="hhn.temp.project.GoodCasesTest" time="0.001"/>
|
||||
<testcase name="Assert deleted Tasks no longer show up in the List" classname="hhn.temp.project.GoodCasesTest" time="0.003"/>
|
||||
<system-out><![CDATA[Enter task ID:
|
||||
Task 1 (Run) selected
|
||||
Commands: finish, unfinish, remove, edit, back
|
||||
@@ -34,13 +23,13 @@ Task edited
|
||||
General:
|
||||
help, ? - Show this help
|
||||
exit - Exit the program
|
||||
listworkers - List all workers and select one
|
||||
selecttask - Select a task by ID
|
||||
createtask - Create a new task
|
||||
createworker - Create a new worker
|
||||
listtasks - List all tasks
|
||||
listunfinished - List unfinished tasks
|
||||
listfinished - List finished tasks
|
||||
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
|
||||
@@ -56,13 +45,13 @@ When a worker is selected:
|
||||
General:
|
||||
help, ? - Show this help
|
||||
exit - Exit the program
|
||||
listworkers - List all workers and select one
|
||||
selecttask - Select a task by ID
|
||||
createtask - Create a new task
|
||||
createworker - Create a new worker
|
||||
listtasks - List all tasks
|
||||
listunfinished - List unfinished tasks
|
||||
listfinished - List finished tasks
|
||||
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
|
||||
@@ -75,7 +64,7 @@ When a worker is selected:
|
||||
remove - Remove the worker
|
||||
back - Return to main menu
|
||||
Enter worker name:
|
||||
Created worker with ID: 1
|
||||
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':
|
||||
@@ -87,13 +76,13 @@ Task marked as unfinished
|
||||
Task removed
|
||||
Unknown command. Type 'help' for available commands.
|
||||
Unknown command. Type 'help' for available commands.
|
||||
|
||||
Available workers:
|
||||
1: Alfred
|
||||
2: Balfred
|
||||
Enter worker ID to select (or 'back'):
|
||||
Worker 1 (Alfred) selected
|
||||
Commands: remove, back
|
||||
Worker removed
|
||||
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>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,8 +15,8 @@ public class AssignmentManager {
|
||||
public AssignmentManager() {
|
||||
workerMap = new HashMap<>();
|
||||
taskMap = new HashMap<>();
|
||||
int workerIdCounter = 1000;
|
||||
int taskIdCounter = 0;
|
||||
workerIdCounter = 1000;
|
||||
taskIdCounter = 0;
|
||||
userInterface = new UserCommands(this);
|
||||
}
|
||||
public Map<Integer, Task> getTaskMap() {
|
||||
|
||||
@@ -5,5 +5,6 @@ import java.util.Scanner;
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
AssignmentManager manager = new AssignmentManager();
|
||||
manager.startCLI();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,13 +151,13 @@ public class UserCommands implements Runnable {
|
||||
System.out.println("General:");
|
||||
System.out.println(" help, ? - Show this help");
|
||||
System.out.println(" exit - Exit the program");
|
||||
System.out.println(" listworkers - List all workers and select one");
|
||||
System.out.println(" selecttask - Select a task by ID");
|
||||
System.out.println(" createtask - Create a new task");
|
||||
System.out.println(" createworker - Create a new worker");
|
||||
System.out.println(" listtasks - List all tasks");
|
||||
System.out.println(" listunfinished - List unfinished tasks");
|
||||
System.out.println(" listfinished - List finished tasks");
|
||||
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");
|
||||
@@ -185,16 +185,23 @@ public class UserCommands implements Runnable {
|
||||
|
||||
case "selecttask":
|
||||
System.out.println("Enter task ID:");
|
||||
currentState = InputState.AWAITING_TASK_SELECTION; // Change to new state
|
||||
currentState = InputState.AWAITING_TASK_SELECTION;
|
||||
break;
|
||||
|
||||
case "listworkers":
|
||||
System.out.println("Available workers:");
|
||||
for (Worker w : manager.getWorkerMap().values()) {
|
||||
System.out.println(" " + w.getId() + ": " + w.getName());
|
||||
}
|
||||
System.out.println("Enter worker ID to select (or 'back'):");
|
||||
currentState = InputState.WORKER_SELECTED;
|
||||
listWorkers();
|
||||
break;
|
||||
|
||||
case "listtasks":
|
||||
listAllTasks();
|
||||
break;
|
||||
|
||||
case "listfinished":
|
||||
listTasksByStatus(TaskState.FINISHED);
|
||||
break;
|
||||
|
||||
case "listunfinished":
|
||||
listTasksByStatus(TaskState.IN_PROGRESS);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -202,6 +209,54 @@ public class UserCommands implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
@@ -150,6 +150,6 @@ public class GoodCasesTest {
|
||||
public void assertRemoveWorkerActuallyRemoves() {
|
||||
int workerId = manager.createWorker("Alfred");
|
||||
manager.removeWorker(workerId);
|
||||
assertThrows(IllegalArgumentException.class, () -> manager.getWorkerMap().containsKey(workerId));
|
||||
assertThrows(IllegalArgumentException.class, () -> manager.getWorker(workerId)); // Use getWorker
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user