Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-08-20 05:34:24 -0400
committerEike Stepper2006-08-20 05:34:24 -0400
commitf3b24fde9eac46af2b49314ffeac98bedebf1327 (patch)
tree5ee84d34faf98534a24b716b0aa8c30cd824b6b3 /plugins/org.eclipse.emf.cdo.tests/src
parenta7b05434dcd682b3a5f6cba5f1d9589e9ae5168c (diff)
downloadcdo-f3b24fde9eac46af2b49314ffeac98bedebf1327.tar.gz
cdo-f3b24fde9eac46af2b49314ffeac98bedebf1327.tar.xz
cdo-f3b24fde9eac46af2b49314ffeac98bedebf1327.zip
[154389] attributes in super class returned by server, ignored by client
https://bugs.eclipse.org/bugs/show_bug.cgi?id=154389
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/AbstractModel1Test.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla154389Test.java118
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/EmptyNode.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Factory.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Package.java93
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TreeNode.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/EmptyNodeImpl.java47
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/ExtendedNodeImpl.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1FactoryImpl.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1PackageImpl.java25
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TreeNodeImpl.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1AdapterFactory.java27
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1Switch.java35
13 files changed, 406 insertions, 25 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AbstractModel1Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AbstractModel1Test.java
index aaa61eb4c2..f77756482d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AbstractModel1Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AbstractModel1Test.java
@@ -19,6 +19,7 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.springframework.jdbc.core.JdbcTemplate;
+import testmodel1.EmptyNode;
import testmodel1.ExtendedNode;
import testmodel1.TestModel1Factory;
import testmodel1.TreeNode;
@@ -140,6 +141,19 @@ public abstract class AbstractModel1Test extends AbstractTopologyTest
return node;
}
+ protected EmptyNode createEmpty(String name)
+ {
+ return createEmpty(name, null);
+ }
+
+ protected EmptyNode createEmpty(String name, TreeNode parent)
+ {
+ EmptyNode node = TestModel1Factory.eINSTANCE.createEmptyNode();
+ node.setStringFeature(name);
+ node.setParent(parent);
+ return node;
+ }
+
protected TreeNode findChild(String name, TreeNode parent)
{
return findNode(name, parent.getChildren());
@@ -179,6 +193,7 @@ public abstract class AbstractModel1Test extends AbstractTopologyTest
{
super.wipeDatabase(jdbc);
dropTable(jdbc, "TREE_NODE");
+ dropTable(jdbc, "EMPTY_NODE");
dropTable(jdbc, "EXTENDED_NODE");
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla154389Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla154389Test.java
new file mode 100644
index 0000000000..d8358bbd06
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla154389Test.java
@@ -0,0 +1,118 @@
+/***************************************************************************
+ * 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 testmodel1.EmptyNode;
+import testmodel1.TreeNode;
+
+
+/**
+ * attributes in super class returned by server, ignored by client.
+ *
+ * The issue occurs when an object is loaded that has no attributes.
+ * All the attributes are in the super class.
+ *
+ * When the object is loaded the server transmits all of the attributes,
+ * which include the super class attributes. The client side ignored the
+ * attributes and mis-interpreted the message containing the attributes as
+ * the next object. From this point on nothing will work...
+ *
+ * So, it looks like the client and server don't match here.
+ *
+ * Both client and server are current with CVS as of today.
+ *
+ * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=154389
+ */
+public class Bugzilla154389Test extends AbstractModel1Test
+{
+ public void testEmptyRoot() throws Exception
+ {
+ final String RESOURCE = "/test/res";
+ final String ROOT = "root";
+ final boolean BOOLEAN_VALUE = true;
+ final int INT_VALUE = 12345;
+
+ { // Execution
+ TreeNode root = createEmpty(ROOT);
+ root.setBooleanFeature(BOOLEAN_VALUE);
+ root.setIntFeature(INT_VALUE);
+ saveRoot(root, RESOURCE);
+ }
+
+ { // Verification
+ TreeNode root = (TreeNode) loadRoot(RESOURCE);
+ assertNode(ROOT, root);
+ assertEquals(BOOLEAN_VALUE, root.isBooleanFeature());
+ assertEquals(INT_VALUE, root.getIntFeature());
+ }
+ }
+
+ public void testEmptyChild() throws Exception
+ {
+ final String RESOURCE = "/test/res";
+ final String ROOT = "root";
+ final String CHILD = "child";
+ final boolean BOOLEAN_VALUE = true;
+ final int INT_VALUE = 12345;
+
+ { // Execution
+ TreeNode root = createEmpty(ROOT);
+ EmptyNode child = createEmpty(CHILD, root);
+ child.setBooleanFeature(BOOLEAN_VALUE);
+ child.setIntFeature(INT_VALUE);
+ saveRoot(root, RESOURCE);
+ }
+
+ { // Verification
+ TreeNode root = (TreeNode) loadRoot(RESOURCE);
+ assertNode(ROOT, root);
+
+ TreeNode child = findChild(CHILD, root);
+ assertEquals(BOOLEAN_VALUE, child.isBooleanFeature());
+ assertEquals(INT_VALUE, child.getIntFeature());
+ }
+ }
+
+ public void testEmptyXRef() throws Exception
+ {
+ final String RESOURCE = "/test/res";
+ final String ROOT = "root";
+ final String CHILD_A = "a";
+ final String CHILD_B = "b";
+ final boolean BOOLEAN_VALUE = true;
+ final int INT_VALUE = 12345;
+
+ { // Execution
+ TreeNode root = createNode(ROOT);
+ TreeNode a = createNode(CHILD_A, root);
+ TreeNode b = createEmpty(CHILD_B, root);
+ b.setBooleanFeature(BOOLEAN_VALUE);
+ b.setIntFeature(INT_VALUE);
+
+ a.getReferences().add(b);
+ saveRoot(root, RESOURCE);
+ }
+
+ { // Verification
+ TreeNode root = (TreeNode) loadRoot(RESOURCE);
+ assertNode(ROOT, root);
+
+ TreeNode a = (TreeNode )root.getChildren().get(0);
+ assertNode(CHILD_A, a);
+
+ TreeNode b = (TreeNode) a.getReferences().get(0);
+ assertNode(CHILD_B, b);
+ assertEquals(BOOLEAN_VALUE, b.isBooleanFeature());
+ assertEquals(INT_VALUE, b.getIntFeature());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/EmptyNode.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/EmptyNode.java
new file mode 100644
index 0000000000..475a9b6f50
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/EmptyNode.java
@@ -0,0 +1,22 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package testmodel1;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Empty Node</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see testmodel1.TestModel1Package#getEmptyNode()
+ * @model
+ * @generated
+ */
+public interface EmptyNode extends TreeNode
+{
+} // EmptyNode \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Factory.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Factory.java
index b500ad635d..c151bdd192 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Factory.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Factory.java
@@ -47,6 +47,15 @@ public interface TestModel1Factory extends EFactory
ExtendedNode createExtendedNode();
/**
+ * Returns a new object of class '<em>Empty Node</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Empty Node</em>'.
+ * @generated
+ */
+ EmptyNode createEmptyNode();
+
+ /**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Package.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Package.java
index f1e0b91179..d4e191c248 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Package.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Package.java
@@ -238,6 +238,79 @@ public interface TestModel1Package extends EPackage
int EXTENDED_NODE_FEATURE_COUNT = TREE_NODE_FEATURE_COUNT + 3;
/**
+ * The meta object id for the '{@link testmodel1.impl.EmptyNodeImpl <em>Empty Node</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see testmodel1.impl.EmptyNodeImpl
+ * @see testmodel1.impl.TestModel1PackageImpl#getEmptyNode()
+ * @generated
+ */
+ int EMPTY_NODE = 2;
+
+ /**
+ * The feature id for the '<em><b>Parent</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EMPTY_NODE__PARENT = TREE_NODE__PARENT;
+
+ /**
+ * The feature id for the '<em><b>Children</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EMPTY_NODE__CHILDREN = TREE_NODE__CHILDREN;
+
+ /**
+ * The feature id for the '<em><b>References</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EMPTY_NODE__REFERENCES = TREE_NODE__REFERENCES;
+
+ /**
+ * The feature id for the '<em><b>Boolean Feature</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EMPTY_NODE__BOOLEAN_FEATURE = TREE_NODE__BOOLEAN_FEATURE;
+
+ /**
+ * The feature id for the '<em><b>Int Feature</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EMPTY_NODE__INT_FEATURE = TREE_NODE__INT_FEATURE;
+
+ /**
+ * The feature id for the '<em><b>String Feature</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EMPTY_NODE__STRING_FEATURE = TREE_NODE__STRING_FEATURE;
+
+ /**
+ * The number of structural features of the '<em>Empty Node</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EMPTY_NODE_FEATURE_COUNT = TREE_NODE_FEATURE_COUNT + 0;
+
+ /**
* Returns the meta object for class '{@link testmodel1.TreeNode <em>Tree Node</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -357,6 +430,16 @@ public interface TestModel1Package extends EPackage
EAttribute getExtendedNode_StringFeature2();
/**
+ * Returns the meta object for class '{@link testmodel1.EmptyNode <em>Empty Node</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Empty Node</em>'.
+ * @see testmodel1.EmptyNode
+ * @generated
+ */
+ EClass getEmptyNode();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -472,6 +555,16 @@ public interface TestModel1Package extends EPackage
*/
EAttribute EXTENDED_NODE__STRING_FEATURE2 = eINSTANCE.getExtendedNode_StringFeature2();
+ /**
+ * The meta object literal for the '{@link testmodel1.impl.EmptyNodeImpl <em>Empty Node</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see testmodel1.impl.EmptyNodeImpl
+ * @see testmodel1.impl.TestModel1PackageImpl#getEmptyNode()
+ * @generated
+ */
+ EClass EMPTY_NODE = eINSTANCE.getEmptyNode();
+
}
} //TestModel1Package
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TreeNode.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TreeNode.java
index 95e0fb5eeb..ca1f0e173f 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TreeNode.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TreeNode.java
@@ -11,8 +11,6 @@ import org.eclipse.emf.cdo.client.CDOPersistent;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-
/**
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/EmptyNodeImpl.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/EmptyNodeImpl.java
new file mode 100644
index 0000000000..bf6b370b67
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/EmptyNodeImpl.java
@@ -0,0 +1,47 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package testmodel1.impl;
+
+
+import org.eclipse.emf.ecore.EClass;
+
+import testmodel1.EmptyNode;
+import testmodel1.TestModel1Package;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Empty Node</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class EmptyNodeImpl extends TreeNodeImpl implements EmptyNode
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EmptyNodeImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return TestModel1Package.Literals.EMPTY_NODE;
+ }
+
+} //EmptyNodeImpl \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/ExtendedNodeImpl.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/ExtendedNodeImpl.java
index 8d920c5e25..2610d198de 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/ExtendedNodeImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/ExtendedNodeImpl.java
@@ -7,24 +7,20 @@
package testmodel1.impl;
-import java.util.Collection;
-
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
-
import org.eclipse.emf.common.util.EList;
-
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
-
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
import testmodel1.ExtendedNode;
import testmodel1.TestModel1Package;
+import java.util.Collection;
+
/**
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1FactoryImpl.java
index ad05d25901..81b1a7830d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1FactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1FactoryImpl.java
@@ -10,12 +10,14 @@ package testmodel1.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
-
import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import testmodel1.*;
+import testmodel1.EmptyNode;
+import testmodel1.ExtendedNode;
+import testmodel1.TestModel1Factory;
+import testmodel1.TestModel1Package;
+import testmodel1.TreeNode;
/**
@@ -74,6 +76,8 @@ public class TestModel1FactoryImpl extends EFactoryImpl implements TestModel1Fac
return createTreeNode();
case TestModel1Package.EXTENDED_NODE:
return createExtendedNode();
+ case TestModel1Package.EMPTY_NODE:
+ return createEmptyNode();
default:
throw new IllegalArgumentException("The class '" + eClass.getName()
+ "' is not a valid classifier");
@@ -107,6 +111,17 @@ public class TestModel1FactoryImpl extends EFactoryImpl implements TestModel1Fac
* <!-- end-user-doc -->
* @generated
*/
+ public EmptyNode createEmptyNode()
+ {
+ EmptyNodeImpl emptyNode = new EmptyNodeImpl();
+ return emptyNode;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public TestModel1Package getTestModel1Package()
{
return (TestModel1Package) getEPackage();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1PackageImpl.java
index d3d0f1a551..a9a0414728 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1PackageImpl.java
@@ -13,9 +13,9 @@ import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
-
import org.eclipse.emf.ecore.impl.EPackageImpl;
+import testmodel1.EmptyNode;
import testmodel1.ExtendedNode;
import testmodel1.TestModel1Factory;
import testmodel1.TestModel1Package;
@@ -45,6 +45,13 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac
private EClass extendedNodeEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass emptyNodeEClass = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -235,6 +242,16 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getEmptyNode()
+ {
+ return emptyNodeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public TestModel1Factory getTestModel1Factory()
{
return (TestModel1Factory) getEFactoryInstance();
@@ -272,6 +289,8 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac
createEReference(extendedNodeEClass, EXTENDED_NODE__BIDI_SOURCE);
createEReference(extendedNodeEClass, EXTENDED_NODE__BIDI_TARGET);
createEAttribute(extendedNodeEClass, EXTENDED_NODE__STRING_FEATURE2);
+
+ emptyNodeEClass = createEClass(EMPTY_NODE);
}
/**
@@ -305,6 +324,7 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac
// Add supertypes to classes
treeNodeEClass.getESuperTypes().add(theCDOPackage.getCDOPersistent());
extendedNodeEClass.getESuperTypes().add(this.getTreeNode());
+ emptyNodeEClass.getESuperTypes().add(this.getTreeNode());
// Initialize classes and features; add operations and parameters
initEClass(treeNodeEClass, TreeNode.class, "TreeNode", !IS_ABSTRACT, !IS_INTERFACE,
@@ -342,6 +362,9 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac
null, 0, 1, ExtendedNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE,
!IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(emptyNodeEClass, EmptyNode.class, "EmptyNode", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+
// Create resource
createResource(eNS_URI);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TreeNodeImpl.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TreeNodeImpl.java
index 63b1ab1e47..b5f4a20400 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TreeNodeImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TreeNodeImpl.java
@@ -7,21 +7,14 @@
package testmodel1.impl;
-import java.util.Collection;
-
import org.eclipse.emf.cdo.client.impl.CDOPersistentImpl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
-
import org.eclipse.emf.common.util.EList;
-
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
-
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -30,6 +23,8 @@ import org.eclipse.emf.ecore.util.InternalEList;
import testmodel1.TestModel1Package;
import testmodel1.TreeNode;
+import java.util.Collection;
+
/**
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1AdapterFactory.java
index ad551f95fb..936856a9ac 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1AdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1AdapterFactory.java
@@ -12,12 +12,13 @@ import org.eclipse.emf.cdo.client.CDOPersistent;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
-
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-
import org.eclipse.emf.ecore.EObject;
-import testmodel1.*;
+import testmodel1.EmptyNode;
+import testmodel1.ExtendedNode;
+import testmodel1.TestModel1Package;
+import testmodel1.TreeNode;
/**
@@ -91,6 +92,11 @@ public class TestModel1AdapterFactory extends AdapterFactoryImpl
return createExtendedNodeAdapter();
}
+ public Object caseEmptyNode(EmptyNode object)
+ {
+ return createEmptyNodeAdapter();
+ }
+
public Object caseCDOPersistable(CDOPersistable object)
{
return createCDOPersistableAdapter();
@@ -151,6 +157,21 @@ public class TestModel1AdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link testmodel1.EmptyNode <em>Empty Node</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see testmodel1.EmptyNode
+ * @generated
+ */
+ public Adapter createEmptyNodeAdapter()
+ {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.client.CDOPersistable <em>Persistable</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1Switch.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1Switch.java
index bca801c01a..3132480e67 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1Switch.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1Switch.java
@@ -7,15 +7,18 @@
package testmodel1.util;
-import java.util.List;
-
import org.eclipse.emf.cdo.client.CDOPersistable;
import org.eclipse.emf.cdo.client.CDOPersistent;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
-import testmodel1.*;
+import testmodel1.EmptyNode;
+import testmodel1.ExtendedNode;
+import testmodel1.TestModel1Package;
+import testmodel1.TreeNode;
+
+import java.util.List;
/**
@@ -118,6 +121,16 @@ public class TestModel1Switch
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case TestModel1Package.EMPTY_NODE:
+ {
+ EmptyNode emptyNode = (EmptyNode) theEObject;
+ Object result = caseEmptyNode(emptyNode);
+ if (result == null) result = caseTreeNode(emptyNode);
+ if (result == null) result = caseCDOPersistent(emptyNode);
+ if (result == null) result = caseCDOPersistable(emptyNode);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -156,6 +169,22 @@ public class TestModel1Switch
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>Empty Node</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpretting the object as an instance of '<em>Empty Node</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public Object caseEmptyNode(EmptyNode object)
+ {
+ return null;
+ }
+
+ /**
* Returns the result of interpretting the object as an instance of '<em>Persistable</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;

Back to the top