Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-02-17 07:45:31 +0000
committerEike Stepper2011-02-17 07:45:31 +0000
commit64fe8e0918c52f66279ab34ccd0cf8a26773c899 (patch)
tree359d08b01f6647bbeb1d650ec3eab8ba5013ae24 /plugins/org.eclipse.emf.cdo.tests.mongodb
parente080f01452962b9214fd8ada08c02a95138dec63 (diff)
downloadcdo-64fe8e0918c52f66279ab34ccd0cf8a26773c899.tar.gz
cdo-64fe8e0918c52f66279ab34ccd0cf8a26773c899.tar.xz
cdo-64fe8e0918c52f66279ab34ccd0cf8a26773c899.zip
[337152] [Mongo] Create a MongoDBStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337152
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.mongodb')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/InitialTestMongoDB.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/InitialTestMongoDB.java b/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/InitialTestMongoDB.java
new file mode 100644
index 0000000000..ba22af454a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.mongodb/src/org/eclipse/emf/cdo/tests/mongodb/InitialTestMongoDB.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, 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.mongodb;
+
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.tests.config.IScenario;
+import org.eclipse.emf.cdo.tests.config.impl.ContainerConfig;
+import org.eclipse.emf.cdo.tests.config.impl.ModelConfig;
+import org.eclipse.emf.cdo.tests.config.impl.Scenario;
+import org.eclipse.emf.cdo.tests.config.impl.SessionConfig.Net4j;
+import org.eclipse.emf.cdo.tests.model1.Supplier;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+
+/**
+ * @author Eike Stepper
+ */
+public class InitialTestMongoDB extends AbstractCDOTest
+{
+ public void testGetResource() throws Exception
+ {
+ Supplier supplier = getModel1Factory().createSupplier();
+ supplier.setName("Stepper");
+
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
+ resource.getContents().add(supplier);
+ transaction.commit();
+
+ sleep(1000000L);
+ }
+
+ @Override
+ protected IScenario getDefaultScenario()
+ {
+ Scenario scenario = new Scenario();
+ scenario.setContainerConfig(ContainerConfig.Combined.INSTANCE);
+ scenario.setRepositoryConfig(MongoDBStoreRepositoryConfig.INSTANCE);
+ scenario.setSessionConfig(Net4j.JVM.INSTANCE);
+ scenario.setModelConfig(ModelConfig.Native.INSTANCE);
+ return scenario;
+ }
+}

Back to the top