summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-17 01:41:49 (EDT)
committerEike Stepper2007-07-17 01:41:49 (EDT)
commit8cafaf357477ef020616cacfad7a307cb6409f5b (patch)
treebab403d394d59f479f8bc35fd0b2ca7f9574a802
parentda84b52b77ba86b2eb6205501f8150903ffd01c7 (diff)
downloadcdo-8cafaf357477ef020616cacfad7a307cb6409f5b.zip
cdo-8cafaf357477ef020616cacfad7a307cb6409f5b.tar.gz
cdo-8cafaf357477ef020616cacfad7a307cb6409f5b.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOFactory.java20
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOPackageRegistry.java20
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOFactoryImpl.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOFactoryImpl.java)6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java14
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java22
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java20
9 files changed, 88 insertions, 30 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
index 6e5c6ad..6a7b290 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo;
import org.eclipse.emf.cdo.protocol.model.CDOPackageManager;
+import org.eclipse.emf.cdo.util.CDOPackageRegistry;
import org.eclipse.net4j.IChannel;
import org.eclipse.net4j.util.container.IContainer;
@@ -32,6 +33,8 @@ public interface CDOSession extends IContainer<CDOView>
public String getRepositoryUUID();
+ public CDOPackageRegistry getPackageRegistry();
+
public CDOPackageManager getPackageManager();
public CDORevisionManager getRevisionManager();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOFactory.java
new file mode 100644
index 0000000..1ae11f2
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOFactory.java
@@ -0,0 +1,20 @@
+/***************************************************************************
+ * 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.emf.cdo.util;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * @author Eike Stepper
+ */
+public interface CDOFactory extends EFactory
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOPackageRegistry.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOPackageRegistry.java
new file mode 100644
index 0000000..c051a43
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOPackageRegistry.java
@@ -0,0 +1,20 @@
+/***************************************************************************
+ * 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.emf.cdo.util;
+
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * @author Eike Stepper
+ */
+public interface CDOPackageRegistry extends EPackage.Registry
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
index 7069515..c0129c2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
@@ -29,12 +29,15 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EFactory;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.Resource.Factory.Registry;
import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.internal.cdo.CDOFactoryImpl;
import org.eclipse.emf.internal.cdo.CDOSessionImpl;
import org.eclipse.emf.internal.cdo.util.EMFUtil;
@@ -159,7 +162,11 @@ public final class CDOUtil
public static void prepareEPackage(EPackage ePackage)
{
- ePackage.setEFactoryInstance(new CDOFactoryImpl(ePackage));
+ EFactory factory = ePackage.getEFactoryInstance();
+ if (factory == null || factory.getClass() == EFactoryImpl.class)
+ {
+ ePackage.setEFactoryInstance(new CDOFactoryImpl(ePackage));
+ }
}
public static EPackage createEPackage(String name, String nsPrefix, String nsURI)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOFactoryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOFactoryImpl.java
index b06f5e2..8b5be87 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOFactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOFactoryImpl.java
@@ -8,7 +8,9 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.cdo.util;
+package org.eclipse.emf.internal.cdo;
+
+import org.eclipse.emf.cdo.util.CDOFactory;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
@@ -16,7 +18,7 @@ import org.eclipse.emf.ecore.impl.EFactoryImpl;
/**
* @author Eike Stepper
*/
-public class CDOFactoryImpl extends EFactoryImpl
+public class CDOFactoryImpl extends EFactoryImpl implements CDOFactory
{
public CDOFactoryImpl(EPackage ePackage)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
index 18de3d6..fef6dfc 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
@@ -10,13 +10,15 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo;
+import org.eclipse.emf.cdo.util.CDOPackageRegistry;
+
import org.eclipse.emf.ecore.EPackage.Registry;
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
/**
* @author Eike Stepper
*/
-public class CDOPackageRegistryImpl extends EPackageRegistryImpl
+public class CDOPackageRegistryImpl extends EPackageRegistryImpl implements CDOPackageRegistry
{
private static final long serialVersionUID = 1L;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
index 132b7ae..0c79fa4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.CDOSessionInvalidationEvent;
import org.eclipse.emf.cdo.CDOSessionViewsEvent;
import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.util.CDOPackageRegistry;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.net4j.ConnectorException;
@@ -65,7 +66,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
private Set<String> packageURIs;
- private EPackage.Registry ePackageRegistry;
+ private CDOPackageRegistryImpl packageRegistry;
private CDOSessionPackageManager packageManager;
@@ -90,11 +91,8 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
{
ePackageRegistry = EPackage.Registry.INSTANCE;
}
- else
- {
- this.ePackageRegistry = ePackageRegistry;
- }
+ this.packageRegistry = new CDOPackageRegistryImpl(ePackageRegistry);
packageManager = new CDOSessionPackageManager(this);
revisionManager = new CDORevisionManagerImpl(this);
}
@@ -162,9 +160,9 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
deactivate();
}
- public EPackage.Registry getEPackageRegistry()
+ public CDOPackageRegistry getPackageRegistry()
{
- return ePackageRegistry;
+ return packageRegistry;
}
public CDOSessionPackageManager getPackageManager()
@@ -322,7 +320,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
throw new IllegalStateException("CDO view already open: " + view);
}
- resourceSet.setPackageRegistry(new EPackageRegistryImpl(ePackageRegistry));
+ resourceSet.setPackageRegistry(new EPackageRegistryImpl(packageRegistry));
CDOUtil.addResourceFactory(resourceSet);
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java
index cfcdb79..a5af3b8 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java
@@ -28,7 +28,7 @@ public abstract class AbstractOMTest extends TestCase
}
@Override
- protected void setUp() throws Exception
+ public final void setUp() throws Exception
{
super.setUp();
System.out.println("************************************************");
@@ -39,12 +39,20 @@ public abstract class AbstractOMTest extends TestCase
OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
OMPlatform.INSTANCE.setDebugging(true);
enableConsole();
+
+ doSetUp();
+ System.out.println();
+ System.out.println("------------------------ START ------------------------");
}
@Override
- protected void tearDown() throws Exception
+ public final void tearDown() throws Exception
{
- Thread.sleep(20);
+ Thread.sleep(200);
+ System.out.println("------------------------ END --------------------------");
+ System.out.println();
+
+ doTearDown();
super.tearDown();
System.out.println();
System.out.println();
@@ -82,4 +90,12 @@ public abstract class AbstractOMTest extends TestCase
System.out.println("--> " + m);
}
}
+
+ protected void doSetUp() throws Exception
+ {
+ }
+
+ protected void doTearDown() throws Exception
+ {
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java
index dd33863..0f28a3a 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java
@@ -35,37 +35,27 @@ public abstract class AbstractTransportTest extends AbstractOMTest
private Connector connector;
@Override
- protected void setUp() throws Exception
+ protected void doSetUp() throws Exception
{
- super.setUp();
+ super.doSetUp();
container = createContainer();
LifecycleUtil.activate(container);
-
- System.out.println();
- System.out.println("---------------- START ----------------");
}
@Override
- protected void tearDown() throws Exception
+ protected void doTearDown() throws Exception
{
- Thread.sleep(200);
- System.out.println();
- System.out.println("---------------- END ------------------");
-
try
{
+ Thread.sleep(20);
LifecycleUtil.deactivate(container);
}
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
finally
{
connector = null;
acceptor = null;
container = null;
- super.tearDown();
+ super.doTearDown();
}
}