33 Commits

Author SHA1 Message Date
85446bc230 Quick change to the access Modifiers for fields in Worker,Task and Assignmentmanager, refactored tests to use getWorkerMap 2026-01-04 16:33:12 +01:00
f0da7b0f9a Mid-Work of changing the CLI to use State Machines so all input can be tested with the Tests using handleInput() 2026-01-04 16:27:53 +01:00
c85d55ce7d Almost full implementation of Scanner UI. Two tests not passing, but safety commit 2026-01-04 16:09:48 +01:00
a875f24e83 Commit for the rebase on ScannerImplementation from main 2026-01-04 15:23:53 +01:00
bb71c7e329 Fixed assignment manager to pass some tests, scanner is not yet implemented fully 2025-12-18 19:58:03 +01:00
2af4f4b7a4 Wrote all the Tests for the Scanner UI 2025-12-03 21:13:59 +01:00
79df3d300e Just a small commit so i can pull 2025-12-03 20:40:15 +01:00
7201f66214 Small commit while writing tests 2025-12-03 20:40:15 +01:00
0db43fe51a Fixed Merge Conflicts, uploaded local main 2025-12-03 20:37:10 +01:00
90fbacadaa Merge pull request 'database' (#2) from database into main
Reviewed-on: #2
2025-12-03 20:16:49 +01:00
Riley Schneider
57144fa772 Updated MySQL Methods, Tests and Information accordingly. (High security risk btw) 2025-12-03 20:15:28 +01:00
c10de39091 Just a commit to push the build files so I can push 2025-12-03 19:36:50 +01:00
98bbddb31a Added Tests for removing, finishing and unfinishing tasks and so on for test coverage. 2025-12-03 19:32:59 +01:00
7640b1ef35 Added Tests for TaskState Changes. Actually added functionality to pass that test. 2025-12-03 19:20:24 +01:00
20daf315ca Added Task Adding, Removing, Editing and corrected some relatex tests. Coverage still not 100% 2025-12-03 19:08:16 +01:00
Riley Schneider
d3488f1f1c Update connect method in SimpleDatabaseManager.java 2025-12-03 18:26:13 +01:00
Riley Schneider
382aad70f7 Updated gitignore 2025-12-03 18:24:42 +01:00
Riley Schneider
dbebcad97d First runnable tests for Database / Commented out Good/BadCasesTests (not relevant to this branch) 2025-12-03 18:23:07 +01:00
4fa55c8607 Added Full Skeleton Methods for AssignmentManager and Task 2025-12-03 18:21:53 +01:00
Riley Schneider
ec0abd85b9 Merge remote-tracking branch 'origin/database' into database
# Conflicts:
#	.gradle/8.14/executionHistory/executionHistory.lock
#	.gradle/8.14/fileHashes/fileHashes.bin
#	.gradle/8.14/fileHashes/fileHashes.lock
#	.gradle/buildOutputCleanup/buildOutputCleanup.lock
#	.gradle/buildOutputCleanup/cache.properties
#	build/classes/java/main/hhn/temp/project/provider/DatabaseManager.class
#	build/tmp/compileJava/previous-compilation-data.bin
#	src/main/java/hhn/temp/project/provider/SimpleDatabaseManager.java
#	test/hhn/temp/project/BadCasesTest.java
#	test/hhn/temp/project/DatabaseBadCasesTest.java
#	test/hhn/temp/project/DatabaseGoodCasesTest.java
#	test/hhn/temp/project/GoodCasesTest.java
2025-12-03 18:20:36 +01:00
Riley Schneider
04f2087456 First runnable tests for Database / Commented out Good/BadCasesTests (not relevant to this branch) 2025-12-03 18:19:48 +01:00
fb0e05fd4d Added a basic test for the worker get methods 2025-12-03 18:06:09 +01:00
4bb1e13f21 Added basic worker so tests can create them 2025-12-03 17:59:30 +01:00
Riley Schneider
0c4f092312 Backup 2025-12-03 17:49:06 +01:00
8c4849fdf0 Just adding the report so I can rebase 2025-12-03 17:43:40 +01:00
a5378868ea Changed a small setting so test results are actually displayed 2025-12-03 17:39:42 +01:00
9641825200 Wrote the first BadCasesTests 2025-12-03 17:36:12 +01:00
Riley Schneider
bc0e30860c First database tests 2025-12-03 17:30:33 +01:00
d5a9825ec1 Wrote the first GoodCasesTests 2025-12-03 17:29:56 +01:00
26f7ecbee6 Merge pull request 'Skeleton' (#1) from Skeleton into main
Reviewed-on: #1
2025-12-03 16:44:45 +01:00
Riley Schneider
eed1390c65 Remove database folder 2025-12-03 16:42:41 +01:00
Riley Schneider
b732d8d4b5 Initial Commit 2025-12-03 16:38:10 +01:00
c5e26bf594 Rough Skeleton for Tests and Classes 2025-12-03 16:28:17 +01:00
101 changed files with 4729 additions and 60 deletions

2
.gitignore vendored
View File

@@ -0,0 +1,2 @@
build/
.gradle/

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.

View File

View File

@@ -1,2 +1,2 @@
#Tue Dec 02 10:03:29 CET 2025
#Wed Dec 03 20:34:21 CET 2025
gradle.version=8.14

BIN
.gradle/file-system.probe Normal file

Binary file not shown.

9
.idea/GSEUebung.iml generated
View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

2
.idea/gradle.xml generated
View File

@@ -5,6 +5,8 @@
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="C:\Gradle\gradle-9.0.0" />
<option name="gradleJvm" value="17" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />

2
.idea/misc.xml generated
View File

@@ -4,7 +4,7 @@
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</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" />
</component>
</project>

8
.idea/modules.xml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/GSEUebung.iml" filepath="$PROJECT_DIR$/.idea/GSEUebung.iml" />
</modules>
</component>
</project>

8
.idea/modules/Template.test.iml generated Normal file
View 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>

View File

@@ -14,6 +14,7 @@ dependencies {
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'com.mysql:mysql-connector-j:9.5.0'
}
jacoco {
@@ -36,6 +37,11 @@ sourceSets {
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
showStandardStreams = true
}
finalizedBy jacocoTestReport
}
jacocoTestReport {

Binary file not shown.

Binary file not shown.

BIN
build/jacoco/test.exec Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,73 @@
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="de"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>AssignmentManager.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Template</a> &gt; <a href="index.source.html" class="el_package">hhn.temp.project</a> &gt; <span class="el_source">AssignmentManager.java</span></div><h1>AssignmentManager.java</h1><pre class="source lang-java linenums">package hhn.temp.project;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AssignmentManager {
Map&lt;Integer, Worker&gt; workerMap;
Map&lt;Integer, Task&gt; taskMap;
int workerIdCounter;
int taskIdCounter;
<span class="fc" id="L14"> public AssignmentManager() {</span>
<span class="fc" id="L15"> workerMap = new HashMap&lt;&gt;();</span>
<span class="fc" id="L16"> taskMap = new HashMap&lt;&gt;();</span>
<span class="fc" id="L17"> int workerIdCounter = 1000;</span>
<span class="fc" id="L18"> int taskIdCounter = 0;</span>
<span class="fc" id="L19"> }</span>
public int createWorker(String name) {
<span class="fc" id="L22"> Worker worker = new Worker(name, ++workerIdCounter);</span>
<span class="fc" id="L23"> workerMap.put(workerIdCounter, worker);</span>
<span class="fc" id="L24"> return workerIdCounter;</span>
}
public int addTask(int workerId, String name, String description) {
<span class="pc bpc" id="L27" title="1 of 6 branches missed."> if (!workerMap.containsKey(workerId) || name == null || description == null) {</span>
<span class="fc" id="L28"> throw new IllegalArgumentException(&quot;WorkerId must exist and name or description can't be null&quot;);</span>
}
<span class="fc" id="L30"> Task task = new Task(++taskIdCounter, workerId, name, description, this);</span>
<span class="fc" id="L31"> taskMap.put(taskIdCounter, task);</span>
<span class="fc" id="L32"> return taskIdCounter;</span>
}
public Task getTask(int taskId) {
<span class="fc bfc" id="L35" title="All 2 branches covered."> if (!taskMap.containsKey(taskId)) {</span>
<span class="fc" id="L36"> throw new IllegalArgumentException(&quot;Task Id does not exist&quot;);</span>
}
<span class="fc" id="L38"> return taskMap.get(taskId);</span>
}
public Map&lt;Integer, Task&gt; getTaskMap() {
<span class="fc" id="L41"> return taskMap;</span>
}
public void editTask(int workerId, int taskId, String name, String description) {
<span class="fc bfc" id="L44" title="All 4 branches covered."> if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {</span>
<span class="fc" id="L45"> throw new IllegalArgumentException(&quot;Task Id or Worker Id does not exist&quot;);</span>
}
<span class="fc" id="L47"> Task task = taskMap.get(taskId);</span>
<span class="fc" id="L48"> task.setName(name);</span>
<span class="fc" id="L49"> task.setDescription(description);</span>
<span class="fc" id="L50"> }</span>
public void removeTask(int taskId) {
<span class="fc bfc" id="L52" title="All 2 branches covered."> if (!taskMap.containsKey(taskId)) {</span>
<span class="fc" id="L53"> throw new IllegalArgumentException(&quot;Task Id does not exist&quot;);</span>
}
<span class="fc" id="L55"> taskMap.remove(taskId);</span>
<span class="fc" id="L56"> }</span>
public void finishTask(int workerId, int taskId) {
<span class="pc bpc" id="L58" title="1 of 4 branches missed."> if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {</span>
<span class="fc" id="L59"> throw new IllegalArgumentException(&quot;Task Id or Worker Id does not exist&quot;);</span>
}
<span class="fc" id="L61"> Task task = taskMap.get(taskId);</span>
<span class="fc" id="L62"> task.setTaskState(TaskState.FINISHED);</span>
<span class="fc" id="L63"> }</span>
public void unfinishTask(int workerId, int taskId) {
<span class="pc bpc" id="L65" title="1 of 4 branches missed."> if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {</span>
<span class="fc" id="L66"> throw new IllegalArgumentException(&quot;Task Id or Worker Id does not exist&quot;);</span>
}
<span class="fc" id="L68"> Task task = taskMap.get(taskId);</span>
<span class="fc" id="L69"> task.setTaskState(TaskState.IN_PROGRESS);</span>
<span class="fc" id="L70"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,45 @@
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="de"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>Task.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Template</a> &gt; <a href="index.source.html" class="el_package">hhn.temp.project</a> &gt; <span class="el_source">Task.java</span></div><h1>Task.java</h1><pre class="source lang-java linenums">package hhn.temp.project;
public class Task {
String name;
String description;
int taskId;
int workerId;
AssignmentManager manager;
TaskState state;
<span class="fc" id="L10"> public Task(int taskId, int workerId, String name, String description, AssignmentManager manager) {</span>
<span class="fc" id="L11"> this.manager = manager;</span>
<span class="fc" id="L12"> this.name = name;</span>
<span class="fc" id="L13"> this.description = description;</span>
<span class="fc" id="L14"> this.taskId = taskId;</span>
<span class="fc" id="L15"> this.workerId = workerId;</span>
<span class="fc" id="L16"> this.state = TaskState.IN_PROGRESS;</span>
<span class="fc" id="L17"> }</span>
public String getName() {
<span class="fc" id="L20"> return name;</span>
}
public void setName(String name) {
<span class="fc" id="L23"> this.name = name;</span>
<span class="fc" id="L24"> }</span>
public String getDescription() {
<span class="fc" id="L26"> return description;</span>
}
public void setDescription(String description) {
<span class="fc" id="L29"> this.description = description;</span>
<span class="fc" id="L30"> }</span>
public int getTaskId() {
<span class="fc" id="L32"> return taskId;</span>
}
public int getWorkerId() {
<span class="fc" id="L35"> return workerId;</span>
}
public void setTaskState(TaskState state) {
<span class="fc" id="L38"> this.state = state;</span>
<span class="fc" id="L39"> }</span>
public TaskState getTaskState() {
<span class="fc" id="L41"> return state;</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>

View File

@@ -0,0 +1 @@
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="de"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>TaskState</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Template</a> &gt; <a href="index.html" class="el_package">hhn.temp.project</a> &gt; <span class="el_class">TaskState</span></div><h1>TaskState</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">0 of 15</td><td class="ctr2">100 %</td><td class="bar">0 of 0</td><td class="ctr2">n/a</td><td class="ctr1">0</td><td class="ctr2">1</td><td class="ctr1">0</td><td class="ctr2">3</td><td class="ctr1">0</td><td class="ctr2">1</td></tr></tfoot><tbody><tr><td id="a0"><a href="TaskState.java.html#L3" class="el_method">static {...}</a></td><td class="bar" id="b0"><img src="../jacoco-resources/greenbar.gif" width="120" height="10" title="15" alt="15"/></td><td class="ctr2" id="c0">100 %</td><td class="bar" id="d0"/><td class="ctr2" id="e0">n/a</td><td class="ctr1" id="f0">0</td><td class="ctr2" id="g0">1</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">3</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>

View File

@@ -0,0 +1,7 @@
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="de"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>TaskState.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Template</a> &gt; <a href="index.source.html" class="el_package">hhn.temp.project</a> &gt; <span class="el_source">TaskState.java</span></div><h1>TaskState.java</h1><pre class="source lang-java linenums">package hhn.temp.project;
<span class="fc" id="L3">public enum TaskState {</span>
<span class="fc" id="L4"> IN_PROGRESS,</span>
<span class="fc" id="L5"> FINISHED;</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>

View File

@@ -0,0 +1 @@
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="de"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>Worker</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Template</a> &gt; <a href="index.html" class="el_package">hhn.temp.project</a> &gt; <span class="el_class">Worker</span></div><h1>Worker</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">0 of 15</td><td class="ctr2">100 %</td><td class="bar">0 of 0</td><td class="ctr2">n/a</td><td class="ctr1">0</td><td class="ctr2">3</td><td class="ctr1">0</td><td class="ctr2">6</td><td class="ctr1">0</td><td class="ctr2">3</td></tr></tfoot><tbody><tr><td id="a2"><a href="Worker.java.html#L6" class="el_method">Worker(String, int)</a></td><td class="bar" id="b0"><img src="../jacoco-resources/greenbar.gif" width="120" height="10" title="9" alt="9"/></td><td class="ctr2" id="c0">100 %</td><td class="bar" id="d0"/><td class="ctr2" id="e0">n/a</td><td class="ctr1" id="f0">0</td><td class="ctr2" id="g0">1</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">4</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a1"><a href="Worker.java.html#L12" class="el_method">getName()</a></td><td class="bar" id="b1"><img src="../jacoco-resources/greenbar.gif" width="40" height="10" title="3" alt="3"/></td><td class="ctr2" id="c1">100 %</td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">0</td><td class="ctr2" id="g1">1</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">1</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a0"><a href="Worker.java.html#L15" class="el_method">getId()</a></td><td class="bar" id="b2"><img src="../jacoco-resources/greenbar.gif" width="40" height="10" title="3" alt="3"/></td><td class="ctr2" id="c2">100 %</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">1</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>

View File

@@ -0,0 +1,18 @@
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="de"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>Worker.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Template</a> &gt; <a href="index.source.html" class="el_package">hhn.temp.project</a> &gt; <span class="el_source">Worker.java</span></div><h1>Worker.java</h1><pre class="source lang-java linenums">package hhn.temp.project;
public class Worker {
String name;
int workerId;
<span class="fc" id="L6"> public Worker(String name, int workerId) {</span>
<span class="fc" id="L7"> this.name = name;</span>
<span class="fc" id="L8"> this.workerId = workerId;</span>
<span class="fc" id="L9"> }</span>
public String getName() {
<span class="fc" id="L12"> return name;</span>
}
public int getId() {
<span class="fc" id="L15"> return workerId;</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>

View File

@@ -0,0 +1 @@
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="de"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>hhn.temp.project</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb', 'coveragetable'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="index.source.html" class="el_source">Source Files</a><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Template</a> &gt; <span class="el_package">hhn.temp.project</span></div><h1>hhn.temp.project</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td><td class="sortable ctr1" id="l" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="m" onclick="toggleSort(this)">Classes</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">0 of 285</td><td class="ctr2">100 %</td><td class="bar">3 of 22</td><td class="ctr2">86 %</td><td class="ctr1">3</td><td class="ctr2">33</td><td class="ctr1">0</td><td class="ctr2">66</td><td class="ctr1">0</td><td class="ctr2">22</td><td class="ctr1">0</td><td class="ctr2">4</td></tr></tfoot><tbody><tr><td id="a0"><a href="AssignmentManager.html" class="el_class">AssignmentManager</a></td><td class="bar" id="b0"><img src="../jacoco-resources/greenbar.gif" width="120" height="10" title="207" alt="207"/></td><td class="ctr2" id="c0">100 %</td><td class="bar" id="d0"><img src="../jacoco-resources/redbar.gif" width="16" height="10" title="3" alt="3"/><img src="../jacoco-resources/greenbar.gif" width="103" height="10" title="19" alt="19"/></td><td class="ctr2" id="e0">86 %</td><td class="ctr1" id="f0">3</td><td class="ctr2" id="g0">20</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">38</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">9</td><td class="ctr1" id="l0">0</td><td class="ctr2" id="m0">1</td></tr><tr><td id="a1"><a href="Task.html" class="el_class">Task</a></td><td class="bar" id="b1"><img src="../jacoco-resources/greenbar.gif" width="27" height="10" title="48" alt="48"/></td><td class="ctr2" id="c1">100 %</td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">0</td><td class="ctr2" id="g1">9</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">19</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">9</td><td class="ctr1" id="l1">0</td><td class="ctr2" id="m1">1</td></tr><tr><td id="a2"><a href="TaskState.html" class="el_class">TaskState</a></td><td class="bar" id="b2"><img src="../jacoco-resources/greenbar.gif" width="8" height="10" title="15" alt="15"/></td><td class="ctr2" id="c2">100 %</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g3">1</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i3">3</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k3">1</td><td class="ctr1" id="l2">0</td><td class="ctr2" id="m2">1</td></tr><tr><td id="a3"><a href="Worker.html" class="el_class">Worker</a></td><td class="bar" id="b3"><img src="../jacoco-resources/greenbar.gif" width="8" height="10" title="15" alt="15"/></td><td class="ctr2" id="c3">100 %</td><td class="bar" id="d3"/><td class="ctr2" id="e3">n/a</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g2">3</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i2">6</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k2">3</td><td class="ctr1" id="l3">0</td><td class="ctr2" id="m3">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>

View File

@@ -0,0 +1 @@
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="de"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>hhn.temp.project</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb', 'coveragetable'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="index.html" class="el_class">Classes</a><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Template</a> &gt; <span class="el_package">hhn.temp.project</span></div><h1>hhn.temp.project</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td><td class="sortable ctr1" id="l" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="m" onclick="toggleSort(this)">Classes</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">0 of 285</td><td class="ctr2">100 %</td><td class="bar">3 of 22</td><td class="ctr2">86 %</td><td class="ctr1">3</td><td class="ctr2">33</td><td class="ctr1">0</td><td class="ctr2">66</td><td class="ctr1">0</td><td class="ctr2">22</td><td class="ctr1">0</td><td class="ctr2">4</td></tr></tfoot><tbody><tr><td id="a0"><a href="AssignmentManager.java.html" class="el_source">AssignmentManager.java</a></td><td class="bar" id="b0"><img src="../jacoco-resources/greenbar.gif" width="120" height="10" title="207" alt="207"/></td><td class="ctr2" id="c0">100 %</td><td class="bar" id="d0"><img src="../jacoco-resources/redbar.gif" width="16" height="10" title="3" alt="3"/><img src="../jacoco-resources/greenbar.gif" width="103" height="10" title="19" alt="19"/></td><td class="ctr2" id="e0">86 %</td><td class="ctr1" id="f0">3</td><td class="ctr2" id="g0">20</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">38</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">9</td><td class="ctr1" id="l0">0</td><td class="ctr2" id="m0">1</td></tr><tr><td id="a1"><a href="Task.java.html" class="el_source">Task.java</a></td><td class="bar" id="b1"><img src="../jacoco-resources/greenbar.gif" width="27" height="10" title="48" alt="48"/></td><td class="ctr2" id="c1">100 %</td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">0</td><td class="ctr2" id="g1">9</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">19</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">9</td><td class="ctr1" id="l1">0</td><td class="ctr2" id="m1">1</td></tr><tr><td id="a3"><a href="Worker.java.html" class="el_source">Worker.java</a></td><td class="bar" id="b2"><img src="../jacoco-resources/greenbar.gif" width="8" height="10" title="15" alt="15"/></td><td class="ctr2" id="c2">100 %</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g2">3</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">6</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">3</td><td class="ctr1" id="l2">0</td><td class="ctr2" id="m2">1</td></tr><tr><td id="a2"><a href="TaskState.java.html" class="el_source">TaskState.java</a></td><td class="bar" id="b3"><img src="../jacoco-resources/greenbar.gif" width="8" height="10" title="15" alt="15"/></td><td class="ctr2" id="c3">100 %</td><td class="bar" id="d3"/><td class="ctr2" id="e3">n/a</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g3">1</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i3">3</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td><td class="ctr1" id="l3">0</td><td class="ctr2" id="m3">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>

View File

@@ -0,0 +1 @@
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="de"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="jacoco-resources/report.gif" type="image/gif"/><title>Template</title><script type="text/javascript" src="jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb', 'coveragetable'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="jacoco-sessions.html" class="el_session">Sessions</a></span><span class="el_report">Template</span></div><h1>Template</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td><td class="sortable ctr1" id="l" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="m" onclick="toggleSort(this)">Classes</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">0 of 285</td><td class="ctr2">100 %</td><td class="bar">3 of 22</td><td class="ctr2">86 %</td><td class="ctr1">3</td><td class="ctr2">33</td><td class="ctr1">0</td><td class="ctr2">66</td><td class="ctr1">0</td><td class="ctr2">22</td><td class="ctr1">0</td><td class="ctr2">4</td></tr></tfoot><tbody><tr><td id="a0"><a href="hhn.temp.project/index.html" class="el_package">hhn.temp.project</a></td><td class="bar" id="b0"><img src="jacoco-resources/greenbar.gif" width="120" height="10" title="285" alt="285"/></td><td class="ctr2" id="c0">100 %</td><td class="bar" id="d0"><img src="jacoco-resources/redbar.gif" width="16" height="10" title="3" alt="3"/><img src="jacoco-resources/greenbar.gif" width="103" height="10" title="19" alt="19"/></td><td class="ctr2" id="e0">86 %</td><td class="ctr1" id="f0">3</td><td class="ctr2" id="g0">33</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">66</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">22</td><td class="ctr1" id="l0">0</td><td class="ctr2" id="m0">4</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

View File

@@ -0,0 +1,13 @@
/* Pretty printing styles. Used with prettify.js. */
.str { color: #2A00FF; }
.kwd { color: #7F0055; font-weight:bold; }
.com { color: #3F5FBF; }
.typ { color: #606; }
.lit { color: #066; }
.pun { color: #660; }
.pln { color: #000; }
.tag { color: #008; }
.atn { color: #606; }
.atv { color: #080; }
.dec { color: #606; }

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

View File

@@ -0,0 +1,243 @@
body, td {
font-family:sans-serif;
font-size:10pt;
}
h1 {
font-weight:bold;
font-size:18pt;
}
.breadcrumb {
border:#d6d3ce 1px solid;
padding:2px 4px 2px 4px;
}
.breadcrumb .info {
float:right;
}
.breadcrumb .info a {
margin-left:8px;
}
.el_report {
padding-left:18px;
background-image:url(report.gif);
background-position:left center;
background-repeat:no-repeat;
}
.el_group {
padding-left:18px;
background-image:url(group.gif);
background-position:left center;
background-repeat:no-repeat;
}
.el_bundle {
padding-left:18px;
background-image:url(bundle.gif);
background-position:left center;
background-repeat:no-repeat;
}
.el_package {
padding-left:18px;
background-image:url(package.gif);
background-position:left center;
background-repeat:no-repeat;
}
.el_class {
padding-left:18px;
background-image:url(class.gif);
background-position:left center;
background-repeat:no-repeat;
}
.el_source {
padding-left:18px;
background-image:url(source.gif);
background-position:left center;
background-repeat:no-repeat;
}
.el_method {
padding-left:18px;
background-image:url(method.gif);
background-position:left center;
background-repeat:no-repeat;
}
.el_session {
padding-left:18px;
background-image:url(session.gif);
background-position:left center;
background-repeat:no-repeat;
}
pre.source {
border:#d6d3ce 1px solid;
font-family:monospace;
}
pre.source ol {
margin-bottom: 0px;
margin-top: 0px;
}
pre.source li {
border-left: 1px solid #D6D3CE;
color: #A0A0A0;
padding-left: 0px;
}
pre.source span.fc {
background-color:#ccffcc;
}
pre.source span.nc {
background-color:#ffaaaa;
}
pre.source span.pc {
background-color:#ffffcc;
}
pre.source span.bfc {
background-image: url(branchfc.gif);
background-repeat: no-repeat;
background-position: 2px center;
}
pre.source span.bfc:hover {
background-color:#80ff80;
}
pre.source span.bnc {
background-image: url(branchnc.gif);
background-repeat: no-repeat;
background-position: 2px center;
}
pre.source span.bnc:hover {
background-color:#ff8080;
}
pre.source span.bpc {
background-image: url(branchpc.gif);
background-repeat: no-repeat;
background-position: 2px center;
}
pre.source span.bpc:hover {
background-color:#ffff80;
}
table.coverage {
empty-cells:show;
border-collapse:collapse;
}
table.coverage thead {
background-color:#e0e0e0;
}
table.coverage thead td {
white-space:nowrap;
padding:2px 14px 0px 6px;
border-bottom:#b0b0b0 1px solid;
}
table.coverage thead td.bar {
border-left:#cccccc 1px solid;
}
table.coverage thead td.ctr1 {
text-align:right;
border-left:#cccccc 1px solid;
}
table.coverage thead td.ctr2 {
text-align:right;
padding-left:2px;
}
table.coverage thead td.sortable {
cursor:pointer;
background-image:url(sort.gif);
background-position:right center;
background-repeat:no-repeat;
}
table.coverage thead td.up {
background-image:url(up.gif);
}
table.coverage thead td.down {
background-image:url(down.gif);
}
table.coverage tbody td {
white-space:nowrap;
padding:2px 6px 2px 6px;
border-bottom:#d6d3ce 1px solid;
}
table.coverage tbody tr:hover {
background: #f0f0d0 !important;
}
table.coverage tbody td.bar {
border-left:#e8e8e8 1px solid;
}
table.coverage tbody td.ctr1 {
text-align:right;
padding-right:14px;
border-left:#e8e8e8 1px solid;
}
table.coverage tbody td.ctr2 {
text-align:right;
padding-right:14px;
padding-left:2px;
}
table.coverage tfoot td {
white-space:nowrap;
padding:2px 6px 2px 6px;
}
table.coverage tfoot td.bar {
border-left:#e8e8e8 1px solid;
}
table.coverage tfoot td.ctr1 {
text-align:right;
padding-right:14px;
border-left:#e8e8e8 1px solid;
}
table.coverage tfoot td.ctr2 {
text-align:right;
padding-right:14px;
padding-left:2px;
}
.footer {
margin-top:20px;
border-top:#d6d3ce 1px solid;
padding-top:2px;
font-size:8pt;
color:#a0a0a0;
}
.footer a {
color:#a0a0a0;
}
.right {
float:right;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 B

View File

@@ -0,0 +1,148 @@
/*******************************************************************************
* 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:
* Marc R. Hoffmann - initial API and implementation
*
*******************************************************************************/
(function () {
/**
* Sets the initial sorting derived from the hash.
*
* @param linkelementids
* list of element ids to search for links to add sort inidcator
* hash links
*/
function initialSort(linkelementids) {
window.linkelementids = linkelementids;
var hash = window.location.hash;
if (hash) {
var m = hash.match(/up-./);
if (m) {
var header = window.document.getElementById(m[0].charAt(3));
if (header) {
sortColumn(header, true);
}
return;
}
var m = hash.match(/dn-./);
if (m) {
var header = window.document.getElementById(m[0].charAt(3));
if (header) {
sortColumn(header, false);
}
return
}
}
}
/**
* Sorts the columns with the given header dependening on the current sort state.
*/
function toggleSort(header) {
var sortup = header.className.indexOf('down ') == 0;
sortColumn(header, sortup);
}
/**
* Sorts the columns with the given header in the given direction.
*/
function sortColumn(header, sortup) {
var table = header.parentNode.parentNode.parentNode;
var body = table.tBodies[0];
var colidx = getNodePosition(header);
resetSortedStyle(table);
var rows = body.rows;
var sortedrows = [];
for (var i = 0; i < rows.length; i++) {
r = rows[i];
sortedrows[parseInt(r.childNodes[colidx].id.slice(1))] = r;
}
var hash;
if (sortup) {
for (var i = sortedrows.length - 1; i >= 0; i--) {
body.appendChild(sortedrows[i]);
}
header.className = 'up ' + header.className;
hash = 'up-' + header.id;
} else {
for (var i = 0; i < sortedrows.length; i++) {
body.appendChild(sortedrows[i]);
}
header.className = 'down ' + header.className;
hash = 'dn-' + header.id;
}
setHash(hash);
}
/**
* Adds the sort indicator as a hash to the document URL and all links.
*/
function setHash(hash) {
window.document.location.hash = hash;
ids = window.linkelementids;
for (var i = 0; i < ids.length; i++) {
setHashOnAllLinks(document.getElementById(ids[i]), hash);
}
}
/**
* Extend all links within the given tag with the given hash.
*/
function setHashOnAllLinks(tag, hash) {
links = tag.getElementsByTagName("a");
for (var i = 0; i < links.length; i++) {
var a = links[i];
var href = a.href;
var hashpos = href.indexOf("#");
if (hashpos != -1) {
href = href.substring(0, hashpos);
}
a.href = href + "#" + hash;
}
}
/**
* Calculates the position of a element within its parent.
*/
function getNodePosition(element) {
var pos = -1;
while (element) {
element = element.previousSibling;
pos++;
}
return pos;
}
/**
* Remove the sorting indicator style from all headers.
*/
function resetSortedStyle(table) {
for (var c = table.tHead.firstChild.firstChild; c; c = c.nextSibling) {
if (c.className) {
if (c.className.indexOf('down ') == 0) {
c.className = c.className.slice(5);
}
if (c.className.indexOf('up ') == 0) {
c.className = c.className.slice(3);
}
}
}
}
window['initialSort'] = initialSort;
window['toggleSort'] = toggleSort;
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,150 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="x-ua-compatible" content="IE=edge"/>
<title>Test results - BadCasesTest</title>
<link href="../css/base-style.css" rel="stylesheet" type="text/css"/>
<link href="../css/style.css" rel="stylesheet" type="text/css"/>
<script src="../js/report.js" type="text/javascript"></script>
</head>
<body>
<div id="content">
<h1>BadCasesTest</h1>
<div class="breadcrumbs">
<a href="../index.html">all</a> &gt;
<a href="../packages/hhn.temp.project.html">hhn.temp.project</a> &gt; BadCasesTest</div>
<div id="summary">
<table>
<tr>
<td>
<div class="summaryGroup">
<table>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">8</div>
<p>tests</p>
</div>
</td>
<td>
<div class="infoBox" id="failures">
<div class="counter">0</div>
<p>failures</p>
</div>
</td>
<td>
<div class="infoBox" id="ignored">
<div class="counter">0</div>
<p>ignored</p>
</div>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.021s</div>
<p>duration</p>
</div>
</td>
</tr>
</table>
</div>
</td>
<td>
<div class="infoBox success" id="successRate">
<div class="percent">100%</div>
<p>successful</p>
</div>
</td>
</tr>
</table>
</div>
<div class="tab-container">
<ul class="tabLinks">
<li>
<a href="#">Tests</a>
</li>
<li>
<a href="#">Standard output</a>
</li>
</ul>
<div class="tab">
<h2>Tests</h2>
<table>
<thead>
<tr>
<th>Test</th>
<th>Method name</th>
<th>Duration</th>
<th>Result</th>
</tr>
</thead>
<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">passed</td>
</tr>
<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">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.001s</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.004s</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">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">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">passed</td>
</tr>
<tr>
<td class="success">Assert that un-/finishing a Task only works with valid parameters</td>
<td class="success">assertTaskStateChangesOnlyAcceptsValidParameters()</td>
<td class="success">0.003s</td>
<td class="success">passed</td>
</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>
<div>
<label class="hidden" id="label-for-line-wrapping-toggle" for="line-wrapping-toggle">Wrap lines
<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>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,251 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="x-ua-compatible" content="IE=edge"/>
<title>Test results - GoodCasesTest</title>
<link href="../css/base-style.css" rel="stylesheet" type="text/css"/>
<link href="../css/style.css" rel="stylesheet" type="text/css"/>
<script src="../js/report.js" type="text/javascript"></script>
</head>
<body>
<div id="content">
<h1>GoodCasesTest</h1>
<div class="breadcrumbs">
<a href="../index.html">all</a> &gt;
<a href="../packages/hhn.temp.project.html">hhn.temp.project</a> &gt; GoodCasesTest</div>
<div id="summary">
<table>
<tr>
<td>
<div class="summaryGroup">
<table>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">13</div>
<p>tests</p>
</div>
</td>
<td>
<div class="infoBox" id="failures">
<div class="counter">2</div>
<p>failures</p>
</div>
</td>
<td>
<div class="infoBox" id="ignored">
<div class="counter">0</div>
<p>ignored</p>
</div>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.051s</div>
<p>duration</p>
</div>
</td>
</tr>
</table>
</div>
</td>
<td>
<div class="infoBox failures" id="successRate">
<div class="percent">84%</div>
<p>successful</p>
</div>
</td>
</tr>
</table>
</div>
<div class="tab-container">
<ul class="tabLinks">
<li>
<a href="#">Failed tests</a>
</li>
<li>
<a href="#">Tests</a>
</li>
<li>
<a href="#">Standard output</a>
</li>
</ul>
<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: &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)
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">
<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>
<tr>
<th>Test</th>
<th>Method name</th>
<th>Duration</th>
<th>Result</th>
</tr>
</thead>
<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">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">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>
</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">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">passed</td>
</tr>
<tr>
<td class="success">Check Getters</td>
<td class="success">assertGettersWorkCorrectly()</td>
<td class="success">0.014s</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">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">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">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">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.001s</td>
<td class="success">passed</td>
</tr>
<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">passed</td>
</tr>
<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">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>
<div>
<label class="hidden" id="label-for-line-wrapping-toggle" for="line-wrapping-toggle">Wrap lines
<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>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,84 @@
#summary {
margin-top: 30px;
margin-bottom: 40px;
}
#summary table {
border-collapse: collapse;
}
#summary td {
vertical-align: top;
}
.breadcrumbs, .breadcrumbs a {
color: #606060;
}
.infoBox {
width: 110px;
padding-top: 15px;
padding-bottom: 15px;
text-align: center;
}
.infoBox p {
margin: 0;
}
.counter, .percent {
font-size: 120%;
font-weight: bold;
margin-bottom: 8px;
}
#duration {
width: 125px;
}
#successRate, .summaryGroup {
border: solid 2px #d0d0d0;
-moz-border-radius: 10px;
border-radius: 10px;
}
#successRate {
width: 140px;
margin-left: 35px;
}
#successRate .percent {
font-size: 180%;
}
.success, .success a {
color: #008000;
}
div.success, #successRate.success {
background-color: #bbd9bb;
border-color: #008000;
}
.failures, .failures a {
color: #b60808;
}
.skipped, .skipped a {
color: #c09853;
}
div.failures, #successRate.failures {
background-color: #ecdada;
border-color: #b60808;
}
ul.linkList {
padding-left: 0;
}
ul.linkList li {
list-style: none;
margin-bottom: 5px;
}

View File

@@ -0,0 +1,191 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="x-ua-compatible" content="IE=edge"/>
<title>Test results - Test Summary</title>
<link href="css/base-style.css" rel="stylesheet" type="text/css"/>
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<script src="js/report.js" type="text/javascript"></script>
</head>
<body>
<div id="content">
<h1>Test Summary</h1>
<div id="summary">
<table>
<tr>
<td>
<div class="summaryGroup">
<table>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">25</div>
<p>tests</p>
</div>
</td>
<td>
<div class="infoBox" id="failures">
<div class="counter">5</div>
<p>failures</p>
</div>
</td>
<td>
<div class="infoBox" id="ignored">
<div class="counter">0</div>
<p>ignored</p>
</div>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">1.810s</div>
<p>duration</p>
</div>
</td>
</tr>
</table>
</div>
</td>
<td>
<div class="infoBox failures" id="successRate">
<div class="percent">80%</div>
<p>successful</p>
</div>
</td>
</tr>
</table>
</div>
<div class="tab-container">
<ul class="tabLinks">
<li>
<a href="#">Failed tests</a>
</li>
<li>
<a href="#">Packages</a>
</li>
<li>
<a href="#">Classes</a>
</li>
</ul>
<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>
<li>
<a href="classes/hhn.temp.project.GoodCasesTest.html">GoodCasesTest</a>.
<a href="classes/hhn.temp.project.GoodCasesTest.html#assertEditingTasksIsPossibleThroughUi()">Check that editing is possible through UI</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">
<h2>Packages</h2>
<table>
<thead>
<tr>
<th>Package</th>
<th>Tests</th>
<th>Failures</th>
<th>Ignored</th>
<th>Duration</th>
<th>Success rate</th>
</tr>
</thead>
<tbody>
<tr>
<td class="failures">
<a href="packages/hhn.temp.project.html">hhn.temp.project</a>
</td>
<td>25</td>
<td>5</td>
<td>0</td>
<td>1.810s</td>
<td class="failures">80%</td>
</tr>
</tbody>
</table>
</div>
<div class="tab">
<h2>Classes</h2>
<table>
<thead>
<tr>
<th>Class</th>
<th>Tests</th>
<th>Failures</th>
<th>Ignored</th>
<th>Duration</th>
<th>Success rate</th>
</tr>
</thead>
<tbody>
<tr>
<td class="success">
<a href="classes/hhn.temp.project.BadCasesTest.html">hhn.temp.project.BadCasesTest</a>
</td>
<td>8</td>
<td>0</td>
<td>0</td>
<td>0.021s</td>
<td class="success">100%</td>
</tr>
<tr>
<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.027s</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>1.711s</td>
<td class="failures">0%</td>
</tr>
<tr>
<td class="failures">
<a href="classes/hhn.temp.project.GoodCasesTest.html">hhn.temp.project.GoodCasesTest</a>
</td>
<td>13</td>
<td>2</td>
<td>0</td>
<td>0.051s</td>
<td class="failures">84%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="footer">
<p>
<div>
<label class="hidden" id="label-for-line-wrapping-toggle" for="line-wrapping-toggle">Wrap lines
<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>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,218 @@
(function (window, document) {
"use strict";
function changeElementClass(element, classValue) {
if (element.getAttribute("className")) {
element.setAttribute("className", classValue);
} else {
element.setAttribute("class", classValue);
}
}
function getClassAttribute(element) {
if (element.getAttribute("className")) {
return element.getAttribute("className");
} else {
return element.getAttribute("class");
}
}
function addClass(element, classValue) {
changeElementClass(element, getClassAttribute(element) + " " + classValue);
}
function removeClass(element, classValue) {
changeElementClass(element, getClassAttribute(element).replace(classValue, ""));
}
function getCheckBox() {
return document.getElementById("line-wrapping-toggle");
}
function getLabelForCheckBox() {
return document.getElementById("label-for-line-wrapping-toggle");
}
function findCodeBlocks() {
const codeBlocks = [];
const tabContainers = getTabContainers();
for (let i = 0; i < tabContainers.length; i++) {
const spans = tabContainers[i].getElementsByTagName("span");
for (let i = 0; i < spans.length; ++i) {
if (spans[i].className.indexOf("code") >= 0) {
codeBlocks.push(spans[i]);
}
}
}
return codeBlocks;
}
function forAllCodeBlocks(operation) {
const codeBlocks = findCodeBlocks();
for (let i = 0; i < codeBlocks.length; ++i) {
operation(codeBlocks[i], "wrapped");
}
}
function toggleLineWrapping() {
const checkBox = getCheckBox();
if (checkBox.checked) {
forAllCodeBlocks(addClass);
} else {
forAllCodeBlocks(removeClass);
}
}
function initControls() {
if (findCodeBlocks().length > 0) {
const checkBox = getCheckBox();
const label = getLabelForCheckBox();
checkBox.onclick = toggleLineWrapping;
checkBox.checked = false;
removeClass(label, "hidden");
}
}
class TabManager {
baseId;
tabs;
titles;
headers;
constructor(baseId, tabs, titles, headers) {
this.baseId = baseId;
this.tabs = tabs;
this.titles = titles;
this.headers = headers;
}
select(i) {
this.deselectAll();
changeElementClass(this.tabs[i], "tab selected");
changeElementClass(this.headers[i], "selected");
while (this.headers[i].firstChild) {
this.headers[i].removeChild(this.headers[i].firstChild);
}
const a = document.createElement("a");
a.appendChild(document.createTextNode(this.titles[i]));
this.headers[i].appendChild(a);
}
deselectAll() {
for (let i = 0; i < this.tabs.length; i++) {
changeElementClass(this.tabs[i], "tab deselected");
changeElementClass(this.headers[i], "deselected");
while (this.headers[i].firstChild) {
this.headers[i].removeChild(this.headers[i].firstChild);
}
const a = document.createElement("a");
const id = this.baseId + "-tab" + i;
a.setAttribute("id", id);
a.setAttribute("href", "#tab" + i);
a.onclick = () => {
this.select(i);
return false;
};
a.appendChild(document.createTextNode(this.titles[i]));
this.headers[i].appendChild(a);
}
}
}
function getTabContainers() {
const tabContainers = Array.from(document.getElementsByClassName("tab-container"));
// Used by existing TabbedPageRenderer users, which have not adjusted to use TabsRenderer yet.
const legacyContainer = document.getElementById("tabs");
if (legacyContainer) {
tabContainers.push(legacyContainer);
}
return tabContainers;
}
function initTabs() {
let tabGroups = 0;
function createTab(num, container) {
const tabElems = findTabs(container);
const tabManager = new TabManager("tabs" + num, tabElems, findTitles(tabElems), findHeaders(container));
tabManager.select(0);
}
const tabContainers = getTabContainers();
for (let i = 0; i < tabContainers.length; i++) {
createTab(tabGroups, tabContainers[i]);
tabGroups++;
}
return true;
}
function findTabs(container) {
return findChildElements(container, "DIV", "tab");
}
function findHeaders(container) {
const owner = findChildElements(container, "UL", "tabLinks");
return findChildElements(owner[0], "LI", null);
}
function findTitles(tabs) {
const titles = [];
for (let i = 0; i < tabs.length; i++) {
const tab = tabs[i];
const header = findChildElements(tab, "H2", null)[0];
header.parentNode.removeChild(header);
if (header.innerText) {
titles.push(header.innerText);
} else {
titles.push(header.textContent);
}
}
return titles;
}
function findChildElements(container, name, targetClass) {
const elements = [];
const children = container.childNodes;
for (let i = 0; i < children.length; i++) {
const child = children.item(i);
if (child.nodeType === 1 && child.nodeName === name) {
if (targetClass && child.className.indexOf(targetClass) < 0) {
continue;
}
elements.push(child);
}
}
return elements;
}
// Entry point.
window.onload = function() {
initTabs();
initControls();
};
} (window, window.document));

View File

@@ -0,0 +1,161 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="x-ua-compatible" content="IE=edge"/>
<title>Test results - Package hhn.temp.project</title>
<link href="../css/base-style.css" rel="stylesheet" type="text/css"/>
<link href="../css/style.css" rel="stylesheet" type="text/css"/>
<script src="../js/report.js" type="text/javascript"></script>
</head>
<body>
<div id="content">
<h1>Package hhn.temp.project</h1>
<div class="breadcrumbs">
<a href="../index.html">all</a> &gt; hhn.temp.project</div>
<div id="summary">
<table>
<tr>
<td>
<div class="summaryGroup">
<table>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">25</div>
<p>tests</p>
</div>
</td>
<td>
<div class="infoBox" id="failures">
<div class="counter">5</div>
<p>failures</p>
</div>
</td>
<td>
<div class="infoBox" id="ignored">
<div class="counter">0</div>
<p>ignored</p>
</div>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">1.810s</div>
<p>duration</p>
</div>
</td>
</tr>
</table>
</div>
</td>
<td>
<div class="infoBox failures" id="successRate">
<div class="percent">80%</div>
<p>successful</p>
</div>
</td>
</tr>
</table>
</div>
<div class="tab-container">
<ul class="tabLinks">
<li>
<a href="#">Failed tests</a>
</li>
<li>
<a href="#">Classes</a>
</li>
</ul>
<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>
<li>
<a href="../classes/hhn.temp.project.GoodCasesTest.html">GoodCasesTest</a>.
<a href="../classes/hhn.temp.project.GoodCasesTest.html#assertEditingTasksIsPossibleThroughUi()">Check that editing is possible through UI</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">
<h2>Classes</h2>
<table>
<thead>
<tr>
<th>Class</th>
<th>Tests</th>
<th>Failures</th>
<th>Ignored</th>
<th>Duration</th>
<th>Success rate</th>
</tr>
</thead>
<tr>
<td class="success">
<a href="../classes/hhn.temp.project.BadCasesTest.html">BadCasesTest</a>
</td>
<td>8</td>
<td>0</td>
<td>0</td>
<td>0.021s</td>
<td class="success">100%</td>
</tr>
<tr>
<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.027s</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>1.711s</td>
<td class="failures">0%</td>
</tr>
<tr>
<td class="failures">
<a href="../classes/hhn.temp.project.GoodCasesTest.html">GoodCasesTest</a>
</td>
<td>13</td>
<td>2</td>
<td>0</td>
<td>0.051s</td>
<td class="failures">84%</td>
</tr>
</table>
</div>
</div>
<div id="footer">
<p>
<div>
<label class="hidden" id="label-for-line-wrapping-toggle" for="line-wrapping-toggle">Wrap lines
<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>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +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-04T15:32:20.146Z" hostname="KEVIN-THINKPAD" time="0.035">
<properties/>
<testcase name="Assert List isn't empty after adding a task" classname="hhn.temp.project.BadCasesTest" time="0.004"/>
<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.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.002"/>
<testcase name="Assert only existing tasks can be edited" classname="hhn.temp.project.BadCasesTest" time="0.004"/>
<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.003"/>
<system-out><![CDATA[Unknown command. Type 'help' for available commands.
]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="hhn.temp.project.GoodCasesTest" tests="13" skipped="0" failures="2" errors="0" timestamp="2026-01-04T15:32:20.071Z" hostname="KEVIN-THINKPAD" time="0.067">
<properties/>
<testcase name="Check Getters" classname="hhn.temp.project.GoodCasesTest" time="0.014"/>
<testcase name="Check that editing is possible through UI" classname="hhn.temp.project.GoodCasesTest" time="0.008">
<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)
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)
</failure>
</testcase>
<testcase name="Check that every required surface command actually works" classname="hhn.temp.project.GoodCasesTest" time="0.004"/>
<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.005"/>
<testcase name="Assert that a Worker can add a Task" classname="hhn.temp.project.GoodCasesTest" time="0.001"/>
<testcase name="Assert that removing Workers is possible through the UI" classname="hhn.temp.project.GoodCasesTest" time="0.002"/>
<testcase name="Assert existing Tasks can be edited" classname="hhn.temp.project.GoodCasesTest" time="0.003"/>
<testcase name="Assert that removing a worker removes the worker from the worker list" classname="hhn.temp.project.GoodCasesTest" time="0.005">
<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 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.004"/>
<testcase name="Assert deleted Tasks no longer show up in the List" classname="hhn.temp.project.GoodCasesTest" time="0.001"/>
<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>

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,44 @@
commit bc0e30860cb3697296a4ef6ee22735a5c83cf522 (HEAD -> database)
Author: Riley Schneider <88947587+Ferryry@users.noreply.github.com>
Date: Wed Dec 3 17:30:33 2025 +0100
First database tests
commit 26f7ecbee653b98739e75eb8c4707745f252a1a8 (origin/main, origin/HEAD, main)
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
commit eed1390c6513f1b5e827fd6e09c91f54da7be463 (origin/Skeleton, Skeleton)
Author: Riley Schneider <88947587+Ferryry@users.noreply.github.com>
Date: Wed Dec 3 16:42:41 2025 +0100
Remove database folder
commit b732d8d4b50abc5893d138c6a574fef0025981e0
Author: Riley Schneider <88947587+Ferryry@users.noreply.github.com>
Date: Wed Dec 3 16:38:10 2025 +0100
Initial Commit
commit c5e26bf594b282ab3d665590d0535b61afa18247
Author: KevinSchoenmayer <kschoenmay@stud.hs-heilbronn.de>
Date: Wed Dec 3 16:28:17 2025 +0100
Rough Skeleton for Tests and Classes
commit 668a76e26cfd908499bb74a7732269206062df86
Author: KevinSchoenmayer <kschoenmay@stud.hs-heilbronn.de>
Date: Wed Dec 3 15:26:09 2025 +0100
Initial Test Push
commit 2d963c7fd8ab188625c0e2bc9203c4d55ee07aa3
Author: KevinSchoenmayer <kschoenmay@stud.hs-heilbronn.de>
Date: Wed Dec 3 15:18:41 2025 +0100
Initial commit

View File

@@ -0,0 +1,92 @@
package hhn.temp.project;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AssignmentManager {
private Map<Integer, Worker> workerMap;
private Map<Integer, Task> taskMap;
private int workerIdCounter;
private int taskIdCounter;
private UserCommands userInterface;
public AssignmentManager() {
workerMap = new HashMap<>();
taskMap = new HashMap<>();
int workerIdCounter = 1000;
int 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) {
Worker worker = new Worker(name, ++workerIdCounter);
workerMap.put(workerIdCounter, worker);
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) {
if (!workerMap.containsKey(workerId) || name == null || description == null) {
throw new IllegalArgumentException("WorkerId must exist and name or description can't be null");
}
Task task = new Task(++taskIdCounter, workerId, name, description);
taskMap.put(taskIdCounter, task);
return taskIdCounter;
}
public Task getTask(int taskId) {
if (!taskMap.containsKey(taskId)) {
throw new IllegalArgumentException("Task Id does not exist");
}
return taskMap.get(taskId);
}
public void editTask(int workerId, int taskId, String name, String description) {
if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {
throw new IllegalArgumentException("Task Id or Worker Id does not exist");
}
Task task = taskMap.get(taskId);
task.setName(name);
task.setDescription(description);
}
public void removeTask(int taskId) {
if (!taskMap.containsKey(taskId)) {
throw new IllegalArgumentException("Task Id does not exist");
}
taskMap.remove(taskId);
}
public void finishTask(int workerId, int taskId) {
if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {
throw new IllegalArgumentException("Task Id or Worker Id does not exist");
}
Task task = taskMap.get(taskId);
task.setTaskState(TaskState.FINISHED);
}
public void unfinishTask(int workerId, int taskId) {
if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {
throw new IllegalArgumentException("Task Id or Worker Id does not exist");
}
Task task = taskMap.get(taskId);
task.setTaskState(TaskState.IN_PROGRESS);
}
public UserCommands getUserCommands() {
return userInterface;
}
public void startCLI() {
userInterface.start();
}
public void stopCLI() {
userInterface.stop();
}
}

View File

@@ -1,17 +1,9 @@
package hhn.temp.project;
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
System.out.printf("Hello and welcome!");
import java.util.Scanner;
for (int i = 1; i <= 5; i++) {
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
System.out.println("i = " + i);
public class Main {
public static void main(String[] args) {
AssignmentManager manager = new AssignmentManager();
}
}
}

View File

@@ -0,0 +1,42 @@
package hhn.temp.project;
public class Task {
private String name;
private String description;
private int taskId;
private int workerId;
private TaskState state;
public Task(int taskId, int workerId, String name, String description) {
this.name = name;
this.description = description;
this.taskId = taskId;
this.workerId = workerId;
this.state = TaskState.IN_PROGRESS;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getTaskId() {
return taskId;
}
public int getWorkerId() {
return workerId;
}
public void setTaskState(TaskState state) {
this.state = state;
}
public TaskState getTaskState() {
return state;
}
}

View File

@@ -0,0 +1,6 @@
package hhn.temp.project;
public enum TaskState {
IN_PROGRESS,
FINISHED;
}

View File

@@ -0,0 +1,249 @@
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 boolean inTaskSelection = false;
private boolean inWorkerSelection = false;
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
}
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;
if (inTaskSelection && selectedTaskId != null) {
System.out.println("Task " + selectedTaskId + " selected. Commands: finish, unfinish, remove, edit, back");
} else if (inWorkerSelection && selectedWorkerId != null) {
System.out.println("Worker " + selectedWorkerId + " selected. Commands: remove, back");
} else {
System.out.println("Type '?' or 'help' for a list of commands");
}
System.out.print("> ");
}
public void handleInput(String input) {
if (input == null || input.isEmpty()) {
return;
}
if ("?".equals(input) || "help".equalsIgnoreCase(input)) {
showHelp();
return;
}
try {
if (inTaskSelection) {
handleTaskSelectionInput(input);
} else if (inWorkerSelection) {
handleWorkerSelectionInput(input);
} else {
handleMainMenuInput(input);
}
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
}
private void showHelp() {
if (inTaskSelection && selectedTaskId != null) {
System.out.println("Task commands:");
System.out.println(" finish - Mark task as finished");
System.out.println(" unfinish - Mark task as unfinished");
System.out.println(" remove - Remove this task");
System.out.println(" edit - Edit task (prompts for name;description)");
System.out.println(" back - Return to main menu");
} else if (inWorkerSelection && selectedWorkerId != null) {
System.out.println("Worker commands:");
System.out.println(" remove - Remove this worker");
System.out.println(" back - Return to main menu");
} else {
System.out.println("Available commands:");
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(" help/? - Show this help");
System.out.println(" exit - Exit the program");
}
}
private void handleMainMenuInput(String input) {
switch (input.toLowerCase()) {
case "createworker":
System.out.print("Enter worker name: ");
String workerName = scanner.nextLine().trim();
int workerId = manager.createWorker(workerName);
System.out.println("Created worker with ID: " + workerId);
break;
case "createtask":
System.out.print("Enter worker ID: ");
int workerIdForTask = Integer.parseInt(scanner.nextLine().trim());
System.out.print("Enter task name: ");
String taskName = scanner.nextLine().trim();
System.out.print("Enter task description: ");
String taskDesc = scanner.nextLine().trim();
int taskId = manager.addTask(workerIdForTask, taskName, taskDesc);
System.out.println("Created task with ID: " + taskId);
break;
case "selecttask":
inTaskSelection = true;
System.out.print("Enter task ID: ");
String taskIdInput = scanner.nextLine().trim();
selectedTaskId = Integer.parseInt(taskIdInput);
break;
case "listworkers":
inWorkerSelection = true;
System.out.print("Enter worker ID: ");
String workerIdInput = scanner.nextLine().trim();
selectedWorkerId = Integer.parseInt(workerIdInput);
break;
default:
System.out.println("Unknown command. Type 'help' for available commands.");
}
}
private void handleTaskSelectionInput(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");
resetSelection();
break;
case "edit":
System.out.print("Enter new name;description: ");
String editInput = scanner.nextLine().trim();
String[] parts = editInput.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");
}
break;
case "back":
resetSelection();
break;
default:
try {
selectedTaskId = Integer.parseInt(input);
} catch (NumberFormatException e) {
System.out.println("Unknown command. Type 'help' for available commands.");
}
}
}
private void handleWorkerSelectionInput(String input) {
switch (input.toLowerCase()) {
case "remove":
manager.removeWorker(selectedWorkerId);
System.out.println("Worker removed");
resetSelection();
break;
case "back":
resetSelection();
break;
default:
try {
selectedWorkerId = Integer.parseInt(input);
} catch (NumberFormatException e) {
System.out.println("Unknown command. Type 'help' for available commands.");
}
}
}
private void resetSelection() {
inTaskSelection = false;
inWorkerSelection = false;
selectedTaskId = null;
selectedWorkerId = null;
}
public Scanner getScanner() {
return scanner;
}
// For testing - allows setting scanner
public void setScanner(Scanner scanner) {
this.scanner = scanner;
}
public boolean isRunning() {
return running.get();
}
}

View File

@@ -0,0 +1,17 @@
package hhn.temp.project;
public class Worker {
private String name;
private int workerId;
public Worker(String name, int workerId) {
this.name = name;
this.workerId = workerId;
}
public String getName() {
return name;
}
public int getId() {
return workerId;
}
}

View File

@@ -0,0 +1,9 @@
package hhn.temp.project.provider;
import java.io.IOException;
import java.nio.file.Path;
import java.sql.SQLException;
public interface Database {
public void connect() throws SQLException, IOException;
}

View File

@@ -0,0 +1,10 @@
package hhn.temp.project.provider;
import java.util.Collection;
public interface DatabaseManager<E> extends Database {
public void saveObjects(Collection<E> objects);
public Collection<E> getObjects();
public void saveObject(E object);
public E getObject(int id);
}

View File

@@ -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");
}
}

View File

@@ -0,0 +1,71 @@
package hhn.temp.project;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
public class BadCasesTest {
AssignmentManager manager;
@BeforeEach
public void setup() {
manager = new AssignmentManager();
}
@Test
@DisplayName("Assert that added tasks can't be Null")
public void assertNewTasksAreNotNull() {
int workerId = manager.createWorker("Alfred");
assertThrows(IllegalArgumentException.class, () -> manager.addTask(workerId, null, null));
}
@Test
@DisplayName("Assert List isn't empty after adding a task")
public void assertListNowEmptyAfterAdd() {
int workerId = manager.createWorker("Alfred");
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
assertFalse(manager.getTaskMap().isEmpty());
}
@Test
@DisplayName("Assert only existing tasks can be edited")
public void assertEditOnlyExistingTasks() {
int workerId = manager.createWorker("Alfred");
assertThrows(IllegalArgumentException.class, () -> manager.editTask(workerId, 99969, "I", "am Illegal"));
assertThrows(IllegalArgumentException.class, () -> manager.editTask(22200, 99969, "I", "am Illegal"));
}
@Test
@DisplayName("Assert Add Task is programmed defensively")
public void assertAddTaskOnlyAcceptsValidParameters() {
int workerId = manager.createWorker("Alfred");
assertThrows(IllegalArgumentException.class, () -> manager.addTask( 20203,"I", "am Illegal"));
assertThrows(IllegalArgumentException.class, () -> manager.addTask( workerId,null, null));
}
@Test
@DisplayName("Assert that Remove Task is programmed defensively")
public void assertRemoveTaskOnlyAcceptsValidParameters() {
assertThrows(IllegalArgumentException.class, () -> manager.removeTask(20320));
}
@Test
@DisplayName("Assert that un-/finishing a Task only works with valid parameters")
public void assertTaskStateChangesOnlyAcceptsValidParameters() {
assertThrows(IllegalArgumentException.class, () -> manager.finishTask(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");
}
}
}

View 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());
}
}

View 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();
}
}

View File

@@ -0,0 +1,155 @@
package hhn.temp.project;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.util.Scanner;
import static org.junit.jupiter.api.Assertions.*;
public class GoodCasesTest {
AssignmentManager manager;
@BeforeEach
public void setup() {
manager = new AssignmentManager();
}
@Test
@DisplayName("Assert that a Worker can add a Task")
public void assertWorkerCanAddTask() {
int workerId = manager.createWorker("Alfred");
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
assertNotNull(manager.getTask(taskId));
assertEquals("Run", manager.getTask(taskId).getName());
}
@Test
@DisplayName("Assert that added Tasks are added to the List")
public void assertTasksShowInList() {
int sizeCount = manager.getTaskMap().size();
int workerId = manager.createWorker("Alfred");
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
assertEquals(sizeCount + 1, manager.getTaskMap().size());
}
@Test
@DisplayName("Assert existing Tasks can be edited")
public void assertExistingTasksCanBeEdited() {
int workerId = manager.createWorker("Alfred");
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
manager.editTask(workerId, taskId, "Walk", "Walk 3 Miles");
assertEquals("Walk", manager.getTask(taskId).getName());
assertEquals("Walk 3 Miles", manager.getTask(taskId).getDescription());
}
@Test
@DisplayName("Assert that Worker can remove Task")
public void assertWorkerCanRemoveOwnTask() {
int sizeCount = manager.getTaskMap().size();
int workerId = manager.createWorker("Alfred");
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
assertEquals(sizeCount + 1, manager.getTaskMap().size());
manager.removeTask(taskId);
assertEquals(sizeCount, manager.getTaskMap().size());
}
@Test
@DisplayName("Assert deleted Tasks no longer show up in the List")
public void assertDeletedTasksDisappear() {
int workerId = manager.createWorker("Alfred");
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
manager.removeTask(taskId);
assertThrows(IllegalArgumentException.class, () -> manager.getTask(taskId));
}
@Test
@DisplayName("Check Getters")
public void assertGettersWorkCorrectly() {
int workerId = manager.createWorker("Alfred");
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
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
assertEquals(manager.getWorkerMap().get(workerId).getId(), workerId);
assertEquals(manager.getTask(taskId).getTaskId(), taskId);
assertEquals(manager.getTask(taskId).getWorkerId(), workerId);
}
@Test
@DisplayName("Assert that Task State is actually changed when submitted as finished")
public void assertTaskStateChanges() {
int workerId = manager.createWorker("Alfred");
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
manager.finishTask(workerId, taskId);
assertSame(TaskState.FINISHED, manager.getTask(taskId).getTaskState());
manager.unfinishTask(workerId, taskId);
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");
assertDoesNotThrow(() -> manager.getUserCommands().handleInput("Walk;Walk 3 Miles"));
assertEquals("Walk", manager.getTask(taskId).getName());
assertEquals("Walk 3 Miles", manager.getTask(taskId).getDescription());
assertDoesNotThrow(() -> 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.getWorkerMap().containsKey(workerId));
}
}

View File

@@ -1,14 +0,0 @@
package java;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Assertions.*;
public class BadCasesTest {
@BeforeEach
public void setup() {
}
}

Some files were not shown because too many files have changed in this diff Show More