summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-03-13 16:40:50 (EDT)
committerEike Stepper2008-03-13 16:40:50 (EDT)
commitf86eb5d40709e4da25e1be71a6d20d11f075d387 (patch)
tree1bee9e6137b6a05c99df4dc3a31879e9b1384a93
parentf7668e1eaa47be00e3082f2aa91d7dd8c66ccdfd (diff)
downloadcdo-f86eb5d40709e4da25e1be71a6d20d11f075d387.zip
cdo-f86eb5d40709e4da25e1be71a6d20d11f075d387.tar.gz
cdo-f86eb5d40709e4da25e1be71a6d20d11f075d387.tar.bz2
[217117] Develop a HibernateStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=217117
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractCDOTest.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StoreRepositoryProvider.java53
2 files changed, 55 insertions, 10 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractCDOTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractCDOTest.java
index 7d63bf4..3147d6e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractCDOTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractCDOTest.java
@@ -18,8 +18,6 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.server.CDOServerUtil;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.IStore;
-import org.eclipse.emf.cdo.server.StoreUtil;
-import org.eclipse.emf.cdo.server.IRepository.Props;
import org.eclipse.emf.cdo.tests.model1.Model1Package;
import org.eclipse.emf.cdo.util.CDOUtil;
@@ -28,8 +26,6 @@ import org.eclipse.emf.internal.cdo.util.FSMUtil;
import org.eclipse.net4j.tests.AbstractTransportTest;
import org.eclipse.net4j.util.container.IManagedContainer;
-import java.util.HashMap;
-import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
@@ -53,16 +49,12 @@ public abstract class AbstractCDOTest extends AbstractTransportTest
protected IStore createStore()
{
- return StoreUtil.createMEMStore();
+ return StoreRepositoryProvider.getInstance().createStore();
}
protected IRepository createRepository()
{
- Map<String, String> props = new HashMap<String, String>();
- props.put(Props.PROP_SUPPORTING_REVISION_DELTAS, "true");
- props.put(Props.PROP_CURRENT_LRU_CAPACITY, "10000");
- props.put(Props.PROP_REVISED_LRU_CAPACITY, "10000");
- return CDOServerUtil.createRepository(REPOSITORY_NAME, createStore(), props);
+ return StoreRepositoryProvider.getInstance().createRepository(REPOSITORY_NAME);
}
protected IRepository getRepository()
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StoreRepositoryProvider.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StoreRepositoryProvider.java
new file mode 100644
index 0000000..88cf554
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StoreRepositoryProvider.java
@@ -0,0 +1,53 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany, and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.cdo.tests;
+
+import org.eclipse.emf.cdo.server.CDOServerUtil;
+import org.eclipse.emf.cdo.server.IRepository;
+import org.eclipse.emf.cdo.server.IStore;
+import org.eclipse.emf.cdo.server.StoreUtil;
+import org.eclipse.emf.cdo.server.IRepository.Props;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Eike Stepper
+ * @author Martin Taal
+ */
+public class StoreRepositoryProvider
+{
+ private static StoreRepositoryProvider instance = new StoreRepositoryProvider();
+
+ public static StoreRepositoryProvider getInstance()
+ {
+ return instance;
+ }
+
+ public static void setInstance(StoreRepositoryProvider instance)
+ {
+ StoreRepositoryProvider.instance = instance;
+ }
+
+ protected IStore createStore()
+ {
+ return StoreUtil.createMEMStore();
+ }
+
+ protected IRepository createRepository(String name)
+ {
+ Map<String, String> props = new HashMap<String, String>();
+ props.put(Props.PROP_SUPPORTING_REVISION_DELTAS, "true");
+ props.put(Props.PROP_CURRENT_LRU_CAPACITY, "10000");
+ props.put(Props.PROP_REVISED_LRU_CAPACITY, "10000");
+ return CDOServerUtil.createRepository(name, createStore(), props);
+ }
+}