Fixed CLI to allow for full testing by using State Machines for everything, test for editing passes now
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox" id="duration">
|
||||
<div class="counter">0.021s</div>
|
||||
<div class="counter">0.016s</div>
|
||||
<p>duration</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -87,7 +87,7 @@
|
||||
<tr>
|
||||
<td class="success">Assert only existing tasks can be edited</td>
|
||||
<td class="success">assertEditOnlyExistingTasks()</td>
|
||||
<td class="success">0.004s</td>
|
||||
<td class="success">0.003s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -99,19 +99,19 @@
|
||||
<tr>
|
||||
<td class="success">Assert List isn't empty after adding a task</td>
|
||||
<td class="success">assertListNowEmptyAfterAdd()</td>
|
||||
<td class="success">0.004s</td>
|
||||
<td class="success">0.002s</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.003s</td>
|
||||
<td class="success">0.002s</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.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 04.01.2026, 16:32:20</p>
|
||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 19:34:44</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox" id="failures">
|
||||
<div class="counter">2</div>
|
||||
<div class="counter">1</div>
|
||||
<p>failures</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -41,7 +41,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox" id="duration">
|
||||
<div class="counter">0.051s</div>
|
||||
<div class="counter">0.085s</div>
|
||||
<p>duration</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -51,7 +51,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="infoBox failures" id="successRate">
|
||||
<div class="percent">84%</div>
|
||||
<div class="percent">92%</div>
|
||||
<p>successful</p>
|
||||
</div>
|
||||
</td>
|
||||
@@ -73,24 +73,6 @@
|
||||
<div class="tab">
|
||||
<h2>Failed tests</h2>
|
||||
<div class="test">
|
||||
<a name="assertEditingTasksIsPossibleThroughUi()"></a>
|
||||
<h3 class="failures">Check that editing is possible through UI</h3>
|
||||
<span class="code">
|
||||
<pre>org.opentest4j.AssertionFailedError: expected: <Walk> but was: <Run>
|
||||
at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
|
||||
at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
|
||||
at app//org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
|
||||
at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
|
||||
at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
|
||||
at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1141)
|
||||
at app//hhn.temp.project.GoodCasesTest.assertEditingTasksIsPossibleThroughUi(GoodCasesTest.java:133)
|
||||
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 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">
|
||||
@@ -121,7 +103,7 @@
|
||||
<tr>
|
||||
<td class="success">Check that every required surface command actually works</td>
|
||||
<td class="success">assertCommandsAreRecognized()</td>
|
||||
<td class="success">0.004s</td>
|
||||
<td class="success">0.017s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -131,51 +113,51 @@
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="failures">Check that editing is possible through UI</td>
|
||||
<td class="failures">assertEditingTasksIsPossibleThroughUi()</td>
|
||||
<td class="failures">0.008s</td>
|
||||
<td class="failures">failed</td>
|
||||
<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">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="success">Assert existing Tasks can be edited</td>
|
||||
<td class="success">assertExistingTasksCanBeEdited()</td>
|
||||
<td class="success">0.003s</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.005s</td>
|
||||
<td class="success">0.008s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="success">Check Getters</td>
|
||||
<td class="success">assertGettersWorkCorrectly()</td>
|
||||
<td class="success">0.014s</td>
|
||||
<td class="success">0.019s</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.005s</td>
|
||||
<td class="failures">0.012s</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.002s</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.002s</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">assertTaskStateChanges()</td>
|
||||
<td class="success">0.004s</td>
|
||||
<td class="success">0.002s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -187,7 +169,7 @@
|
||||
<tr>
|
||||
<td class="success">Assert that a Worker can add a Task</td>
|
||||
<td class="success">assertWorkerCanAddTask()</td>
|
||||
<td class="success">0.001s</td>
|
||||
<td class="success">0.003s</td>
|
||||
<td class="success">passed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -201,35 +183,74 @@
|
||||
<div class="tab">
|
||||
<h2>Standard output</h2>
|
||||
<span class="code">
|
||||
<pre>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
|
||||
<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
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
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: 1
|
||||
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.
|
||||
Enter worker ID: Error: Cannot invoke "java.util.Scanner.nextLine()" because "this.scanner" is null
|
||||
Available workers:
|
||||
1: Alfred
|
||||
2: Balfred
|
||||
Enter worker ID to select (or 'back'):
|
||||
Worker 1 (Alfred) selected
|
||||
Commands: remove, back
|
||||
Worker removed
|
||||
Unknown command. Type 'help' for available commands.
|
||||
Unknown command. Type 'help' for available commands.
|
||||
@@ -244,7 +265,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 04.01.2026, 16:32:20</p>
|
||||
<a href="https://www.gradle.org">Gradle 8.14</a> at 06.01.2026, 19:34:44</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user