diff options
author | Eike Stepper | 2011-02-21 08:25:37 +0000 |
---|---|---|
committer | Eike Stepper | 2011-02-21 08:25:37 +0000 |
commit | 94ad5af8f7127adfef2cd4db6b3d65487cf9aaf4 (patch) | |
tree | ca25304decbb6213f73eec7cb55eeab65a32d561 | |
parent | b10189b13ccb699c9fec6e8db387533f4cdd97c1 (diff) | |
download | cdo-94ad5af8f7127adfef2cd4db6b3d65487cf9aaf4.tar.gz cdo-94ad5af8f7127adfef2cd4db6b3d65487cf9aaf4.tar.xz cdo-94ad5af8f7127adfef2cd4db6b3d65487cf9aaf4.zip |
[337152] [Mongo] Create a MongoDBStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337152
2 files changed, 18 insertions, 39 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/AllTestsMongoDB.java b/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/AllTestsMongoDB.java index 90ce55a0a1..ae95117b21 100644 --- a/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/AllTestsMongoDB.java +++ b/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/AllTestsMongoDB.java @@ -12,14 +12,7 @@ package org.eclipse.emf.cdo.tests.mongodb; import org.eclipse.emf.cdo.tests.AllConfigs; -import org.eclipse.emf.cdo.tests.AuditSameSessionTest; -import org.eclipse.emf.cdo.tests.AuditTest; -import org.eclipse.emf.cdo.tests.BranchingSameSessionTest; -import org.eclipse.emf.cdo.tests.BranchingTest; import org.eclipse.emf.cdo.tests.MEMStoreQueryTest; -import org.eclipse.emf.cdo.tests.MergingTest; -import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_252214_Test; -import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_303807_Test; import org.eclipse.emf.cdo.tests.config.impl.ConfigTest; import java.util.List; @@ -34,13 +27,15 @@ public class AllTestsMongoDB extends AllConfigs { public static Test suite() { - return new AllTestsMongoDB().getTestSuite("CDO Tests (DBStore H2 Horizontal)"); + return new AllTestsMongoDB().getTestSuite("CDO Tests (MongoDB)"); } @Override protected void initConfigSuites(TestSuite parent) { addScenario(parent, COMBINED, MongoDBStoreRepositoryConfig.INSTANCE, JVM, NATIVE); + addScenario(parent, COMBINED, MongoDBStoreRepositoryConfig.AUDITING, JVM, NATIVE); + addScenario(parent, COMBINED, MongoDBStoreRepositoryConfig.BRANCHING, JVM, NATIVE); } @Override @@ -49,31 +44,5 @@ public class AllTestsMongoDB extends AllConfigs testClasses.add(MongoDBInitialTest.class); super.initTestClasses(testClasses); testClasses.remove(MEMStoreQueryTest.class); - - if (!hasBranchingSupport()) - { - testClasses.remove(BranchingTest.class); - testClasses.remove(BranchingSameSessionTest.class); - testClasses.remove(MergingTest.class); - testClasses.remove(Bugzilla_303807_Test.class); - } - - if (!hasAuditSupport()) - { - // non-audit mode - remove audit tests - testClasses.remove(AuditTest.class); - testClasses.remove(AuditSameSessionTest.class); - testClasses.remove(Bugzilla_252214_Test.class); - } - } - - protected boolean hasAuditSupport() - { - return false; - } - - protected boolean hasBranchingSupport() - { - return false; } } diff --git a/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/MongoDBStoreRepositoryConfig.java b/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/MongoDBStoreRepositoryConfig.java index 24ea5972a2..9849b13ccf 100644 --- a/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/MongoDBStoreRepositoryConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/MongoDBStoreRepositoryConfig.java @@ -31,15 +31,25 @@ import java.util.Map; */ public class MongoDBStoreRepositoryConfig extends RepositoryConfig { - public static final MongoDBStoreRepositoryConfig INSTANCE = new MongoDBStoreRepositoryConfig(); + public static final MongoDBStoreRepositoryConfig INSTANCE = new MongoDBStoreRepositoryConfig(false, false); + + public static final MongoDBStoreRepositoryConfig AUDITING = new MongoDBStoreRepositoryConfig(true, false); + + public static final MongoDBStoreRepositoryConfig BRANCHING = new MongoDBStoreRepositoryConfig(true, true); private static final long serialVersionUID = 1L; + private boolean auditing; + + private boolean branching; + private transient CDOServerBrowser mongoBrowser; - public MongoDBStoreRepositoryConfig() + public MongoDBStoreRepositoryConfig(boolean auditing, boolean branching) { - super("MongoDBStore"); + super("MongoDBStore" + (branching ? " (branching)" : auditing ? " (auditing)" : "")); + this.auditing = auditing; + this.branching = branching; } @Override @@ -103,7 +113,7 @@ public class MongoDBStoreRepositoryConfig extends RepositoryConfig protected void initRepositoryProperties(Map<String, String> props) { super.initRepositoryProperties(props); - props.put(IRepository.Props.SUPPORTING_AUDITS, "false"); - props.put(IRepository.Props.SUPPORTING_BRANCHES, "false"); + props.put(IRepository.Props.SUPPORTING_AUDITS, Boolean.toString(auditing)); + props.put(IRepository.Props.SUPPORTING_BRANCHES, Boolean.toString(branching)); } } |