Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-02-21 11:41:57 +0000
committerEike Stepper2011-02-21 11:41:57 +0000
commit7361e5311262c26f41a323a2825d20c40fe9b614 (patch)
treeef46344139ff56aa50395c37fc2331fbab192278 /plugins
parent1f5e6793b74b8265fad95fa5bf7d0dda09fe100d (diff)
downloadcdo-7361e5311262c26f41a323a2825d20c40fe9b614.tar.gz
cdo-7361e5311262c26f41a323a2825d20c40fe9b614.tar.xz
cdo-7361e5311262c26f41a323a2825d20c40fe9b614.zip
[337152] [Mongo] Create a MongoDBStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337152
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PartialCommitTest.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_316444_Test.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_320690_Test.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java16
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java16
6 files changed, 50 insertions, 30 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
index 6211d32199..8236469e61 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
@@ -591,9 +591,15 @@ public class Commits extends Coll
{
long revised = result - 1;
- // TODO Cache REVISIONS_REVISED
+ // try
+ // {
// revision.put(REVISIONS_REVISED, revised);
// collection.save(doc);
+ // }
+ // catch (Exception ex)
+ // {
+ // OM.LOG.warn(ex);
+ // }
return revised;
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PartialCommitTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PartialCommitTest.java
index f09df2b284..2c2ceec8f2 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PartialCommitTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PartialCommitTest.java
@@ -85,15 +85,6 @@ public class PartialCommitTest extends AbstractCDOTest
private MultiNonContainedElement multiNonContainedElement1, multiNonContainedElement2;
@Override
- public void setUp() throws Exception
- {
- super.setUp();
- session = openSession();
- session.options().setPassiveUpdateEnabled(false);
- tx = (InternalCDOTransaction)session.openTransaction();
- }
-
- @Override
public synchronized Map<String, Object> getTestProperties()
{
Map<String, Object> map = super.getTestProperties();
@@ -102,11 +93,21 @@ public class PartialCommitTest extends AbstractCDOTest
}
@Override
- public void tearDown() throws Exception
+ protected void doSetUp() throws Exception
+ {
+ super.doSetUp();
+
+ session = openSession();
+ session.options().setPassiveUpdateEnabled(false);
+ tx = (InternalCDOTransaction)session.openTransaction();
+ }
+
+ @Override
+ protected void doTearDown() throws Exception
{
tx.close();
session.close();
- super.tearDown();
+ super.doTearDown();
}
public void testNewTopLevelResource() throws CommitException
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_316444_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_316444_Test.java
index b3e03448b1..3c5c04a4dd 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_316444_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_316444_Test.java
@@ -59,6 +59,14 @@ public class Bugzilla_316444_Test extends AbstractCDOTest
private List<Exception> exceptions = new ArrayList<Exception>();
@Override
+ public synchronized Map<String, Object> getTestProperties()
+ {
+ Map<String, Object> map = super.getTestProperties();
+ map.put(IRepository.Props.ENSURE_REFERENTIAL_INTEGRITY, "true");
+ return map;
+ }
+
+ @Override
protected void doSetUp() throws Exception
{
createRepository();
@@ -153,14 +161,6 @@ public class Bugzilla_316444_Test extends AbstractCDOTest
map.put(RepositoryConfig.PROP_TEST_REPOSITORY, repository);
}
- @Override
- public synchronized Map<String, Object> getTestProperties()
- {
- Map<String, Object> map = super.getTestProperties();
- map.put(IRepository.Props.ENSURE_REFERENTIAL_INTEGRITY, "true");
- return map;
- }
-
public void testMovingSubtree() throws Exception
{
exceptions.clear();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_320690_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_320690_Test.java
index f0d0ec82b4..b9fbc80af6 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_320690_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_320690_Test.java
@@ -118,7 +118,6 @@ public class Bugzilla_320690_Test extends AbstractCDOTest
public void testDeleteTargetAndReferenceAtOnce() throws Exception
{
skipQueryXRefs();
-
NodeA a = getModel3Factory().createNodeA();
NodeA b = getModel3Factory().createNodeA();
NodeA c = getModel3Factory().createNodeA();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java
index 9746749769..7373c0f3e8 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java
@@ -85,6 +85,14 @@ public class Bugzilla_327604_Test extends AbstractCDOTest
private IStore localStore;
@Override
+ public synchronized Map<String, Object> getTestProperties()
+ {
+ Map<String, Object> map = super.getTestProperties();
+ map.put(IRepository.Props.ENSURE_REFERENTIAL_INTEGRITY, "false");
+ return map;
+ }
+
+ @Override
protected void doSetUp() throws Exception
{
disableConsole();
@@ -126,14 +134,6 @@ public class Bugzilla_327604_Test extends AbstractCDOTest
super.doTearDown();
}
- @Override
- public synchronized Map<String, Object> getTestProperties()
- {
- Map<String, Object> map = super.getTestProperties();
- map.put(IRepository.Props.ENSURE_REFERENTIAL_INTEGRITY, "false");
- return map;
- }
-
public void testReadObjects() throws Exception
{
skipHandleRevisions();
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
index a899f11da6..e8a41888c9 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
@@ -23,6 +23,7 @@ import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.log.FileLogHandler;
import org.eclipse.net4j.util.om.log.OMLogger;
+import org.eclipse.net4j.util.om.log.OMLogger.Level;
import org.eclipse.net4j.util.om.log.PrintLogHandler;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
@@ -61,6 +62,8 @@ public abstract class AbstractOMTest extends TestCase
private static boolean consoleEnabled;
+ private static String testName;
+
private transient List<File> filesToDelete = new ArrayList<File>();
private transient String codeLink;
@@ -74,7 +77,16 @@ public abstract class AbstractOMTest extends TestCase
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
String prefix = AbstractOMTest.class.getName() + "-" + formatter.format(new Date()) + "-";
File logFile = TMPUtil.createTempFile(prefix, ".log");
- OMPlatform.INSTANCE.addLogHandler(new FileLogHandler(logFile, OMLogger.Level.WARN));
+
+ OMPlatform.INSTANCE.addLogHandler(new FileLogHandler(logFile, OMLogger.Level.WARN)
+ {
+ @Override
+ protected void writeLog(OMLogger logger, Level level, String msg, Throwable t) throws Throwable
+ {
+ super.writeLog(logger, level, "--> " + testName + "\n" + msg, t);
+ }
+ });
+
IOUtil.ERR().println("Logging errors and warnings to " + logFile);
IOUtil.ERR().println();
}
@@ -128,7 +140,9 @@ public abstract class AbstractOMTest extends TestCase
@Override
public void setUp() throws Exception
{
+ testName = getClass().getName() + "." + getName() + "()";
codeLink = null;
+
enableConsole();
if (!SUPPRESS_OUTPUT)
{

Back to the top