Fixed test setting and changed version numbers of full & lite.
Change-Id: I3eb87272df142a9ac4c85a76e72bbd2a99e19605
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/AppTestConfig.java b/full/src/test/java/de/ids_mannheim/korap/config/AppTestConfig.java
index e39c5e0..591d631 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/AppTestConfig.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/AppTestConfig.java
@@ -35,7 +35,7 @@
import de.ids_mannheim.korap.security.auth.KustvaktAuthenticationManager;
import de.ids_mannheim.korap.security.auth.OpenIDconnectAuthentication;
import de.ids_mannheim.korap.security.auth.SessionAuthentication;
-@Configuration
+
public class AppTestConfig extends AppTestConfigBase implements TestBeans {
protected PersistenceClient dataSource;
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java b/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java
index 8f941bb..868b901 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/BeanConfigTest.java
@@ -23,8 +23,9 @@
*/
@NotThreadSafe
@RunWith(BeanConfigTest.SpringExtendedSetupListener.class)
-@ContextConfiguration(classes = AppTestConfig.class)
-@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
+//@ContextConfiguration(classes = AppTestConfig.class)
+@ContextConfiguration("classpath:test-default-config.xml")
+@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
public abstract class BeanConfigTest {
private static Logger jlog = Logger.getLogger(BeanConfigTest.class);
@@ -32,9 +33,9 @@
private ApplicationContext context;
- @Before
+// @Before
public void init () throws Exception {
- context = new ClassPathXmlApplicationContext("test-default-config.xml");
+// context = new ClassPathXmlApplicationContext("test-default-config.xml");
assertNotNull("Application context must not be null!", this.context);
jlog.debug("running one-time before init for class "
+ this.getClass().getSimpleName() + " ...");
@@ -64,7 +65,7 @@
public static class SpringExtendedSetupListener extends
SpringJUnit4ClassRunner {
- private BeanConfigBaseTest instanceSetupListener;
+ private BeanConfigTest instanceSetupListener;
public SpringExtendedSetupListener (Class<?> clazz)
@@ -78,8 +79,8 @@
Object test = super.createTest();
// Note that JUnit4 will call this createTest() multiple times for each
// test method, so we need to ensure to call "beforeClassSetup" only once.
- if (test instanceof BeanConfigBaseTest && instanceSetupListener == null) {
- instanceSetupListener = (BeanConfigBaseTest) test;
+ if (test instanceof BeanConfigTest && instanceSetupListener == null) {
+ instanceSetupListener = (BeanConfigTest) test;
instanceSetupListener.init();
}
return test;
diff --git a/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java b/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
index a20685a..94742c0 100644
--- a/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
@@ -119,13 +119,13 @@
helper().getContext().getUserDataProviders(),
UserDetails.class);
assertNotNull(dao);
- assertEquals(UserDetailsDao.class, dao.getClass());
+ assertTrue(dao instanceof UserDetailsDao);
dao = BeansFactory.getTypeFactory().getTypeInterfaceBean(
helper().getContext().getUserDataProviders(),
UserSettings.class);
assertNotNull(dao);
- assertEquals(UserSettingsDao.class, dao.getClass());
+ assertTrue(dao instanceof UserSettingsDao);
}
diff --git a/full/src/test/resources/test-default-config.xml b/full/src/test/resources/test-default-config.xml
index 34ad45e..de4cfe2 100644
--- a/full/src/test/resources/test-default-config.xml
+++ b/full/src/test/resources/test-default-config.xml
@@ -96,8 +96,8 @@
</bean>
<bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
- <constructor-arg index="0" ref="dataSource" />
- <property name="database" value="jdbc:sqlite::memory:" />
+ <constructor-arg index="0" ref="sqliteDataSource" />
+ <property name="database" value="sqlite" />
</bean>
<bean id="entityManagerFactory"
diff --git a/full/src/test/resources/test-jdbc.properties b/full/src/test/resources/test-jdbc.properties
index 1865408..ef7749d 100644
--- a/full/src/test/resources/test-jdbc.properties
+++ b/full/src/test/resources/test-jdbc.properties
@@ -3,7 +3,8 @@
jdbc.database=sqlite
jdbc.driverClassName=org.sqlite.JDBC
-jdbc.url=jdbc:sqlite:db.sqlite
+#jdbc.url=jdbc:sqlite:dbtest.sqlite
+jdbc.url=jdbc:sqlite::memory:
# jdbc.url=jdbc:sqlite:kustvakt_init_test.sqlite
jdbc.username=pc
jdbc.password=pc