From 834f9b4fff11c778dbb09dc74a88d658fc094a54 Mon Sep 17 00:00:00 2001 From: Felix Kehrer Date: Mon, 7 May 2018 18:06:00 +0200 Subject: Changed test behaviour to leave "clean" database for other tests --- .../dao/RegistrationDatabaseDAOTest.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/test/java/at/ac/tuwien/sepm/assignment/groupphase') diff --git a/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDatabaseDAOTest.java b/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDatabaseDAOTest.java index 980c429..03059ff 100644 --- a/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDatabaseDAOTest.java +++ b/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDatabaseDAOTest.java @@ -14,8 +14,7 @@ import java.time.LocalDate; import java.util.LinkedList; import java.util.List; import org.h2.tools.RunScript; -import org.junit.After; -import org.junit.Before; +import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; @@ -45,10 +44,6 @@ public class RegistrationDatabaseDAOTest { "classpath:sql/database.sql", Charset.forName("UTF8"), false); - } - - @Before - public void setUp() throws SQLException { RunScript.execute( JDBC_URL, USER, @@ -57,9 +52,20 @@ public class RegistrationDatabaseDAOTest { Charset.forName("UTF8"), false); } - - @After - public void tearDown() throws SQLException { + /* + @Before + public void setUp() throws SQLException { + RunScript.execute( + JDBC_URL, + USER, + PASSWORD, + "classpath:sql/H2RegistrationDAOTest_populate.sql", + Charset.forName("UTF8"), + false); + } + */ + @AfterClass + public static void tearDown() throws SQLException { RunScript.execute( JDBC_URL, USER, -- cgit v1.2.3-70-g09d2