Compare commits
6 Commits
Roles
...
0c4f092312
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c4f092312 | ||
|
|
bc0e30860c | ||
| 26f7ecbee6 | |||
|
|
eed1390c65 | ||
|
|
b732d8d4b5 | ||
| c5e26bf594 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -0,0 +1 @@
|
|||||||
|
build/
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.gradle/8.14/executionHistory/executionHistory.bin
Normal file
BIN
.gradle/8.14/executionHistory/executionHistory.bin
Normal file
Binary file not shown.
Binary file not shown.
BIN
.gradle/8.14/expanded/expanded.lock
Normal file
BIN
.gradle/8.14/expanded/expanded.lock
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.gradle/8.14/fileHashes/resourceHashesCache.bin
Normal file
BIN
.gradle/8.14/fileHashes/resourceHashesCache.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/checksums/checksums.lock
Normal file
BIN
.gradle/9.1.0/checksums/checksums.lock
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/checksums/md5-checksums.bin
Normal file
BIN
.gradle/9.1.0/checksums/md5-checksums.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/checksums/sha1-checksums.bin
Normal file
BIN
.gradle/9.1.0/checksums/sha1-checksums.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/executionHistory/executionHistory.bin
Normal file
BIN
.gradle/9.1.0/executionHistory/executionHistory.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/executionHistory/executionHistory.lock
Normal file
BIN
.gradle/9.1.0/executionHistory/executionHistory.lock
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/expanded/expanded.lock
Normal file
BIN
.gradle/9.1.0/expanded/expanded.lock
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/fileChanges/last-build.bin
Normal file
BIN
.gradle/9.1.0/fileChanges/last-build.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/fileHashes/fileHashes.bin
Normal file
BIN
.gradle/9.1.0/fileHashes/fileHashes.bin
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/fileHashes/fileHashes.lock
Normal file
BIN
.gradle/9.1.0/fileHashes/fileHashes.lock
Normal file
Binary file not shown.
BIN
.gradle/9.1.0/fileHashes/resourceHashesCache.bin
Normal file
BIN
.gradle/9.1.0/fileHashes/resourceHashesCache.bin
Normal file
Binary file not shown.
0
.gradle/9.1.0/gc.properties
Normal file
0
.gradle/9.1.0/gc.properties
Normal file
Binary file not shown.
@@ -1,2 +1,2 @@
|
|||||||
#Tue Dec 02 10:03:29 CET 2025
|
#Wed Dec 03 17:36:43 CET 2025
|
||||||
gradle.version=8.14
|
gradle.version=9.1.0
|
||||||
|
|||||||
BIN
.gradle/buildOutputCleanup/outputFiles.bin
Normal file
BIN
.gradle/buildOutputCleanup/outputFiles.bin
Normal file
Binary file not shown.
BIN
.gradle/file-system.probe
Normal file
BIN
.gradle/file-system.probe
Normal file
Binary file not shown.
9
.idea/GSEUebung.iml
generated
9
.idea/GSEUebung.iml
generated
@@ -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>
|
|
||||||
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -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>
|
|
||||||
@@ -14,6 +14,7 @@ dependencies {
|
|||||||
testImplementation platform('org.junit:junit-bom:5.10.0')
|
testImplementation platform('org.junit:junit-bom:5.10.0')
|
||||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||||
|
implementation 'com.mysql:mysql-connector-j:9.5.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
jacoco {
|
jacoco {
|
||||||
@@ -36,6 +37,11 @@ sourceSets {
|
|||||||
|
|
||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
|
testLogging {
|
||||||
|
events "passed", "skipped", "failed"
|
||||||
|
exceptionFormat "full"
|
||||||
|
showStandardStreams = true
|
||||||
|
}
|
||||||
finalizedBy jacocoTestReport
|
finalizedBy jacocoTestReport
|
||||||
}
|
}
|
||||||
jacocoTestReport {
|
jacocoTestReport {
|
||||||
|
|||||||
44
git show bc0e30860cb3697296a4ef6ee22735a5c83cf522
Normal file
44
git show bc0e30860cb3697296a4ef6ee22735a5c83cf522
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
[33mcommit bc0e30860cb3697296a4ef6ee22735a5c83cf522[m[33m ([m[1;36mHEAD[m[33m -> [m[1;32mdatabase[m[33m)[m
|
||||||
|
Author: Riley Schneider <88947587+Ferryry@users.noreply.github.com>
|
||||||
|
Date: Wed Dec 3 17:30:33 2025 +0100
|
||||||
|
|
||||||
|
First database tests
|
||||||
|
|
||||||
|
[33mcommit 26f7ecbee653b98739e75eb8c4707745f252a1a8[m[33m ([m[1;31morigin/main[m[33m, [m[1;31morigin/HEAD[m[33m, [m[1;32mmain[m[33m)[m
|
||||||
|
Merge: 668a76e2 eed1390c
|
||||||
|
Author: Ferryry <rileymika99@gmail.com>
|
||||||
|
Date: Wed Dec 3 16:44:45 2025 +0100
|
||||||
|
|
||||||
|
Merge pull request 'Skeleton' (#1) from Skeleton into main
|
||||||
|
|
||||||
|
Reviewed-on: https://home.luithardt.cloud:5400/KevinSchoenmayer/GseTDDUebungKCLR/pulls/1
|
||||||
|
|
||||||
|
[33mcommit eed1390c6513f1b5e827fd6e09c91f54da7be463[m[33m ([m[1;31morigin/Skeleton[m[33m, [m[1;32mSkeleton[m[33m)[m
|
||||||
|
Author: Riley Schneider <88947587+Ferryry@users.noreply.github.com>
|
||||||
|
Date: Wed Dec 3 16:42:41 2025 +0100
|
||||||
|
|
||||||
|
Remove database folder
|
||||||
|
|
||||||
|
[33mcommit b732d8d4b50abc5893d138c6a574fef0025981e0[m
|
||||||
|
Author: Riley Schneider <88947587+Ferryry@users.noreply.github.com>
|
||||||
|
Date: Wed Dec 3 16:38:10 2025 +0100
|
||||||
|
|
||||||
|
Initial Commit
|
||||||
|
|
||||||
|
[33mcommit c5e26bf594b282ab3d665590d0535b61afa18247[m
|
||||||
|
Author: KevinSchoenmayer <kschoenmay@stud.hs-heilbronn.de>
|
||||||
|
Date: Wed Dec 3 16:28:17 2025 +0100
|
||||||
|
|
||||||
|
Rough Skeleton for Tests and Classes
|
||||||
|
|
||||||
|
[33mcommit 668a76e26cfd908499bb74a7732269206062df86[m
|
||||||
|
Author: KevinSchoenmayer <kschoenmay@stud.hs-heilbronn.de>
|
||||||
|
Date: Wed Dec 3 15:26:09 2025 +0100
|
||||||
|
|
||||||
|
Initial Test Push
|
||||||
|
|
||||||
|
[33mcommit 2d963c7fd8ab188625c0e2bc9203c4d55ee07aa3[m
|
||||||
|
Author: KevinSchoenmayer <kschoenmay@stud.hs-heilbronn.de>
|
||||||
|
Date: Wed Dec 3 15:18:41 2025 +0100
|
||||||
|
|
||||||
|
Initial commit
|
||||||
4
src/main/java/hhn/temp/project/Admin.java
Normal file
4
src/main/java/hhn/temp/project/Admin.java
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
public class Admin extends Worker{
|
||||||
|
}
|
||||||
12
src/main/java/hhn/temp/project/AssignmentManager.java
Normal file
12
src/main/java/hhn/temp/project/AssignmentManager.java
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class AssignmentManager {
|
||||||
|
List<Worker> workerList;
|
||||||
|
|
||||||
|
public AssignmentManager() {
|
||||||
|
workerList = new ArrayList<>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
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!");
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
4
src/main/java/hhn/temp/project/Task.java
Normal file
4
src/main/java/hhn/temp/project/Task.java
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
public class Task {
|
||||||
|
}
|
||||||
6
src/main/java/hhn/temp/project/TaskState.java
Normal file
6
src/main/java/hhn/temp/project/TaskState.java
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
public enum TaskState {
|
||||||
|
IN_PROGRESS,
|
||||||
|
FINISHED;
|
||||||
|
}
|
||||||
4
src/main/java/hhn/temp/project/Worker.java
Normal file
4
src/main/java/hhn/temp/project/Worker.java
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
public class Worker {
|
||||||
|
}
|
||||||
7
src/main/java/hhn/temp/project/provider/Database.java
Normal file
7
src/main/java/hhn/temp/project/provider/Database.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package hhn.temp.project.provider;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public interface Database {
|
||||||
|
public void connect() throws SQLException;
|
||||||
|
}
|
||||||
10
src/main/java/hhn/temp/project/provider/DatabaseManager.java
Normal file
10
src/main/java/hhn/temp/project/provider/DatabaseManager.java
Normal 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);
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package hhn.temp.project.provider;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.sql.*;
|
||||||
|
|
||||||
|
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 {
|
||||||
|
throw new SQLException();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
37
test/hhn/temp/project/BadCasesTest.java
Normal file
37
test/hhn/temp/project/BadCasesTest.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
import hhn.temp.project.AssignmentManager;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
public class BadCasesTest {
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void setup() {
|
||||||
|
AssignmentManager manager = new AssignmentManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that added tasks can't be Null")
|
||||||
|
public void assertNewTasksAreNotNull() {
|
||||||
|
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert List isn't empty after adding a task")
|
||||||
|
public void assertListNowEmptyAfterAdd() {
|
||||||
|
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert only existing tasks can be edited")
|
||||||
|
public void assertEditOnlyExistingTasks() {
|
||||||
|
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert Worker can only edit own tasks")
|
||||||
|
public void assertWorkerMayOnlyEditOwnTasks() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
39
test/hhn/temp/project/DatabaseBadCasesTest.java
Normal file
39
test/hhn/temp/project/DatabaseBadCasesTest.java
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
import hhn.temp.project.provider.DatabaseManager;
|
||||||
|
import hhn.temp.project.provider.SimpleDatabaseManager;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
public class DatabaseBadCasesTest {
|
||||||
|
|
||||||
|
private DatabaseManager<DatabaseGoodCasesTest.TestClass> databaseManager;
|
||||||
|
|
||||||
|
public class TestClass {
|
||||||
|
private int id;
|
||||||
|
private String dataString;
|
||||||
|
private int dataInteger;
|
||||||
|
|
||||||
|
public TestClass(int id, String dataString, int dataInteger) {
|
||||||
|
this.id = id;
|
||||||
|
this.dataString = dataString;
|
||||||
|
this.dataInteger = dataInteger;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void setup() {
|
||||||
|
databaseManager = new SimpleDatabaseManager<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert connection failed")
|
||||||
|
public void assertConnectionFailed() {
|
||||||
|
assertThrows(SQLException.class, () -> databaseManager.connect());
|
||||||
|
}
|
||||||
|
}
|
||||||
33
test/hhn/temp/project/DatabaseGoodCasesTest.java
Normal file
33
test/hhn/temp/project/DatabaseGoodCasesTest.java
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
import hhn.temp.project.provider.DatabaseManager;
|
||||||
|
import hhn.temp.project.provider.SimpleDatabaseManager;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
|
||||||
|
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<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void assertConnectToDatabase() throws SQLException {
|
||||||
|
databaseManager.connect();
|
||||||
|
}
|
||||||
|
}
|
||||||
51
test/hhn/temp/project/GoodCasesTest.java
Normal file
51
test/hhn/temp/project/GoodCasesTest.java
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
package hhn.temp.project;
|
||||||
|
|
||||||
|
import hhn.temp.project.AssignmentManager;
|
||||||
|
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.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
public class GoodCasesTest {
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void setup() {
|
||||||
|
AssignmentManager manager = new AssignmentManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that a Worker can add a Task")
|
||||||
|
public void assertWorkerCanAddTask() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that added Tasks are added to the List")
|
||||||
|
public void assertTasksShowInList() {
|
||||||
|
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert existing Tasks can be edited")
|
||||||
|
public void assertExistingTasksCanBeEdited() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that Worker can remove own Task")
|
||||||
|
public void assertWorkerCanRemoveOwnTask() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert that Admin can remove every Task")
|
||||||
|
public void assertAdminCanRemoveEveryTask() {
|
||||||
|
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
@DisplayName("Assert deleted Tasks no longer show up in the List")
|
||||||
|
public void assertDeletedTasksDisappear() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package java;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
|
||||||
import org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
public class GoodCasesTest {
|
|
||||||
|
|
||||||
@BeforeEach
|
|
||||||
public void setup() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user