diff --git a/.gradle/8.14/checksums/checksums.lock b/.gradle/8.14/checksums/checksums.lock index d7e7c606..81d29cbf 100644 Binary files a/.gradle/8.14/checksums/checksums.lock and b/.gradle/8.14/checksums/checksums.lock differ diff --git a/.gradle/8.14/checksums/md5-checksums.bin b/.gradle/8.14/checksums/md5-checksums.bin index d257073f..5831984b 100644 Binary files a/.gradle/8.14/checksums/md5-checksums.bin and b/.gradle/8.14/checksums/md5-checksums.bin differ diff --git a/.gradle/8.14/checksums/sha1-checksums.bin b/.gradle/8.14/checksums/sha1-checksums.bin index 348c37dc..dbb0e154 100644 Binary files a/.gradle/8.14/checksums/sha1-checksums.bin and b/.gradle/8.14/checksums/sha1-checksums.bin differ diff --git a/.gradle/8.14/fileHashes/fileHashes.bin b/.gradle/8.14/fileHashes/fileHashes.bin index 166eb531..6c9e178e 100644 Binary files a/.gradle/8.14/fileHashes/fileHashes.bin and b/.gradle/8.14/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.14/fileHashes/fileHashes.lock b/.gradle/8.14/fileHashes/fileHashes.lock index cc3f934a..67b3dde6 100644 Binary files a/.gradle/8.14/fileHashes/fileHashes.lock and b/.gradle/8.14/fileHashes/fileHashes.lock differ diff --git a/.gradle/9.1.0/executionHistory/executionHistory.bin b/.gradle/9.1.0/executionHistory/executionHistory.bin index 15e4e2ac..76d8a3ad 100644 Binary files a/.gradle/9.1.0/executionHistory/executionHistory.bin and b/.gradle/9.1.0/executionHistory/executionHistory.bin differ diff --git a/.gradle/9.1.0/executionHistory/executionHistory.lock b/.gradle/9.1.0/executionHistory/executionHistory.lock index 285bca11..d242ea5b 100644 Binary files a/.gradle/9.1.0/executionHistory/executionHistory.lock and b/.gradle/9.1.0/executionHistory/executionHistory.lock differ diff --git a/.gradle/9.1.0/fileHashes/fileHashes.bin b/.gradle/9.1.0/fileHashes/fileHashes.bin index 7108d11c..2c48a686 100644 Binary files a/.gradle/9.1.0/fileHashes/fileHashes.bin and b/.gradle/9.1.0/fileHashes/fileHashes.bin differ diff --git a/.gradle/9.1.0/fileHashes/fileHashes.lock b/.gradle/9.1.0/fileHashes/fileHashes.lock index 46fb2abb..1e6947cf 100644 Binary files a/.gradle/9.1.0/fileHashes/fileHashes.lock and b/.gradle/9.1.0/fileHashes/fileHashes.lock differ diff --git a/.gradle/9.1.0/fileHashes/resourceHashesCache.bin b/.gradle/9.1.0/fileHashes/resourceHashesCache.bin index 7bcf13dd..19617dc6 100644 Binary files a/.gradle/9.1.0/fileHashes/resourceHashesCache.bin and b/.gradle/9.1.0/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index ae62fefe..c9266c83 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties index ef901a0c..36b2069f 100644 --- a/.gradle/buildOutputCleanup/cache.properties +++ b/.gradle/buildOutputCleanup/cache.properties @@ -1,2 +1,2 @@ -#Wed Dec 03 17:27:55 CET 2025 -gradle.version=8.14 +#Wed Dec 03 19:45:38 CET 2025 +gradle.version=9.1.0 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index b83668bf..896f9443 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..ffe7c8fc --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Template.test.iml b/.idea/modules/Template.test.iml new file mode 100644 index 00000000..bb71afac --- /dev/null +++ b/.idea/modules/Template.test.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/build/classes/java/main/hhn/temp/project/provider/Database.class b/build/classes/java/main/hhn/temp/project/provider/Database.class index 90607670..bb1634f0 100644 Binary files a/build/classes/java/main/hhn/temp/project/provider/Database.class and b/build/classes/java/main/hhn/temp/project/provider/Database.class differ diff --git a/build/reports/problems/problems-report.html b/build/reports/problems/problems-report.html index 73de4bc6..34fee3a7 100644 --- a/build/reports/problems/problems-report.html +++ b/build/reports/problems/problems-report.html @@ -650,12 +650,12 @@ code + .copy-button { diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin index c4519adc..1a4bec5f 100644 Binary files a/build/tmp/compileJava/previous-compilation-data.bin and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/src/main/java/hhn/temp/project/provider/Database.java b/src/main/java/hhn/temp/project/provider/Database.java index f0661689..be2d5c74 100644 --- a/src/main/java/hhn/temp/project/provider/Database.java +++ b/src/main/java/hhn/temp/project/provider/Database.java @@ -1,7 +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; + public void connect() throws SQLException, IOException; } diff --git a/src/main/java/hhn/temp/project/provider/SimpleDatabaseManager.java b/src/main/java/hhn/temp/project/provider/SimpleDatabaseManager.java index 0ea32b99..941e74e4 100644 --- a/src/main/java/hhn/temp/project/provider/SimpleDatabaseManager.java +++ b/src/main/java/hhn/temp/project/provider/SimpleDatabaseManager.java @@ -1,10 +1,19 @@ 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 implements DatabaseManager { + + private Connection connection; + @Override public void saveObjects(Collection objects) { @@ -26,7 +35,7 @@ public class SimpleDatabaseManager implements DatabaseManager { } @Override - public void connect() throws SQLException { - throw new SQLException(""); + public void connect() throws SQLException, IOException { + connection = DriverManager.getConnection("jdbc:mysql://sql7.freesqldatabase.com/sql7810540?user=sql7810540&password=mXdJCFtDZz"); } } diff --git a/test/hhn/temp/project/DatabaseGoodCasesTest.java b/test/hhn/temp/project/DatabaseGoodCasesTest.java index 129b521b..4f776ea7 100644 --- a/test/hhn/temp/project/DatabaseGoodCasesTest.java +++ b/test/hhn/temp/project/DatabaseGoodCasesTest.java @@ -6,6 +6,7 @@ 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 { @@ -29,10 +30,27 @@ public class DatabaseGoodCasesTest { 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 { + public void assertConnectToDatabase() throws SQLException, IOException { databaseManager.connect(); } } \ No newline at end of file