Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-10-29 16:24:08 -0400
committerEike Stepper2008-10-29 16:24:08 -0400
commitaca5125b20b055d870cbe8bff40d4894da267ea5 (patch)
tree30e7e2d4ed6e3528b3a6e58b5efaf5e722f7e933
parentfd65d850f86d48599d893f720329d9ea27afcb2a (diff)
downloadcdo-aca5125b20b055d870cbe8bff40d4894da267ea5.tar.gz
cdo-aca5125b20b055d870cbe8bff40d4894da267ea5.tar.xz
cdo-aca5125b20b055d870cbe8bff40d4894da267ea5.zip
/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java (renamed from plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsHibernate.java)7
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java57
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/HSQLDBHorizontalTest.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/build.properties1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/ConfigConstants.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/RepositoryConfig.java31
7 files changed, 69 insertions, 66 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsHibernate.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java
index a565230bbe..6b1fdea384 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsHibernate.java
+++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java
@@ -8,7 +8,10 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.cdo.tests;
+package org.eclipse.emf.cdo.tests.hibernate;
+
+import org.eclipse.emf.cdo.tests.AllTestsAllConfigs;
+import org.eclipse.emf.cdo.tests.config.RepositoryConfig;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -18,6 +21,8 @@ import junit.framework.TestSuite;
*/
public class AllTestsHibernate extends AllTestsAllConfigs
{
+ public static final RepositoryConfig HIBERNATE = HibernateConfig.INSTANCE;
+
public static Test suite()
{
return new AllTestsHibernate().getTestSuite("CDO Tests (Hibernate)");
diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java
new file mode 100644
index 0000000000..eeae5292c8
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java
@@ -0,0 +1,57 @@
+package org.eclipse.emf.cdo.tests.hibernate;
+
+import org.eclipse.emf.cdo.server.IStore;
+import org.eclipse.emf.cdo.server.IRepository.Props;
+import org.eclipse.emf.cdo.server.hibernate.CDOHibernateUtil;
+import org.eclipse.emf.cdo.server.hibernate.IHibernateMappingProvider;
+import org.eclipse.emf.cdo.server.hibernate.teneo.TeneoUtil;
+import org.eclipse.emf.cdo.tests.config.RepositoryConfig;
+
+import org.eclipse.net4j.util.WrappedException;
+
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * @author Eike Stepper
+ */
+public class HibernateConfig extends RepositoryConfig
+{
+ public static final HibernateConfig INSTANCE = new HibernateConfig();
+
+ public static final String MAPPING_FILE = "mappingfile";
+
+ public HibernateConfig()
+ {
+ super("Hibernate");
+ }
+
+ @Override
+ protected void initRepositoryProperties(Map<String, String> props)
+ {
+ super.initRepositoryProperties(props);
+ props.put(Props.SUPPORTING_AUDITS, "false");
+ props.put(Props.VERIFYING_REVISIONS, "false");
+
+ try
+ {
+ final Properties teneoProperties = new Properties();
+ teneoProperties.load(getClass().getResourceAsStream("/app.properties"));
+ for (Object key : teneoProperties.keySet())
+ {
+ props.put((String)key, teneoProperties.getProperty((String)key));
+ }
+ }
+ catch (Exception e)
+ {
+ throw WrappedException.wrap(e);
+ }
+ }
+
+ @Override
+ protected IStore createStore()
+ {
+ IHibernateMappingProvider mappingProvider = TeneoUtil.createMappingProvider();
+ return CDOHibernateUtil.createStore(mappingProvider);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.tests/HSQLDBHorizontalTest.java b/plugins/org.eclipse.emf.cdo.tests/HSQLDBHorizontalTest.java
deleted file mode 100644
index fa8559f97c..0000000000
--- a/plugins/org.eclipse.emf.cdo.tests/HSQLDBHorizontalTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.emf.cdo.tests.store;
-
-import org.eclipse.emf.cdo.tests.store.logic.HorizontalTestLogic;
-
-import org.eclipse.net4j.db.IDBConnectionProvider;
-import org.eclipse.net4j.db.hsqldb.HSQLDBDataSource;
-import org.eclipse.net4j.db.internal.hsqldb.HSQLDBAdapter;
-import org.eclipse.net4j.internal.db.DataSourceConnectionProvider;
-
-/**
- * @author Eike Stepper
- */
-public final class HSQLDBHorizontalTest extends HorizontalTestLogic
-{
- @Override
- protected IDBConnectionProvider createDBConnectionProvider()
- {
- HSQLDBDataSource dataSource = new HSQLDBDataSource();
- dataSource.setDatabase("jdbc:hsqldb:mem:storetest");
- dataSource.setUser("sa");
-
- return new DataSourceConnectionProvider(dataSource);
- }
-
- @Override
- protected HSQLDBAdapter createDBAdapter()
- {
- return new HSQLDBAdapter();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
index 1fc58bf957..b677223fbb 100644
--- a/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
@@ -13,10 +13,13 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
org.eclipse.net4j.db.hsqldb;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.net4j.db.derby;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.net4j.db.mysql;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.net4j.jvm;bundle-version="[2.0.0,3.0.0)";resolution:=optional;visibility:=reexport,
org.eclipse.net4j.tcp;bundle-version="[2.0.0,3.0.0)";resolution:=optional;visibility:=reexport,
org.eclipse.emf.cdo.server;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.server.db;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.cdo.server.hibernate;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.cdo;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.tests.mango;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.tests.model1;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
@@ -24,8 +27,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.emf.cdo.tests.model3;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.tests.model4;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.tests.model4interfaces;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
- org.junit;bundle-version="[3.8.0,4.0.0)";visibility:=reexport,
- org.eclipse.net4j.db.mysql;bundle-version="2.0.0"
+ org.junit;bundle-version="[3.8.0,4.0.0)";visibility:=reexport
Export-Package: base;version="2.0.0",
base.impl;version="2.0.0",
base.util;version="2.0.0",
diff --git a/plugins/org.eclipse.emf.cdo.tests/build.properties b/plugins/org.eclipse.emf.cdo.tests/build.properties
index 1954e5118a..0de340ed08 100644
--- a/plugins/org.eclipse.emf.cdo.tests/build.properties
+++ b/plugins/org.eclipse.emf.cdo.tests/build.properties
@@ -10,7 +10,6 @@ bin.includes = .,\
plugin.xml,\
plugin.properties,\
CDO AllTests.launch,\
- HSQLDBHorizontalTest.java,\
copyright.txt,\
about.html,\
about.ini,\
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/ConfigConstants.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/ConfigConstants.java
index 493060c058..ce82c0170d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/ConfigConstants.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/ConfigConstants.java
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.tests.config;
+
/**
* @author Eike Stepper
*/
@@ -33,8 +34,6 @@ public interface ConfigConstants
public static final RepositoryConfig DB_MYSQL_HORIZONTAL = RepositoryConfig.DBMysql.MYSQL_HORIZONTAL;
- public static final RepositoryConfig HIBERNATE = RepositoryConfig.Hibernate.INSTANCE;
-
public static final SessionConfig JVM = SessionConfig.JVM.INSTANCE;
public static final SessionConfig TCP = SessionConfig.TCP.INSTANCE;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/RepositoryConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/RepositoryConfig.java
index 6a9847f6a4..9ad411790a 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/RepositoryConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/RepositoryConfig.java
@@ -55,7 +55,7 @@ import java.util.Map.Entry;
public abstract class RepositoryConfig extends Config implements RepositoryProvider
{
public static final RepositoryConfig[] CONFIGS = { MEM.INSTANCE, DBHsqldb.HSQLDB_HORIZONTAL,
- DBDerby.DERBY_HORIZONTAL, DBMysql.MYSQL_HORIZONTAL, Hibernate.INSTANCE };
+ DBDerby.DERBY_HORIZONTAL, DBMysql.MYSQL_HORIZONTAL };
public static final String PROP_TEST_REPOSITORY = "test.repository";
@@ -453,33 +453,4 @@ public abstract class RepositoryConfig extends Config implements RepositoryProvi
}
}
}
-
- /**
- * @author Eike Stepper
- */
- public static class Hibernate extends RepositoryConfig
- {
- public static final Hibernate INSTANCE = new Hibernate();
-
- public static final String MAPPING_FILE = "mappingfile";
-
- public Hibernate()
- {
- super("Hibernate");
- }
-
- @Override
- protected void initRepositoryProperties(Map<String, String> props)
- {
- super.initRepositoryProperties(props);
- props.put(Props.SUPPORTING_AUDITS, "false");
- props.put(Props.VERIFYING_REVISIONS, "false");
- }
-
- @Override
- protected IStore createStore()
- {
- return null;
- }
- }
}

Back to the top