Compare commits
1 Commits
dbebcad97d
...
Roles
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a387400a1 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +0,0 @@
|
||||
build/
|
||||
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.
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.
@@ -1,2 +1,2 @@
|
||||
#Wed Dec 03 17:27:55 CET 2025
|
||||
#Tue Dec 02 10:03:29 CET 2025
|
||||
gradle.version=8.14
|
||||
|
||||
Binary file not shown.
Binary file not shown.
9
.idea/GSEUebung.iml
generated
Normal file
9
.idea/GSEUebung.iml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<?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
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?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,7 +14,6 @@ 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 {
|
||||
@@ -37,11 +36,6 @@ sourceSets {
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
testLogging {
|
||||
events "passed", "skipped", "failed"
|
||||
exceptionFormat "full"
|
||||
showStandardStreams = true
|
||||
}
|
||||
finalizedBy jacocoTestReport
|
||||
}
|
||||
jacocoTestReport {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,44 +0,0 @@
|
||||
[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
|
||||
@@ -1,12 +0,0 @@
|
||||
package hhn.temp.project;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AssignmentManager {
|
||||
List<Worker> workerList;
|
||||
|
||||
public AssignmentManager() {
|
||||
workerList = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
17
src/main/java/hhn/temp/project/Main.java
Normal file
17
src/main/java/hhn/temp/project/Main.java
Normal file
@@ -0,0 +1,17 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package hhn.temp.project;
|
||||
|
||||
public class Task {
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package hhn.temp.project;
|
||||
|
||||
public enum TaskState {
|
||||
IN_PROGRESS,
|
||||
FINISHED;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package hhn.temp.project;
|
||||
|
||||
public class Worker {
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package hhn.temp.project.provider;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
public interface Database {
|
||||
public void connect() throws SQLException;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
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);
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package hhn.temp.project.provider;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class SimpleDatabaseManager<E> implements DatabaseManager<E> {
|
||||
@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() {
|
||||
//...
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
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.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
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(manager.addTask(workerId, null, null) instanceof IllegalArgumentException);
|
||||
}
|
||||
@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");
|
||||
assertTrue(manager.getTaskList().size >= 1);
|
||||
}
|
||||
@Test
|
||||
@DisplayName("Assert only existing tasks can be edited")
|
||||
public void assertEditOnlyExistingTasks() {
|
||||
int workerId = manager.createWorker("Alfred");
|
||||
assertThrows(manager.editTask(workerId, 99969, "I", "am Illegal") instanceof IllegalArgumentException);
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
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;
|
||||
|
||||
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 connecting to database")
|
||||
public void assertConnectToDatabase() throws SQLException {
|
||||
databaseManager.connect();
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
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 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(manager.getTask(taskId).getName(), "Run");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Assert that added Tasks are added to the List")
|
||||
public void assertTasksShowInList() {
|
||||
int sizeCount = manager.getTaskList().size();
|
||||
int workerId = manager.createWorker("Alfred");
|
||||
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||
assertEquals(sizeCount + 1, manager.getTaskList().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(manager.getTask(taskId).getName(), "Walk");
|
||||
assertEquals(manager.getTask(taskId).getDescription(), "Walk 3 Miles");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Assert that Worker can remove Task")
|
||||
public void assertWorkerCanRemoveOwnTask() {
|
||||
int sizeCount = manager.getTaskList().size();
|
||||
int workerId = manager.createWorker("Alfred");
|
||||
int taskId = manager.addTask(workerId, "Run", "Jog 10 Miles");
|
||||
assertEquals(sizeCount + 1, manager.getTaskList().size);
|
||||
manager.removeTask(taskId);
|
||||
assertEquals(sizeCount - 1, manager.getTaskList().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(manager.getTask(taskId) instanceof IllegalArgumentException);
|
||||
}*/
|
||||
|
||||
}
|
||||
14
test/java/BadCasesTest.java
Normal file
14
test/java/BadCasesTest.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package java;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class BadCasesTest {
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
14
test/java/GoodCasesTest.java
Normal file
14
test/java/GoodCasesTest.java
Normal file
@@ -0,0 +1,14 @@
|
||||
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