Almost full implementation of Scanner UI. Two tests not passing, but safety commit

This commit is contained in:
2026-01-04 16:09:48 +01:00
parent a875f24e83
commit c85d55ce7d
22 changed files with 368 additions and 68 deletions

Binary file not shown.

View File

@@ -650,7 +650,7 @@ code + .copy-button {
<script type="text/javascript">
function configurationCacheProblems() { return (
// begin-report-data
{"diagnostics":[{"locations":[{}],"problem":[{"text":"Properties should be assigned using the 'propName = value' syntax. Setting a property via the Gradle-generated 'propName value' or 'propName(value)' syntax in Groovy DSL has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 10.0."}],"contextualLabel":"Properties should be assigned using the 'propName = value' syntax. Setting a property via the Gradle-generated 'propName value' or 'propName(value)' syntax in Groovy DSL has been deprecated.","documentationLink":"https://docs.gradle.org/8.14/userguide/upgrading_version_8.html#groovy_space_assignment_syntax","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"properties-should-be-assigned-using-the-propname-value-syntax-setting-a-property-via-the-gradle-generated-propname-value-or-propname-value-syntax-in-groovy-dsl","displayName":"Properties should be assigned using the 'propName = value' syntax. Setting a property via the Gradle-generated 'propName value' or 'propName(value)' syntax in Groovy DSL has been deprecated."}],"solutions":[[{"text":"Use assignment ('exceptionFormat = <value>') instead."}]]}],"problemsReport":{"totalProblemCount":1,"buildName":"Template","requestedTasks":"check","documentationLink":"https://docs.gradle.org/8.14/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
{"diagnostics":[{"locations":[{}],"problem":[{"text":"Properties should be assigned using the 'propName = value' syntax. Setting a property via the Gradle-generated 'propName value' or 'propName(value)' syntax in Groovy DSL has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 10.0."}],"contextualLabel":"Properties should be assigned using the 'propName = value' syntax. Setting a property via the Gradle-generated 'propName value' or 'propName(value)' syntax in Groovy DSL has been deprecated.","documentationLink":"https://docs.gradle.org/8.14/userguide/upgrading_version_8.html#groovy_space_assignment_syntax","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"properties-should-be-assigned-using-the-propname-value-syntax-setting-a-property-via-the-gradle-generated-propname-value-or-propname-value-syntax-in-groovy-dsl","displayName":"Properties should be assigned using the 'propName = value' syntax. Setting a property via the Gradle-generated 'propName value' or 'propName(value)' syntax in Groovy DSL has been deprecated."}],"solutions":[[{"text":"Use assignment ('exceptionFormat = <value>') instead."}]]}],"problemsReport":{"totalProblemCount":1,"buildName":"Template","requestedTasks":"test","documentationLink":"https://docs.gradle.org/8.14/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
// end-report-data
);}
</script>

View File

@@ -41,7 +41,7 @@
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.017s</div>
<div class="counter">0.096s</div>
<p>duration</p>
</div>
</td>
@@ -63,6 +63,9 @@
<li>
<a href="#">Tests</a>
</li>
<li>
<a href="#">Standard output</a>
</li>
</ul>
<div class="tab">
<h2>Tests</h2>
@@ -78,7 +81,7 @@
<tr>
<td class="success">Assert Add Task is programmed defensively</td>
<td class="success">assertAddTaskOnlyAcceptsValidParameters()</td>
<td class="success">0.003s</td>
<td class="success">0.007s</td>
<td class="success">passed</td>
</tr>
<tr>
@@ -90,31 +93,31 @@
<tr>
<td class="success">Assert non-existent commands are recognized as such</td>
<td class="success">assertInvalidCommandsDontCrash()</td>
<td class="success">0s</td>
<td class="success">0.015s</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.045s</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.003s</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.002s</td>
<td class="success">0.014s</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.006s</td>
<td class="success">passed</td>
</tr>
<tr>
@@ -125,6 +128,13 @@
</tr>
</table>
</div>
<div class="tab">
<h2>Standard output</h2>
<span class="code">
<pre>Unknown command. Type 'help' for available commands.
</pre>
</span>
</div>
</div>
<div id="footer">
<p>
@@ -133,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 04.01.2026, 15:20:17</p>
<a href="https://www.gradle.org">Gradle 8.14</a> at 04.01.2026, 16:08:46</p>
</div>
</div>
</body>

View File

@@ -41,7 +41,7 @@
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.133s</div>
<div class="counter">0.083s</div>
<p>duration</p>
</div>
</td>
@@ -66,6 +66,9 @@
<li>
<a href="#">Tests</a>
</li>
<li>
<a href="#">Standard output</a>
</li>
</ul>
<div class="tab">
<h2>Failed tests</h2>
@@ -118,7 +121,7 @@
<tr>
<td class="success">Check that every required surface command actually works</td>
<td class="success">assertCommandsAreRecognized()</td>
<td class="success">0.014s</td>
<td class="success">0.012s</td>
<td class="success">passed</td>
</tr>
<tr>
@@ -130,7 +133,7 @@
<tr>
<td class="failures">Check that editing is possible through UI</td>
<td class="failures">assertEditingTasksIsPossibleThroughUi()</td>
<td class="failures">0.067s</td>
<td class="failures">0.026s</td>
<td class="failures">failed</td>
</tr>
<tr>
@@ -142,43 +145,43 @@
<tr>
<td class="success">Check that every task command works</td>
<td class="success">assertFinishingTasksIsPossibleThroughUi()</td>
<td class="success">0.005s</td>
<td class="success">0.006s</td>
<td class="success">passed</td>
</tr>
<tr>
<td class="success">Check Getters</td>
<td class="success">assertGettersWorkCorrectly()</td>
<td class="success">0.026s</td>
<td class="success">0.007s</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.004s</td>
<td class="failures">0.003s</td>
<td class="failures">failed</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.005s</td>
<td class="success">passed</td>
</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">0.002s</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">assertTaskStateChanges()</td>
<td class="success">0.002s</td>
<td class="success">0.011s</td>
<td class="success">passed</td>
</tr>
<tr>
<td class="success">Assert that added Tasks are added to the List</td>
<td class="success">assertTasksShowInList()</td>
<td class="success">0.003s</td>
<td class="success">0.002s</td>
<td class="success">passed</td>
</tr>
<tr>
@@ -190,11 +193,49 @@
<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">0.002s</td>
<td class="success">passed</td>
</tr>
</table>
</div>
<div class="tab">
<h2>Standard output</h2>
<span class="code">
<pre>Enter task ID: Error: Cannot invoke &quot;java.util.Scanner.nextLine()&quot; because &quot;this.scanner&quot; is null
Enter new name;description: Error: Cannot invoke &quot;java.util.Scanner.nextLine()&quot; because &quot;this.scanner&quot; is null
Unknown command. Type 'help' for available commands.
Available commands:
createWorker - Create a new worker
createTask - Create a new task
selectTask - Select a task to work with
listWorkers - List all workers
help/? - Show this help
exit - Exit the program
Available commands:
createWorker - Create a new worker
createTask - Create a new task
selectTask - Select a task to work with
listWorkers - List all workers
help/? - Show this help
exit - Exit the program
Enter worker name: Error: Cannot invoke &quot;java.util.Scanner.nextLine()&quot; because &quot;this.scanner&quot; is null
Enter worker ID: Error: Cannot invoke &quot;java.util.Scanner.nextLine()&quot; because &quot;this.scanner&quot; is null
Enter task ID: Error: Cannot invoke &quot;java.util.Scanner.nextLine()&quot; because &quot;this.scanner&quot; is null
Unknown command. Type 'help' for available commands.
Unknown command. Type 'help' for available commands.
Enter task ID: Error: Cannot invoke &quot;java.util.Scanner.nextLine()&quot; because &quot;this.scanner&quot; is null
Task marked as finished
Task marked as unfinished
Task removed
Unknown command. Type 'help' for available commands.
Unknown command. Type 'help' for available commands.
Enter worker ID: Error: Cannot invoke &quot;java.util.Scanner.nextLine()&quot; because &quot;this.scanner&quot; is null
Worker removed
Unknown command. Type 'help' for available commands.
Unknown command. Type 'help' for available commands.
</pre>
</span>
</div>
</div>
<div id="footer">
<p>
@@ -203,7 +244,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 04.01.2026, 15:20:17</p>
<a href="https://www.gradle.org">Gradle 8.14</a> at 04.01.2026, 16:08:46</p>
</div>
</div>
</body>

View File

@@ -38,7 +38,7 @@
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.988s</div>
<div class="counter">0.911s</div>
<p>duration</p>
</div>
</td>
@@ -113,7 +113,7 @@
<td>25</td>
<td>5</td>
<td>0</td>
<td>0.988s</td>
<td>0.911s</td>
<td class="failures">80%</td>
</tr>
</tbody>
@@ -140,7 +140,7 @@
<td>8</td>
<td>0</td>
<td>0</td>
<td>0.017s</td>
<td>0.096s</td>
<td class="success">100%</td>
</tr>
<tr>
@@ -150,7 +150,7 @@
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.739s</td>
<td>0.037s</td>
<td class="success">100%</td>
</tr>
<tr>
@@ -160,7 +160,7 @@
<td>3</td>
<td>3</td>
<td>0</td>
<td>0.099s</td>
<td>0.695s</td>
<td class="failures">0%</td>
</tr>
<tr>
@@ -170,7 +170,7 @@
<td>13</td>
<td>2</td>
<td>0</td>
<td>0.133s</td>
<td>0.083s</td>
<td class="failures">84%</td>
</tr>
</tbody>
@@ -184,7 +184,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 04.01.2026, 15:20:17</p>
<a href="https://www.gradle.org">Gradle 8.14</a> at 04.01.2026, 16:08:46</p>
</div>
</div>
</body>

View File

@@ -40,7 +40,7 @@
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.988s</div>
<div class="counter">0.911s</div>
<p>duration</p>
</div>
</td>
@@ -111,7 +111,7 @@
<td>8</td>
<td>0</td>
<td>0</td>
<td>0.017s</td>
<td>0.096s</td>
<td class="success">100%</td>
</tr>
<tr>
@@ -121,7 +121,7 @@
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.739s</td>
<td>0.037s</td>
<td class="success">100%</td>
</tr>
<tr>
@@ -131,7 +131,7 @@
<td>3</td>
<td>3</td>
<td>0</td>
<td>0.099s</td>
<td>0.695s</td>
<td class="failures">0%</td>
</tr>
<tr>
@@ -141,7 +141,7 @@
<td>13</td>
<td>2</td>
<td>0</td>
<td>0.133s</td>
<td>0.083s</td>
<td class="failures">84%</td>
</tr>
</table>
@@ -154,7 +154,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 04.01.2026, 15:20:17</p>
<a href="https://www.gradle.org">Gradle 8.14</a> at 04.01.2026, 16:08:46</p>
</div>
</div>
</body>

View File

@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="hhn.temp.project.BadCasesTest" tests="8" skipped="0" failures="0" errors="0" timestamp="2026-01-04T14:20:17.301Z" hostname="KEVIN-THINKPAD" time="0.025">
<testsuite name="hhn.temp.project.BadCasesTest" tests="8" skipped="0" failures="0" errors="0" timestamp="2026-01-04T15:08:44.985Z" hostname="KEVIN-THINKPAD" time="0.121">
<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.0"/>
<testcase name="Assert that Remove Task is programmed defensively" 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.002"/>
<testcase name="Assert Add Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.003"/>
<testcase name="Assert List isn't empty after adding a task" classname="hhn.temp.project.BadCasesTest" time="0.045"/>
<testcase name="Assert non-existent commands are recognized as such" classname="hhn.temp.project.BadCasesTest" time="0.015"/>
<testcase name="Assert that Remove Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.014"/>
<testcase name="Assert that removing a non-existent worker throws an Exception" classname="hhn.temp.project.BadCasesTest" time="0.006"/>
<testcase name="Assert Add Task is programmed defensively" classname="hhn.temp.project.BadCasesTest" time="0.007"/>
<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"/>
<system-out><![CDATA[]]></system-out>
<testcase name="Assert that added tasks can't be Null" classname="hhn.temp.project.BadCasesTest" time="0.003"/>
<system-out><![CDATA[Unknown command. Type 'help' for available commands.
]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="hhn.temp.project.GoodCasesTest" tests="13" skipped="0" failures="2" errors="0" timestamp="2026-01-04T14:20:17.133Z" hostname="KEVIN-THINKPAD" time="0.162">
<testsuite name="hhn.temp.project.GoodCasesTest" tests="13" skipped="0" failures="2" errors="0" timestamp="2026-01-04T15:08:45.821Z" hostname="KEVIN-THINKPAD" time="0.107">
<properties/>
<testcase name="Check Getters" classname="hhn.temp.project.GoodCasesTest" time="0.026"/>
<testcase name="Check that editing is possible through UI" classname="hhn.temp.project.GoodCasesTest" time="0.067">
<testcase name="Check Getters" classname="hhn.temp.project.GoodCasesTest" time="0.007"/>
<testcase name="Check that editing is possible through UI" classname="hhn.temp.project.GoodCasesTest" time="0.026">
<failure message="org.opentest4j.AssertionFailedError: expected: &lt;Walk&gt; but was: &lt;Run&gt;" type="org.opentest4j.AssertionFailedError">org.opentest4j.AssertionFailedError: expected: &lt;Walk&gt; but was: &lt;Run&gt;
at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
@@ -16,14 +16,14 @@
at java.base@17.0.2/java.util.ArrayList.forEach(ArrayList.java:1511)
</failure>
</testcase>
<testcase name="Check that every required surface command actually works" classname="hhn.temp.project.GoodCasesTest" time="0.014"/>
<testcase name="Assert that added Tasks are added to the List" classname="hhn.temp.project.GoodCasesTest" time="0.003"/>
<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.005"/>
<testcase name="Check that every required surface command actually works" classname="hhn.temp.project.GoodCasesTest" time="0.012"/>
<testcase name="Assert that added Tasks are added to the List" classname="hhn.temp.project.GoodCasesTest" time="0.002"/>
<testcase name="Assert that Worker can remove Task" classname="hhn.temp.project.GoodCasesTest" time="0.002"/>
<testcase name="Check that every task command works" classname="hhn.temp.project.GoodCasesTest" time="0.006"/>
<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 that removing Workers is possible through the UI" classname="hhn.temp.project.GoodCasesTest" time="0.005"/>
<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.004">
<testcase name="Assert that removing a worker removes the worker from the worker list" classname="hhn.temp.project.GoodCasesTest" time="0.003">
<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)
@@ -35,9 +35,41 @@
at java.base@17.0.2/java.util.ArrayList.forEach(ArrayList.java:1511)
</failure>
</testcase>
<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 the Scanner is actually started when AM calls start" 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.011"/>
<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: Error: Cannot invoke "java.util.Scanner.nextLine()" because "this.scanner" is null
Enter new name;description: Error: Cannot invoke "java.util.Scanner.nextLine()" because "this.scanner" is null
Unknown command. Type 'help' for available commands.
Available commands:
createWorker - Create a new worker
createTask - Create a new task
selectTask - Select a task to work with
listWorkers - List all workers
help/? - Show this help
exit - Exit the program
Available commands:
createWorker - Create a new worker
createTask - Create a new task
selectTask - Select a task to work with
listWorkers - List all workers
help/? - Show this help
exit - Exit the program
Enter worker name: Error: Cannot invoke "java.util.Scanner.nextLine()" because "this.scanner" is null
Enter worker ID: Error: Cannot invoke "java.util.Scanner.nextLine()" because "this.scanner" is null
Enter task ID: Error: Cannot invoke "java.util.Scanner.nextLine()" because "this.scanner" is null
Unknown command. Type 'help' for available commands.
Unknown command. Type 'help' for available commands.
Enter task ID: Error: Cannot invoke "java.util.Scanner.nextLine()" because "this.scanner" is null
Task marked as finished
Task marked as unfinished
Task removed
Unknown command. Type 'help' for available commands.
Unknown command. Type 'help' for available commands.
Enter worker ID: Error: Cannot invoke "java.util.Scanner.nextLine()" because "this.scanner" is null
Worker removed
Unknown command. Type 'help' for available commands.
Unknown command. Type 'help' for available commands.
]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>