summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-08-10 00:24:36 (EDT)
committerEike Stepper2006-08-10 00:24:36 (EDT)
commit1c0aca58415cf9fa828fcebfaab7e0b4b1d4b9e2 (patch)
tree995ebd4d171946e964a91f0600f80c842c39cf13
parent0dc0e081796856373a370adf238732e19bb6bbfb (diff)
downloadcdo-1c0aca58415cf9fa828fcebfaab7e0b4b1d4b9e2.zip
cdo-1c0aca58415cf9fa828fcebfaab7e0b4b1d4b9e2.tar.gz
cdo-1c0aca58415cf9fa828fcebfaab7e0b4b1d4b9e2.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/launches/Model1Test.launch (renamed from plugins/org.eclipse.emf.cdo.tests/launches/IntegrationTest.launch)8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractTopologyTest.java (renamed from plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractIntegrationTest.java)34
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/Model1Test.java (renamed from plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/IntegrationTest.java)28
3 files changed, 43 insertions, 27 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/launches/IntegrationTest.launch b/plugins/org.eclipse.emf.cdo.tests/launches/Model1Test.launch
index 00b80d3..b9bbf2a 100644
--- a/plugins/org.eclipse.emf.cdo.tests/launches/IntegrationTest.launch
+++ b/plugins/org.eclipse.emf.cdo.tests/launches/Model1Test.launch
@@ -15,15 +15,15 @@
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<booleanAttribute key="automaticAdd" value="false"/>
<stringAttribute key="checked" value="[NONE]"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.jdbc,org.eclipse.net4j.spring,org.eclipse.net4j.socket,org.eclipse.net4j.core,org.eclipse.net4j.spring.db,org.eclipse.emf.cdo.dbgen,org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.core,org.eclipse.emf.cdo.mapping,org.eclipse.emf.cdo.client,org.eclipse.net4j.util,org.eclipse.emf.cdo.server,org.eclipse.net4j.embedded,org.eclipse.emf.cdo.jdbc.derby,org.eclipse.emf.cdo.dbgen.derby,org.eclipse.emf.cdo.dbgen.oracle,org.eclipse.emf.cdo.jdbc.hsqldb,org.eclipse.emf.cdo.jdbc.mysql,org.eclipse.emf.cdo.dbgen.ansi92,org.eclipse.emf.cdo.dbgen.mysql,org.eclipse.emf.cdo.dbgen.hsqldb"/>
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.jdbc,org.eclipse.net4j.spring,org.eclipse.net4j.socket,org.eclipse.net4j.core,org.eclipse.net4j.spring.db,org.eclipse.emf.cdo.dbgen,org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.core,org.eclipse.emf.cdo.mapping,org.eclipse.emf.cdo.client,org.eclipse.net4j.util,org.eclipse.emf.cdo.server,org.eclipse.net4j.embedded,org.eclipse.emf.cdo.jdbc.derby,org.eclipse.emf.cdo.dbgen.derby,org.eclipse.emf.cdo.dbgen.oracle,org.eclipse.emf.cdo.jdbc.hsqldb,org.eclipse.emf.cdo.jdbc.mysql,org.eclipse.emf.cdo.dbgen.ansi92,org.eclipse.emf.cdo.dbgen.mysql,org.eclipse.emf.cdo.dbgen.hsqldb"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
<booleanAttribute key="clearws" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.IntegrationTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.Model1Test"/>
<stringAttribute key="pde.version" value="3.2a"/>
-<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcdo.test.mode=client-separated-server"/>
+<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
<booleanAttribute key="default" value="false"/>
<booleanAttribute key="clearConfig" value="true"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractIntegrationTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractTopologyTest.java
index 4522eda..7dbb28c 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractIntegrationTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractTopologyTest.java
@@ -11,15 +11,24 @@
package org.eclipse.emf.cdo.tests;
+import org.eclipse.emf.cdo.client.CDOResource;
import org.eclipse.emf.cdo.client.ResourceManager;
+import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import testmodel1.TreeNode;
+
+import java.io.IOException;
import junit.framework.TestCase;
-public class AbstractIntegrationTest extends TestCase
+public abstract class AbstractTopologyTest extends TestCase
{
+ public static final String CDO_TEST_MODE_KEY = "cdo.test.mode";
+
public static final String CLIENT_SEPARATED_SERVER_MODE = "client-separated-server";
public static final String CLIENT_SERVER_MODE = "client-server";
@@ -50,6 +59,27 @@ public class AbstractIntegrationTest extends TestCase
return topology.createResourceManager(resourceSet);
}
+ protected ResourceManager createResourceManager()
+ {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ return topology.createResourceManager(resourceSet);
+ }
+
+ protected CDOResource createResource(String path)
+ {
+ ResourceManager resourceManager = createResourceManager();
+ URI uri = URI.createURI("cdo://" + path);
+ return (CDOResource) resourceManager.createResource(uri);
+ }
+
+ protected CDOResource saveResource(String path, TreeNode root) throws IOException
+ {
+ CDOResource resource = createResource(path);
+ resource.getContents().add(root);
+ resource.save(null);
+ return resource;
+ }
+
protected ITopology createTopology()
{
String mode = getMode();
@@ -78,6 +108,6 @@ public class AbstractIntegrationTest extends TestCase
protected String getMode()
{
- return System.getProperty("cdo.test.mode", EMBEDDED_MODE).toLowerCase();
+ return System.getProperty(CDO_TEST_MODE_KEY, EMBEDDED_MODE).toLowerCase();
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/IntegrationTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/Model1Test.java
index 702294f..85d106d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/IntegrationTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/Model1Test.java
@@ -11,12 +11,6 @@
package org.eclipse.emf.cdo.tests;
-import org.eclipse.emf.cdo.client.CDOResource;
-import org.eclipse.emf.cdo.client.ResourceManager;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import testmodel1.TestModel1Factory;
import testmodel1.TreeNode;
@@ -24,25 +18,17 @@ import testmodel1.TreeNode;
import java.util.Arrays;
-public class IntegrationTest extends AbstractIntegrationTest
+
+public class Model1Test extends AbstractTopologyTest
{
public void testSimple() throws Exception
{
- ResourceSet resourceSet = new ResourceSetImpl();
- ResourceManager resourceManager = createResourceManager(resourceSet);
-
- CDOResource resource = (CDOResource) resourceSet.createResource(URI
- .createURI("cdo:///test/res1"));
-
- TreeNode node0 = createNode("node0", null);
- TreeNode node1 = createNode("node1", node0);
- TreeNode node2 = createNode("node2", node0);
- TreeNode node3 = createNode("node3", node0);
-
- resource.getContents().add(node0);
- resourceManager.commit();
- resourceManager.stop();
+ TreeNode root = createNode("root", null);
+ createNode("node1", root);
+ createNode("node2", root);
+ createNode("node3", root);
+ saveResource("/test/res1", root);
}
protected TreeNode createNode(String name, TreeNode parent)