summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-08-12 02:56:51 (EDT)
committerEike Stepper2006-08-12 02:56:51 (EDT)
commit4a53d8d4bbe17736db2ea27961a367002f7c4f97 (patch)
tree3344dda29f3acc0a575f1f651f85f1bb9fe2e503
parent4e5b0cb838947251e33d37f609245e42de96a976 (diff)
downloadcdo-4a53d8d4bbe17736db2ea27961a367002f7c4f97.zip
cdo-4a53d8d4bbe17736db2ea27961a367002f7c4f97.tar.gz
cdo-4a53d8d4bbe17736db2ea27961a367002f7c4f97.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/launches/BasicTest.launch8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractTopology.java91
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractTopologyTest.java168
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientSeparatedServerTopology.java77
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientServerTopology.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientTopology.java35
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EmbeddedTopology.java35
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ITopology.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/Model1Test.java64
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/testmodel1/AbstractModel1Test.java (renamed from plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractModel1Test.java)4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/testmodel1/BasicTest.java (renamed from plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BasicTest.java)2
11 files changed, 8 insertions, 580 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/launches/BasicTest.launch b/plugins/org.eclipse.emf.cdo.tests/launches/BasicTest.launch
index 5f52608..3d96555 100644
--- a/plugins/org.eclipse.emf.cdo.tests/launches/BasicTest.launch
+++ b/plugins/org.eclipse.emf.cdo.tests/launches/BasicTest.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="location" value="${workspace_loc}/../junit-workspace"/>
<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="location" value="${workspace_loc}/../junit-workspace"/>
<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
<booleanAttribute key="clearws" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.BasicTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.testmodel1.BasicTest"/>
<stringAttribute key="pde.version" value="3.2a"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcdo.test.mode=client-separated-server"/>
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcdo.test.mode=client-separated-server"/>
<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/AbstractTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractTopology.java
deleted file mode 100644
index a164f47..0000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractTopology.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/***************************************************************************
- * 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;
-
-
-import org.eclipse.emf.cdo.client.ResourceManager;
-
-import org.eclipse.emf.ecore.resource.ResourceSet;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.net4j.spring.Container;
-import org.eclipse.net4j.spring.impl.ContainerImpl;
-
-import org.osgi.framework.Bundle;
-
-import java.net.URL;
-
-
-public abstract class AbstractTopology implements ITopology
-{
- protected static final String NET4J_LOCATION = "META-INF/net4j/net4j.xml";
-
- protected static final String NET4J_CLIENT_LOCATION = "META-INF/net4j/client/net4j-client.xml";
-
- protected static final String NET4J_SERVER_LOCATION = "META-INF/net4j/server/net4j-server.xml";
-
- protected static final String NET4J_EMBEDDED_LOCATION = "META-INF/net4j/embedded/net4j-embedded.xml";
-
- protected static final String CDO_CLIENT_LOCATION = "META-INF/cdo/client/cdo-client.xml";
-
- protected static final String CDO_SERVER_LOCATION = "META-INF/cdo/server/cdo-server.xml";
-
- private String bundleLocation;
-
- private Container cdoClient;
-
- protected AbstractTopology()
- {
- }
-
- public void start() throws Exception
- {
- CDOTestPlugin plugin = CDOTestPlugin.getPlugin();
- Bundle bundle = plugin.getBundle();
- URL url = bundle.getEntry("/");
- bundleLocation = FileLocator.toFileURL(url).getFile();
- }
-
- public void stop() throws Exception
- {
- cdoClient.stop();
- cdoClient = null;
- }
-
- public ResourceManager createResourceManager(ResourceSet resourceSet)
- {
- ResourceManager resourceManager = (ResourceManager) cdoClient.getBean("resourceManager");
- resourceManager.setResourceSet(resourceSet);
-
- try
- {
- resourceManager.start();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- return null;
- }
-
- return resourceManager;
- }
-
- protected void createCDOClient(String name, Container parent)
- {
- cdoClient = createContainer(name, CDO_CLIENT_LOCATION, parent);
- }
-
- protected ContainerImpl createContainer(String name, String location, Container parent)
- {
- return new ContainerImpl(bundleLocation, location, name, parent, CDOTestPlugin.class
- .getClassLoader());
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractTopologyTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractTopologyTest.java
deleted file mode 100644
index 0347222..0000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractTopologyTest.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/***************************************************************************
- * 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;
-
-
-import org.eclipse.emf.cdo.client.CDOResource;
-import org.eclipse.emf.cdo.client.ResourceManager;
-import org.eclipse.emf.cdo.client.impl.CDOResourceFactoryImpl;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-
-import org.springframework.jdbc.core.JdbcTemplate;
-
-import java.io.IOException;
-
-import javax.sql.DataSource;
-
-import junit.framework.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";
-
- public static final String CLIENT_MODE = "client";
-
- public static final String EMBEDDED_MODE = "embedded";
-
- private ITopology topology;
-
- @Override
- protected void setUp() throws Exception
- {
- System.out.println("=========================================================================");
- System.out.println("TC_START " + getName());
- System.out.println("=========================================================================");
-
- super.setUp();
- topology = createTopology();
- topology.start();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- JdbcTemplate jdbc = getJdbcTemplate();
- wipeDatabase(jdbc);
-
- topology.stop();
- super.tearDown();
-
- System.out.println("=========================================================================");
- System.out.println("TC_END " + getName());
- System.out.println("=========================================================================");
- System.out.println();
- }
-
- protected void wipeDatabase(JdbcTemplate jdbc)
- {
- jdbc.execute("DROP TABLE CDO_ATTRIBUTE");
- jdbc.execute("DROP TABLE CDO_CLASS");
- jdbc.execute("DROP TABLE CDO_CONTENT");
- jdbc.execute("DROP TABLE CDO_OBJECT");
- jdbc.execute("DROP TABLE CDO_PACKAGE");
- jdbc.execute("DROP TABLE CDO_REFERENCE");
- jdbc.execute("DROP TABLE CDO_RESOURCE");
- }
-
- protected ITopology getTopology()
- {
- return topology;
- }
-
- protected DataSource getDataSource()
- {
- return topology.getDataSource();
- }
-
- protected JdbcTemplate getJdbcTemplate()
- {
- return new JdbcTemplate(getDataSource());
- }
-
- protected ResourceManager createResourceManager(ResourceSet resourceSet)
- {
- 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 = CDOResourceFactoryImpl.formatURI(path);
- return (CDOResource) resourceManager.createResource(uri);
- }
-
- protected CDOResource getResource(String path)
- {
- ResourceManager resourceManager = createResourceManager();
- URI uri = CDOResourceFactoryImpl.formatURI(path);
- return (CDOResource) resourceManager.getResource(uri, true);
- }
-
- protected EObject loadRoot(String path) throws IOException
- {
- CDOResource resource = getResource(path);
- return (EObject) resource.getContents().get(0);
- }
-
- protected CDOResource saveRoot(EObject root, String path) throws IOException
- {
- CDOResource resource = createResource(path);
- resource.getContents().add(root);
- resource.save(null);
- return resource;
- }
-
- protected ITopology createTopology()
- {
- String mode = getMode();
- if (EMBEDDED_MODE.equals(mode))
- {
- return new EmbeddedTopology();
- }
-
- if (CLIENT_MODE.equals(mode))
- {
- return new ClientTopology();
- }
-
- if (CLIENT_SERVER_MODE.equals(mode))
- {
- return new ClientServerTopology();
- }
-
- if (CLIENT_SEPARATED_SERVER_MODE.equals(mode))
- {
- return new ClientSeparatedServerTopology();
- }
-
- return null;
- }
-
- protected String getMode()
- {
- 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/ClientSeparatedServerTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientSeparatedServerTopology.java
deleted file mode 100644
index 2c3669c..0000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientSeparatedServerTopology.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/***************************************************************************
- * 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;
-
-
-import org.eclipse.net4j.core.Acceptor;
-import org.eclipse.net4j.spring.Container;
-
-import javax.sql.DataSource;
-
-
-public class ClientSeparatedServerTopology extends AbstractTopology
-{
- private Container serverNet4j;
-
- private Container net4jServer;
-
- private Container cdoServer;
-
- private Container clientNet4j;
-
- private Container net4jClient;
-
- private Acceptor acceptor;
-
- public ClientSeparatedServerTopology()
- {
- }
-
- public void start() throws Exception
- {
- super.start();
-
- // Start server
- serverNet4j = createContainer("server", NET4J_LOCATION, null);
- net4jServer = createContainer("socket", NET4J_SERVER_LOCATION, serverNet4j);
- cdoServer = createContainer("cdo", CDO_SERVER_LOCATION, net4jServer);
-
- acceptor = (Acceptor) cdoServer.getBean("acceptor", Acceptor.class);
- acceptor.start();
-
- // Start client
- clientNet4j = createContainer("client", NET4J_LOCATION, null);
- net4jClient = createContainer("socket", NET4J_CLIENT_LOCATION, clientNet4j);
- createCDOClient("cdo", net4jClient);
- }
-
- public void stop() throws Exception
- {
- super.stop();
-
- //Stop client
- net4jClient.stop();
- clientNet4j.stop();
-
- //Stop server
- acceptor.stop();
- acceptor = null;
-
- cdoServer.stop();
- net4jServer.stop();
- serverNet4j.stop();
- }
-
- public DataSource getDataSource()
- {
- return (DataSource) cdoServer.getBean("dataSource");
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientServerTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientServerTopology.java
deleted file mode 100644
index 1259e18..0000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientServerTopology.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/***************************************************************************
- * 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;
-
-
-import org.eclipse.net4j.core.Acceptor;
-import org.eclipse.net4j.spring.Container;
-
-import javax.sql.DataSource;
-
-
-public class ClientServerTopology extends AbstractTopology
-{
- private Container net4j;
-
- private Container net4jServer;
-
- private Container cdoServer;
-
- private Container net4jClient;
-
- private Acceptor acceptor;
-
- public ClientServerTopology()
- {
- }
-
- public void start() throws Exception
- {
- super.start();
- net4j = createContainer("net4j", NET4J_LOCATION, null);
-
- // Start server
- net4jServer = createContainer("server", NET4J_SERVER_LOCATION, net4j);
- cdoServer = createContainer("cdo", CDO_SERVER_LOCATION, net4jServer);
-
- acceptor = (Acceptor) cdoServer.getBean("acceptor", Acceptor.class);
- acceptor.start();
-
- // Start client
- net4jClient = createContainer("client", NET4J_CLIENT_LOCATION, net4j);
- createCDOClient("cdo", net4jClient);
- }
-
- public void stop() throws Exception
- {
- super.stop();
-
- //Stop client
- net4jClient.stop();
-
- //Stop server
- acceptor.stop();
- acceptor = null;
-
- cdoServer.stop();
- net4jServer.stop();
-
- net4j.stop();
- }
-
- public DataSource getDataSource()
- {
- return (DataSource) cdoServer.getBean("dataSource");
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientTopology.java
deleted file mode 100644
index a14f18e..0000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ClientTopology.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************
- * 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;
-
-
-import javax.sql.DataSource;
-
-
-public class ClientTopology extends AbstractTopology
-{
- public ClientTopology()
- {
- }
-
- public void start() throws Exception
- {
- }
-
- public void stop() throws Exception
- {
- }
-
- public DataSource getDataSource()
- {
- return null;
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EmbeddedTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EmbeddedTopology.java
deleted file mode 100644
index d240c03..0000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EmbeddedTopology.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************
- * 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;
-
-
-import javax.sql.DataSource;
-
-
-public class EmbeddedTopology extends AbstractTopology
-{
- public EmbeddedTopology()
- {
- }
-
- public void start() throws Exception
- {
- }
-
- public void stop() throws Exception
- {
- }
-
- public DataSource getDataSource()
- {
- return null;
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ITopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ITopology.java
deleted file mode 100644
index 9104bd5..0000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ITopology.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/***************************************************************************
- * 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;
-
-
-import org.eclipse.emf.cdo.client.ResourceManager;
-
-import org.eclipse.emf.ecore.resource.ResourceSet;
-
-import javax.sql.DataSource;
-
-
-public interface ITopology
-{
- public void start() throws Exception;
-
- public void stop() throws Exception;
-
- public ResourceManager createResourceManager(ResourceSet resourceSet);
-
- public DataSource getDataSource();
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/Model1Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/Model1Test.java
deleted file mode 100644
index 9493eeb..0000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/Model1Test.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/***************************************************************************
- * 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;
-
-
-import org.eclipse.emf.common.util.EList;
-
-import testmodel1.TestModel1Factory;
-import testmodel1.TreeNode;
-
-import java.util.Arrays;
-
-
-public class Model1Test extends AbstractTopologyTest
-{
- protected static final String PATH1 = "/test/res1";
-
- public void testSimple() throws Exception
- {
- TreeNode node = createNode("root");
- createNode("node1", node);
- createNode("node2", node);
- createNode("node3", node);
- saveRoot(node, PATH1);
-
- TreeNode root = (TreeNode) loadRoot(PATH1);
- assertNotNull(root);
- assertEquals("root", root.getStringFeature());
-
- EList children = root.getChildren();
- assertEquals(3, children.size());
- assertEquals("node1", ((TreeNode) children.get(0)).getStringFeature());
- assertEquals("node2", ((TreeNode) children.get(1)).getStringFeature());
- assertEquals("node3", ((TreeNode) children.get(2)).getStringFeature());
- }
-
- protected TreeNode createNode(String name)
- {
- return createNode(name, null);
- }
-
- protected TreeNode createNode(String name, TreeNode parent)
- {
- TreeNode node = TestModel1Factory.eINSTANCE.createTreeNode();
- node.setStringFeature(name);
- node.setParent(parent);
- return node;
- }
-
- protected TreeNode createNode(String name, TreeNode parent, TreeNode[] references)
- {
- TreeNode node = createNode(name, parent);
- node.getReferences().add(Arrays.asList(references));
- return node;
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractModel1Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/testmodel1/AbstractModel1Test.java
index 1a3f56c..1f3dcb3 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractModel1Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/testmodel1/AbstractModel1Test.java
@@ -8,9 +8,11 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.cdo.tests;
+package org.eclipse.emf.cdo.tests.testmodel1;
+import org.eclipse.emf.cdo.tests.topology.AbstractTopologyTest;
+
import org.eclipse.emf.common.util.EList;
import org.springframework.jdbc.core.JdbcTemplate;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BasicTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/testmodel1/BasicTest.java
index 9e5e7af..88d163d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BasicTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/testmodel1/BasicTest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.cdo.tests;
+package org.eclipse.emf.cdo.tests.testmodel1;
import org.eclipse.emf.common.util.EList;