aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src/test/java/at/gv/egovernment
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-06-19 12:14:20 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-06-19 12:14:20 +0200
commit1fb729e35f4c423cf2a1996cdcc6a213122f4e0e (patch)
tree4d0ad94176fe3d756a3297508a5e2ebf11cbc58c /id/server/moa-id-commons/src/test/java/at/gv/egovernment
parent95ce504efcf6eb886e353310570505d598e10561 (diff)
downloadmoa-id-spss-1fb729e35f4c423cf2a1996cdcc6a213122f4e0e.tar.gz
moa-id-spss-1fb729e35f4c423cf2a1996cdcc6a213122f4e0e.tar.bz2
moa-id-spss-1fb729e35f4c423cf2a1996cdcc6a213122f4e0e.zip
fix merge problems
Diffstat (limited to 'id/server/moa-id-commons/src/test/java/at/gv/egovernment')
-rw-r--r--id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java256
1 files changed, 128 insertions, 128 deletions
diff --git a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java
index c8a234565..896a26064 100644
--- a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java
+++ b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java
@@ -1,128 +1,128 @@
-package at.gv.egovernment.moa.id.commons.db;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Properties;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.annotation.IfProfileValue;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration;
-import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral;
-import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration("configuration.beans-test.xml")
-@IfProfileValue(name = "test-groups", values = { "manual" })
-public class ConfigurationDBReadTest {
-
- @Autowired
- MOAIDConfiguration configDataBase;
-
- private Properties getHibernateProperties() throws FileNotFoundException, IOException {
-
- Properties configProp = null;
- try (InputStream in = ConfigurationDBReadTest.class.getResourceAsStream("hibernate.properties");) {
- Properties props = new Properties();
- props.load(in);
- // read Config Hibernate properties
- configProp = new Properties();
- for (Object key : props.keySet()) {
- String propPrefix = "configuration.";
- if (key.toString().startsWith(propPrefix + "hibernate")) {
- String propertyName = key.toString().substring(propPrefix.length());
- configProp.put(propertyName, props.get(key.toString()));
- }
- }
- }
-
- return configProp;
- }
-
- private void migrateDatabase(List<String> methodNames) throws IllegalAccessException, IllegalArgumentException,
- InvocationTargetException, NoSuchMethodException, SecurityException {
- for (String name : methodNames) {
- Method method = ConfigurationFromDBExtractor.class.getMethod(name);
- Object tmp = method.invoke(null, new Object[] {});
- JsonProperty annotation = method.getAnnotation(JsonProperty.class);
- if (annotation != null) {
- configDataBase.set(annotation.value(), tmp);
- } else {
- System.out.println("Methods must be annotated, annotation is used as key in key-value db.");
- assertTrue(false);
- }
- }
- }
-
- @Before
- public void initialize() throws FileNotFoundException, MOADatabaseException, IOException, IllegalAccessException,
- IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
-
- // initialize the connection to the old database
- ConfigurationDBUtils.initHibernate(getHibernateProperties());
-
- // migrate the data in the old database to a new key value database
- List<String> methodNames = Arrays.asList("getAuthComponentGeneral", "getChainingModes",
- "getTrustedCACertificates", "getDefaultBKUs", "getSLRequestTemplates", "getTimeStampItem",
- "getPvp2RefreshItem", "getOnlineApplications", "getGenericConfigurations");
- migrateDatabase(methodNames);
-
- // close the session with the old database
- ConfigurationDBUtils.closeSession();
- }
-
- @Test
- public void testGetMOAIDConfiguration() throws FileNotFoundException, MOADatabaseException, IOException,
- IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException,
- SecurityException {
-
- // get the old moaid configuration
- at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration();
-
- // get the a new moaid configuration from the data in the key value
- // database
- at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration();
-
- // check if both configurations yield a similar MOAIDConfiguration
- // object
- assertTrue(oldConfig.equals(newConfig));
-
- }
-
- @Test
- public void testGetMOAIDConfigurationNotEqual() throws FileNotFoundException, MOADatabaseException, IOException,
- IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException,
- SecurityException {
-
- // get the old moaid configuration
- at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration();
-
- // delete part of the configuration
- oldConfig.setAuthComponentGeneral(new AuthComponentGeneral());
-
- // get the a new moaid configuration from the data in the key value
- // database
- at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration();
-
- // check if both configurations yield a similar MOAIDConfiguration
- // object
- assertFalse(oldConfig.equals(newConfig));
-
- }
-
-}
+//package at.gv.egovernment.moa.id.commons.db;
+//
+//import static org.junit.Assert.assertFalse;
+//import static org.junit.Assert.assertTrue;
+//
+//import java.io.FileNotFoundException;
+//import java.io.IOException;
+//import java.io.InputStream;
+//import java.lang.reflect.InvocationTargetException;
+//import java.lang.reflect.Method;
+//import java.util.Arrays;
+//import java.util.List;
+//import java.util.Properties;
+//
+//import org.junit.Before;
+//import org.junit.Test;
+//import org.junit.runner.RunWith;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.test.annotation.IfProfileValue;
+//import org.springframework.test.context.ContextConfiguration;
+//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+//
+//import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration;
+//import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral;
+//import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
+//
+//import com.fasterxml.jackson.annotation.JsonProperty;
+//
+//@RunWith(SpringJUnit4ClassRunner.class)
+//@ContextConfiguration("configuration.beans-test.xml")
+//@IfProfileValue(name = "test-groups", values = { "manual" })
+//public class ConfigurationDBReadTest {
+//
+// @Autowired
+// MOAIDConfiguration configDataBase;
+//
+// private Properties getHibernateProperties() throws FileNotFoundException, IOException {
+//
+// Properties configProp = null;
+// try (InputStream in = ConfigurationDBReadTest.class.getResourceAsStream("hibernate.properties");) {
+// Properties props = new Properties();
+// props.load(in);
+// // read Config Hibernate properties
+// configProp = new Properties();
+// for (Object key : props.keySet()) {
+// String propPrefix = "configuration.";
+// if (key.toString().startsWith(propPrefix + "hibernate")) {
+// String propertyName = key.toString().substring(propPrefix.length());
+// configProp.put(propertyName, props.get(key.toString()));
+// }
+// }
+// }
+//
+// return configProp;
+// }
+//
+// private void migrateDatabase(List<String> methodNames) throws IllegalAccessException, IllegalArgumentException,
+// InvocationTargetException, NoSuchMethodException, SecurityException {
+// for (String name : methodNames) {
+// Method method = ConfigurationFromDBExtractor.class.getMethod(name);
+// Object tmp = method.invoke(null, new Object[] {});
+// JsonProperty annotation = method.getAnnotation(JsonProperty.class);
+// if (annotation != null) {
+// configDataBase.set(annotation.value(), tmp);
+// } else {
+// System.out.println("Methods must be annotated, annotation is used as key in key-value db.");
+// assertTrue(false);
+// }
+// }
+// }
+//
+// @Before
+// public void initialize() throws FileNotFoundException, MOADatabaseException, IOException, IllegalAccessException,
+// IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
+//
+// // initialize the connection to the old database
+// ConfigurationDBUtils.initHibernate(getHibernateProperties());
+//
+// // migrate the data in the old database to a new key value database
+// List<String> methodNames = Arrays.asList("getAuthComponentGeneral", "getChainingModes",
+// "getTrustedCACertificates", "getDefaultBKUs", "getSLRequestTemplates", "getTimeStampItem",
+// "getPvp2RefreshItem", "getOnlineApplications", "getGenericConfigurations");
+// migrateDatabase(methodNames);
+//
+// // close the session with the old database
+// ConfigurationDBUtils.closeSession();
+// }
+//
+// @Test
+// public void testGetMOAIDConfiguration() throws FileNotFoundException, MOADatabaseException, IOException,
+// IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException,
+// SecurityException {
+//
+// // get the old moaid configuration
+// at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration();
+//
+// // get the a new moaid configuration from the data in the key value
+// // database
+// at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration();
+//
+// // check if both configurations yield a similar MOAIDConfiguration
+// // object
+// assertTrue(oldConfig.equals(newConfig));
+//
+// }
+//
+// @Test
+// public void testGetMOAIDConfigurationNotEqual() throws FileNotFoundException, MOADatabaseException, IOException,
+// IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException,
+// SecurityException {
+//
+// // get the old moaid configuration
+// at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration();
+//
+// // delete part of the configuration
+// oldConfig.setAuthComponentGeneral(new AuthComponentGeneral());
+//
+// // get the a new moaid configuration from the data in the key value
+// // database
+// at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration();
+//
+// // check if both configurations yield a similar MOAIDConfiguration
+// // object
+// assertFalse(oldConfig.equals(newConfig));
+//
+// }
+//
+//}