summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-09-24 07:42:35 (EDT)
committerEike Stepper2007-09-24 07:42:35 (EDT)
commit984aee01d0d5b4ec55df6f10742a1e6c022f1a1d (patch)
treeeceeee55fdb206e59d5dc7cda886e3fb68d37536
parent379cf9fabb3cd7c1c1e5f9beebfeef3671a666b5 (diff)
downloadcdo-984aee01d0d5b4ec55df6f10742a1e6c022f1a1d.zip
cdo-984aee01d0d5b4ec55df6f10742a1e6c022f1a1d.tar.gz
cdo-984aee01d0d5b4ec55df6f10742a1e6c022f1a1d.tar.bz2
[204410] CDO test needs Net4j test dependency
https://bugs.eclipse.org/bugs/show_bug.cgi?id=204410
-rw-r--r--features/org.eclipse.emf.cdo.sdk-feature/feature.xml8
-rw-r--r--features/org.eclipse.net4j.sdk-feature/feature.xml4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java100
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java115
5 files changed, 13 insertions, 215 deletions
diff --git a/features/org.eclipse.emf.cdo.sdk-feature/feature.xml b/features/org.eclipse.emf.cdo.sdk-feature/feature.xml
index 289c690..3295d75 100644
--- a/features/org.eclipse.emf.cdo.sdk-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.sdk-feature/feature.xml
@@ -35,6 +35,10 @@
<update label="%updateSiteName" url="http://download.eclipse.org/modeling/emft/updates/"/>
</url>
+ <requires>
+ <import plugin="org.eclipse.core.runtime" version="3.3.0" match="compatible"/>
+ </requires>
+
<includes
id="org.eclipse.emf.cdo"
version="0.0.0"/>
@@ -52,6 +56,10 @@
version="0.0.0"/>
<includes
+ id="org.eclipse.emf.cdo.tests"
+ version="0.0.0"/>
+
+ <includes
id="org.eclipse.emf.cdo.source"
version="0.0.0"/>
diff --git a/features/org.eclipse.net4j.sdk-feature/feature.xml b/features/org.eclipse.net4j.sdk-feature/feature.xml
index c02a579..3205117 100644
--- a/features/org.eclipse.net4j.sdk-feature/feature.xml
+++ b/features/org.eclipse.net4j.sdk-feature/feature.xml
@@ -60,6 +60,10 @@
version="0.0.0"/>
<includes
+ id="org.eclipse.net4j.tests"
+ version="0.0.0"/>
+
+ <includes
id="org.eclipse.net4j.source"
version="0.0.0"/>
diff --git a/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
index f4b066d..d9a8311 100644
--- a/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
@@ -10,6 +10,7 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
org.eclipse.emf.ecore.xmi;bundle-version="[2.3.0,3.0.0)",
+ org.eclipse.net4j.tests;bundle-version="[0.8.0,0.9.0)",
org.eclipse.net4j.tcp;bundle-version="[0.8.0,0.9.0)",
org.eclipse.emf.cdo.server;bundle-version="[0.8.0,0.9.0)",
org.eclipse.emf.cdo.server.db;bundle-version="[0.8.0,0.9.0)",
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java
deleted file mode 100644
index c965af2..0000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2007 Eike Stepper, 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.net4j.tests;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.internal.util.container.ManagedContainer;
-import org.eclipse.net4j.tcp.TCPUtil;
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.tests.AbstractOMTest;
-
-import org.eclipse.internal.net4j.Acceptor;
-import org.eclipse.internal.net4j.Connector;
-
-/**
- * @author Eike Stepper
- */
-public abstract class AbstractTransportTest extends AbstractOMTest
-{
- protected static final String HOST = "localhost";
-
- protected IManagedContainer container;
-
- private Acceptor acceptor;
-
- private Connector connector;
-
- @Override
- protected void doSetUp() throws Exception
- {
- super.doSetUp();
- container = createContainer();
- LifecycleUtil.activate(container);
- }
-
- @Override
- protected void doTearDown() throws Exception
- {
- try
- {
- Thread.sleep(20);
- LifecycleUtil.deactivate(container);
- }
- finally
- {
- connector = null;
- acceptor = null;
- container = null;
- super.doTearDown();
- }
- }
-
- protected IManagedContainer createContainer()
- {
- IManagedContainer container = new ManagedContainer();
- Net4jUtil.prepareContainer(container);
- TCPUtil.prepareContainer(container);
- return container;
- }
-
- protected Acceptor getAcceptor()
- {
- if (acceptor == null)
- {
- acceptor = (Acceptor)TCPUtil.getAcceptor(container, null);
- }
-
- return acceptor;
- }
-
- protected Connector getConnector()
- {
- if (connector == null)
- {
- connector = (Connector)TCPUtil.getConnector(container, HOST);
- }
-
- return connector;
- }
-
- protected void startTransport() throws Exception
- {
- if (container != null)
- {
- Acceptor acceptor = getAcceptor();
- acceptor.activate();
-
- Connector connector = getConnector();
- connector.activate();
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
deleted file mode 100644
index 260b080..0000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2007 Eike Stepper, 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.net4j.util.tests;
-
-import org.eclipse.net4j.internal.util.om.log.PrintLogHandler;
-import org.eclipse.net4j.internal.util.om.trace.PrintTraceHandler;
-import org.eclipse.net4j.util.om.OMPlatform;
-
-import junit.framework.TestCase;
-
-/**
- * @author Eike Stepper
- */
-public abstract class AbstractOMTest extends TestCase
-{
- private static boolean consoleEnabled;
-
- protected AbstractOMTest()
- {
- }
-
- @Override
- public final void setUp() throws Exception
- {
- super.setUp();
- System.out.println("************************************************");
- System.out.println("START " + getName());
- System.out.println("************************************************");
-
- OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
- OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
- OMPlatform.INSTANCE.setDebugging(true);
- enableConsole();
-
- doSetUp();
- System.out.println();
- System.out.println("------------------------ START ------------------------");
- }
-
- @Override
- public final void tearDown() throws Exception
- {
- Thread.sleep(200);
- System.out.println("------------------------ END --------------------------");
- System.out.println();
-
- doTearDown();
- super.tearDown();
- System.out.println();
- System.out.println();
- }
-
- @Override
- protected void runTest() throws Throwable
- {
- try
- {
- super.runTest();
- }
- catch (Throwable t)
- {
- t.printStackTrace(System.out);
- throw t;
- }
- }
-
- protected void enableConsole()
- {
- if (!consoleEnabled)
- {
- PrintTraceHandler.CONSOLE.setShortContext(true);
- OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
- OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
- OMPlatform.INSTANCE.setDebugging(true);
- consoleEnabled = true;
- }
- }
-
- @SuppressWarnings("unused")
- protected void disableConsole()
- {
- if (consoleEnabled)
- {
- consoleEnabled = false;
- OMPlatform.INSTANCE.setDebugging(false);
- OMPlatform.INSTANCE.removeTraceHandler(PrintTraceHandler.CONSOLE);
- OMPlatform.INSTANCE.removeLogHandler(PrintLogHandler.CONSOLE);
- }
- }
-
- protected void doSetUp() throws Exception
- {
- }
-
- protected void doTearDown() throws Exception
- {
- }
-
- protected static void msg(String m)
- {
- if (consoleEnabled)
- {
- System.out.println();
- System.out.println("--> " + m);
- }
- }
-} \ No newline at end of file