From bfb7f0ebd2c19b0fdd729de526e36794812c35cd Mon Sep 17 00:00:00 2001 From: Tharre Date: Sun, 29 Apr 2018 00:56:09 +0200 Subject: Implement interfaces and the correspondant DTOs --- pom.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pom.xml') diff --git a/pom.xml b/pom.xml index c0587cc..63a2000 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,7 @@ 5.0.5.RELEASE 1.8.0-beta2 + 1.6 1.4.197 1.3.0-alpha4 @@ -53,6 +54,17 @@ slf4j-api ${slf4j.version} + + com.google.auto.value + auto-value-annotations + ${auto-value.version} + + + com.google.auto.value + auto-value + ${auto-value.version} + provided + com.h2database -- cgit v1.2.3-70-g09d2 From d190a8a7e9d80c7f11b8e812d5afddcf95f57b49 Mon Sep 17 00:00:00 2001 From: Dominic Rogetzer Date: Tue, 1 May 2018 22:56:20 +0200 Subject: add testfx as maven dependency --- pom.xml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'pom.xml') diff --git a/pom.xml b/pom.xml index 63a2000..4b0fda7 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,7 @@ 4.12 2.18.0 1.5 + 4.0.13-alpha 2.21.0 3.1.1 @@ -102,6 +103,18 @@ google-java-format ${google-java-format.version} + + org.testfx + testfx-core + ${testfx.version} + test + + + org.testfx + testfx-junit + 4.0.13-alpha + test + @@ -112,8 +125,8 @@ ${maven-surefire-plugin.version} - methods - 10 + + *.java -- cgit v1.2.3-70-g09d2 From 2a57412e33ecb3d87a0181b0c6b3b57f6ef10c83 Mon Sep 17 00:00:00 2001 From: Dominic Rogetzer Date: Fri, 4 May 2018 15:10:53 +0200 Subject: Change pom file: use testfx.version variable --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pom.xml') diff --git a/pom.xml b/pom.xml index 4b0fda7..42f24e7 100644 --- a/pom.xml +++ b/pom.xml @@ -112,7 +112,7 @@ org.testfx testfx-junit - 4.0.13-alpha + ${testfx.version} test -- cgit v1.2.3-70-g09d2 From 5a6c00ebc1583e0505fb795b3483f8937e7b8eb4 Mon Sep 17 00:00:00 2001 From: Felix Kehrer Date: Sun, 6 May 2018 16:01:10 +0200 Subject: Added groundwork for DAO tests --- pom.xml | 4 +- .../sql/H2RegistrationDAOTest_depopulate.sql | 5 ++ .../sql/H2RegistrationDAOTest_populate.sql | 10 ++++ .../dao/H2RegistrationDAOTest.java | 65 ++++++++++++++++++++++ 4 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql create mode 100644 src/main/resources/sql/H2RegistrationDAOTest_populate.sql create mode 100644 src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/H2RegistrationDAOTest.java (limited to 'pom.xml') diff --git a/pom.xml b/pom.xml index 42f24e7..95747aa 100644 --- a/pom.xml +++ b/pom.xml @@ -66,13 +66,13 @@ ${auto-value.version} provided - com.h2database h2 ${h2.version} - runtime + compile + ch.qos.logback logback-classic diff --git a/src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql b/src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql new file mode 100644 index 0000000..f43b641 --- /dev/null +++ b/src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql @@ -0,0 +1,5 @@ +DELETE FROM Registration; +DELETE FROM Vehicle; +DELETE FROM VehicleVersion; +DELETE FROM Employee; +DELETE FROM EmployeeVersion; \ No newline at end of file diff --git a/src/main/resources/sql/H2RegistrationDAOTest_populate.sql b/src/main/resources/sql/H2RegistrationDAOTest_populate.sql new file mode 100644 index 0000000..8322479 --- /dev/null +++ b/src/main/resources/sql/H2RegistrationDAOTest_populate.sql @@ -0,0 +1,10 @@ +INSERT INTO EmployeeVersion (id, name, birthday, educationLevel, isDriver, isPilot) VALUES (1, 'John Doe', '2000-01-01', 'RS', TRUE, TRUE); +INSERT INTO EmployeeVersion (id, name, birthday, educationLevel, isDriver, isPilot) VALUES (2, 'Nick "Kage" Verily', '1990-01-01', 'NKV', TRUE, FALSE); +INSERT INTO EmployeeVersion (id, name, birthday, educationLevel, isDriver, isPilot) VALUES (3, 'Nicht Arzt', '1980-01-01', 'NA', FALSE, FALSE); +INSERT INTO Employee (id, version) VALUES (1, 1); +INSERT INTO Employee (id, version) VALUES (2, 2); +INSERT INTO Employee (id, version) VALUES (3, 3); +INSERT INTO VehicleVersion (id, name, constructionType, type) VALUES (1, 'RTW-1', 'Hochdach', 'RTW'); +INSERT INTO VehicleVersion (id, name, constructionType, type) VALUES (2, 'NEF-1', 'Normal', 'NEF'); +INSERT INTO Vehicle (id, version, status) VALUES (1, 1, 'abgemeldet'); +INSERT INTO Vehicle (id, version, status) VALUES (2, 2, 'abgemeldet'); \ No newline at end of file diff --git a/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/H2RegistrationDAOTest.java b/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/H2RegistrationDAOTest.java new file mode 100644 index 0000000..03b70b1 --- /dev/null +++ b/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/H2RegistrationDAOTest.java @@ -0,0 +1,65 @@ +package at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dao; + +import static org.junit.Assert.*; + +import at.ac.tuwien.sepm.assignment.groupphase.exception.PersistenceException; +import at.ac.tuwien.sepm.assignment.groupphase.util.JDBCConnectionManager; +import java.nio.charset.Charset; +import java.sql.SQLException; +import org.h2.tools.RunScript; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class H2RegistrationDAOTest { + + // Base taken from EmployeePersistenceTest + + private static final String JDBC_DRIVER = org.h2.Driver.class.getName(); + private static final String JDBC_URL = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1"; + private static final String USER = ""; + private static final String PASSWORD = ""; + + private RegistrationDAO registrationDAO; + + public H2RegistrationDAOTest() throws PersistenceException { + this.registrationDAO = new H2RegistrationDAO(new JDBCConnectionManager(JDBC_URL)); + } + + @BeforeClass + public static void setupDatabase() throws SQLException { + RunScript.execute( + JDBC_URL, + USER, + PASSWORD, + "classpath:sql/database.sql", + Charset.forName("UTF8"), + false); + } + + @Before + public void setUp() throws SQLException { + RunScript.execute( + JDBC_URL, + USER, + PASSWORD, + "classpath:sql/H2RegistrationDAOTest_populate.sql", + Charset.forName("UTF8"), + false); + } + + @After + public void tearDown() throws SQLException { + RunScript.execute( + JDBC_URL, + USER, + PASSWORD, + "classpath:sql/H2RegistrationDAOTest_depopulate.sql", + Charset.forName("UTF8"), + false); + } + + @Test + public void add() {} +} -- cgit v1.2.3-70-g09d2 From 301f1613c58f619fc65c3c87db5c558f463500d5 Mon Sep 17 00:00:00 2001 From: Dominic Rogetzer Date: Sat, 5 May 2018 15:35:43 +0200 Subject: Add dbunit as dependency --- pom.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pom.xml') diff --git a/pom.xml b/pom.xml index 42f24e7..094ded3 100644 --- a/pom.xml +++ b/pom.xml @@ -26,6 +26,7 @@ 2.18.0 1.5 4.0.13-alpha + 2.5.1 2.21.0 3.1.1 @@ -71,7 +72,7 @@ com.h2database h2 ${h2.version} - runtime + compile ch.qos.logback @@ -115,6 +116,11 @@ ${testfx.version} test + + org.dbunit + dbunit + ${dbunit.version} + -- cgit v1.2.3-70-g09d2