Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-08-24 08:27:05 -0400
committerEike Stepper2006-08-24 08:27:05 -0400
commit443479f08331c8c6b25bf22b37e58da467ee1d12 (patch)
treea0e0abe1e4fe708c2dde8d9f928ff4f5aee3ab99 /plugins/org.eclipse.emf.cdo.tests/src
parent064885cb1f15f99fd04ccd1b83f3cca7da30d318 (diff)
downloadcdo-443479f08331c8c6b25bf22b37e58da467ee1d12.tar.gz
cdo-443479f08331c8c6b25bf22b37e58da467ee1d12.tar.xz
cdo-443479f08331c8c6b25bf22b37e58da467ee1d12.zip
[154981] Embedded transport does not work
https://bugs.eclipse.org/bugs/show_bug.cgi?id=154981
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AdapterTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllModel1EmbeddedTests.java35
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientSeparatedServerTopology.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientServerTopology.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientTopology.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/EmbeddedTopology.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopology.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopologyConstants.java32
9 files changed, 121 insertions, 18 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AdapterTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AdapterTest.java
index 249375d68e..7900b70f82 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AdapterTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AdapterTest.java
@@ -22,6 +22,8 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.net4j.util.PropertiesHelper;
+
import testmodel1.TreeNode;
import java.util.Iterator;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllModel1EmbeddedTests.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllModel1EmbeddedTests.java
new file mode 100644
index 0000000000..ea60db634e
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllModel1EmbeddedTests.java
@@ -0,0 +1,35 @@
+/***************************************************************************
+ * Copyright (c) 2004, 2005, 2006 Eike Stepper, Fuggerstr. 39, 10777 Berlin, Germany.
+ * 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.model1;
+
+
+import org.eclipse.emf.cdo.tests.topology.ITopologyConstants;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+public class AllModel1EmbeddedTests implements ITopologyConstants
+{
+ public static Test suite()
+ {
+ System.setProperty(CDO_TEST_MODE_KEY, EMBEDDED_MODE);
+ TestSuite suite = new TestSuite("Embedded Test for org.eclipse.emf.cdo.tests.model1");
+ suite.addTestSuite(BasicTest.class);
+ suite.addTestSuite(AdapterTest.class);
+ suite.addTestSuite(SerializationTest.class);
+ suite.addTestSuite(NotificationTest.class);
+ suite.addTestSuite(ExtentTest.class);
+ suite.addTestSuite(OCLTest.class);
+ suite.addTestSuite(Bugzilla154389Test.class);
+ return suite;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java
index b77c48952a..42e8b2e28d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java
@@ -29,18 +29,8 @@ import javax.sql.DataSource;
import junit.framework.TestCase;
-public abstract class AbstractTopologyTest extends TestCase
+public abstract class AbstractTopologyTest extends TestCase implements ITopologyConstants
{
- 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";
-
- public static final String CLIENT_MODE = "client";
-
- public static final String EMBEDDED_MODE = "embedded";
-
private ITopology topology;
@Override
@@ -52,6 +42,7 @@ public abstract class AbstractTopologyTest extends TestCase
super.setUp();
topology = createTopology();
+ System.out.println("Topology: " + topology.getName());
topology.start();
}
@@ -68,6 +59,9 @@ public abstract class AbstractTopologyTest extends TestCase
System.out.println("TC_END " + getName());
System.out.println("=========================================================================");
System.out.println();
+ System.out.println();
+ System.out.println();
+ System.out.println();
}
protected void wipeDatabase(JdbcTemplate jdbc)
@@ -150,32 +144,33 @@ public abstract class AbstractTopologyTest extends TestCase
protected ITopology createTopology()
{
String mode = getMode();
- if (EMBEDDED_MODE.equals(mode))
+ if (EMBEDDED_MODE.equalsIgnoreCase(mode))
{
return new EmbeddedTopology();
}
- if (CLIENT_MODE.equals(mode))
+ if (CLIENT_MODE.equalsIgnoreCase(mode))
{
return new ClientTopology();
}
- if (CLIENT_SERVER_MODE.equals(mode))
+ if (CLIENT_SERVER_MODE.equalsIgnoreCase(mode))
{
return new ClientServerTopology();
}
- if (CLIENT_SEPARATED_SERVER_MODE.equals(mode))
+ if (CLIENT_SEPARATED_SERVER_MODE.equalsIgnoreCase(mode))
{
return new ClientSeparatedServerTopology();
}
- return null;
+ fail("Topology not recognized: " + mode);
+ return null; // Make compiler happy
}
protected String getMode()
{
- return System.getProperty(CDO_TEST_MODE_KEY, EMBEDDED_MODE).toLowerCase();
+ return System.getProperty(CDO_TEST_MODE_KEY, EMBEDDED_MODE);
}
protected void assertTrue(Object object)
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientSeparatedServerTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientSeparatedServerTopology.java
index fc6146e0aa..7b6364c6f8 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientSeparatedServerTopology.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientSeparatedServerTopology.java
@@ -35,6 +35,11 @@ public class ClientSeparatedServerTopology extends AbstractTopology
{
}
+ public String getName()
+ {
+ return ITopologyConstants.CLIENT_SEPARATED_SERVER_MODE;
+ }
+
public void start() throws Exception
{
super.start();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientServerTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientServerTopology.java
index d71aef99f4..2ff1808816 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientServerTopology.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientServerTopology.java
@@ -33,6 +33,11 @@ public class ClientServerTopology extends AbstractTopology
{
}
+ public String getName()
+ {
+ return ITopologyConstants.CLIENT_SERVER_MODE;
+ }
+
public void start() throws Exception
{
super.start();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientTopology.java
index 3aad3b7228..4648b979eb 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientTopology.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientTopology.java
@@ -26,6 +26,11 @@ public class ClientTopology extends AbstractTopology
{
}
+ public String getName()
+ {
+ return ITopologyConstants.CLIENT_MODE;
+ }
+
public void start() throws Exception
{
super.start();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/EmbeddedTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/EmbeddedTopology.java
index 6b6b2eb048..8268d50cc3 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/EmbeddedTopology.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/EmbeddedTopology.java
@@ -11,25 +11,47 @@
package org.eclipse.emf.cdo.tests.topology;
+import org.eclipse.net4j.spring.Container;
+
import javax.sql.DataSource;
public class EmbeddedTopology extends AbstractTopology
{
+ private Container net4j;
+
+ private Container cdoServer;
+
+ private Container net4jEmbedded;
+
public EmbeddedTopology()
{
}
+ public String getName()
+ {
+ return ITopologyConstants.EMBEDDED_MODE;
+ }
+
public void start() throws Exception
{
+ super.start();
+ net4j = createContainer("net4j", NET4J_LOCATION, null);
+ net4jEmbedded = createContainer("embedded", NET4J_EMBEDDED_LOCATION, net4j);
+ cdoServer = createContainer("cdo-server", CDO_SERVER_LOCATION, net4jEmbedded);
+ createCDOClient("cdo-client", net4jEmbedded);
}
public void stop() throws Exception
{
+ super.stop();
+ cdoServer.stop();
+ net4jEmbedded.stop();
+ net4j.stop();
}
public DataSource getDataSource()
{
- return null;
+ return (DataSource) cdoServer.getBean("dataSource");
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopology.java
index 99a30b2867..84ec2c13aa 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopology.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopology.java
@@ -20,6 +20,8 @@ import javax.sql.DataSource;
public interface ITopology
{
+ public String getName();
+
public void start() throws Exception;
public void stop() throws Exception;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopologyConstants.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopologyConstants.java
new file mode 100644
index 0000000000..b5e817489c
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopologyConstants.java
@@ -0,0 +1,32 @@
+/***************************************************************************
+ * Copyright (c) 2004, 2005, 2006 Eike Stepper, Fuggerstr. 39, 10777 Berlin, Germany.
+ * 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.topology;
+
+
+public interface ITopologyConstants
+{
+ 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";
+
+ public static final String CLIENT_MODE = "Client";
+
+ public static final String EMBEDDED_MODE = "Embedded";
+
+ public static final String[] ALL_MODES = { //
+ CLIENT_SEPARATED_SERVER_MODE, // 0
+ CLIENT_SERVER_MODE, // 1
+ CLIENT_MODE, // 2
+ EMBEDDED_MODE // 3
+ };
+}

Back to the top