diff options
author | Eike Stepper | 2006-08-20 09:53:49 +0000 |
---|---|---|
committer | Eike Stepper | 2006-08-20 09:53:49 +0000 |
commit | adf73ce1a0f3461bcbab8229dd2277941ec84f9c (patch) | |
tree | 8467b367689f2c2b9079cd6c96df1f277f5877ca | |
parent | 54136e4fa8ea5039f0f42fcc933e993abfb1d576 (diff) | |
download | cdo-adf73ce1a0f3461bcbab8229dd2277941ec84f9c.tar.gz cdo-adf73ce1a0f3461bcbab8229dd2277941ec84f9c.tar.xz cdo-adf73ce1a0f3461bcbab8229dd2277941ec84f9c.zip |
[154389] attributes in super class returned by server, ignored by client
https://bugs.eclipse.org/bugs/show_bug.cgi?id=154389
8 files changed, 241 insertions, 2 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 45fd503093..e6c4f1b68f 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 @@ -31,6 +31,15 @@ import java.util.Iterator; import java.util.List; +/** + * Base class for CDO tests based on selectable topologies and the TestModel1. + * + * After adding EClasses to TestModel1, don't forget to + * <ol> + * <li> regenerate the test model + * <li> remove the CDO mapping file + * <li> add a line to wipeDatabase() + */ public abstract class AbstractModel1Test extends AbstractTopologyTest { protected void assertChild(String name, EList nodes) diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/BasicTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/BasicTest.java index 123bb4306c..3adc06440c 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/BasicTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/BasicTest.java @@ -148,7 +148,7 @@ public class BasicTest extends AbstractModel1Test } } - public void testGetResourceWithRef() throws Exception + public void testGetResourceViaRef() throws Exception { final String RESOURCE = "/test/res"; final String ROOT = "root"; @@ -301,7 +301,7 @@ public class BasicTest extends AbstractModel1Test } } - public void testGetContainerWithRef() throws Exception + public void testGetContainerViaRef() throws Exception { final String RESOURCE = "/test/res"; final String ROOT = "root"; 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 c151bdd192..263f3e82ff 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Factory.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Factory.java @@ -56,6 +56,15 @@ public interface TestModel1Factory extends EFactory EmptyNode createEmptyNode(); /** + * Returns a new object of class '<em>Empty Ref Node</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Empty Ref Node</em>'. + * @generated + */ + EmptyRefNode createEmptyRefNode(); + + /** * 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 d4e191c248..aca26add7e 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Package.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Package.java @@ -311,6 +311,88 @@ public interface TestModel1Package extends EPackage int EMPTY_NODE_FEATURE_COUNT = TREE_NODE_FEATURE_COUNT + 0; /** + * The meta object id for the '{@link testmodel1.impl.EmptyRefNodeImpl <em>Empty Ref Node</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see testmodel1.impl.EmptyRefNodeImpl + * @see testmodel1.impl.TestModel1PackageImpl#getEmptyRefNode() + * @generated + */ + int EMPTY_REF_NODE = 3; + + /** + * The feature id for the '<em><b>Parent</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EMPTY_REF_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_REF_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_REF_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_REF_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_REF_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_REF_NODE__STRING_FEATURE = TREE_NODE__STRING_FEATURE; + + /** + * The feature id for the '<em><b>More References</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EMPTY_REF_NODE__MORE_REFERENCES = TREE_NODE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the '<em>Empty Ref Node</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EMPTY_REF_NODE_FEATURE_COUNT = TREE_NODE_FEATURE_COUNT + 1; + + /** * Returns the meta object for class '{@link testmodel1.TreeNode <em>Tree Node</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -440,6 +522,27 @@ public interface TestModel1Package extends EPackage EClass getEmptyNode(); /** + * Returns the meta object for class '{@link testmodel1.EmptyRefNode <em>Empty Ref Node</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Empty Ref Node</em>'. + * @see testmodel1.EmptyRefNode + * @generated + */ + EClass getEmptyRefNode(); + + /** + * Returns the meta object for the reference list '{@link testmodel1.EmptyRefNode#getMoreReferences <em>More References</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>More References</em>'. + * @see testmodel1.EmptyRefNode#getMoreReferences() + * @see #getEmptyRefNode() + * @generated + */ + EReference getEmptyRefNode_MoreReferences(); + + /** * Returns the factory that creates the instances of the model. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -565,6 +668,24 @@ public interface TestModel1Package extends EPackage */ EClass EMPTY_NODE = eINSTANCE.getEmptyNode(); + /** + * The meta object literal for the '{@link testmodel1.impl.EmptyRefNodeImpl <em>Empty Ref Node</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see testmodel1.impl.EmptyRefNodeImpl + * @see testmodel1.impl.TestModel1PackageImpl#getEmptyRefNode() + * @generated + */ + EClass EMPTY_REF_NODE = eINSTANCE.getEmptyRefNode(); + + /** + * The meta object literal for the '<em><b>More References</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference EMPTY_REF_NODE__MORE_REFERENCES = eINSTANCE.getEmptyRefNode_MoreReferences(); + } } //TestModel1Package 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 81b1a7830d..3751ffa5c3 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 @@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; import testmodel1.EmptyNode; +import testmodel1.EmptyRefNode; import testmodel1.ExtendedNode; import testmodel1.TestModel1Factory; import testmodel1.TestModel1Package; @@ -78,6 +79,8 @@ public class TestModel1FactoryImpl extends EFactoryImpl implements TestModel1Fac return createExtendedNode(); case TestModel1Package.EMPTY_NODE: return createEmptyNode(); + case TestModel1Package.EMPTY_REF_NODE: + return createEmptyRefNode(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); @@ -122,6 +125,17 @@ public class TestModel1FactoryImpl extends EFactoryImpl implements TestModel1Fac * <!-- end-user-doc --> * @generated */ + public EmptyRefNode createEmptyRefNode() + { + EmptyRefNodeImpl emptyRefNode = new EmptyRefNodeImpl(); + return emptyRefNode; + } + + /** + * <!-- 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 a9a0414728..78af6e07e3 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 @@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.impl.EPackageImpl; import testmodel1.EmptyNode; +import testmodel1.EmptyRefNode; import testmodel1.ExtendedNode; import testmodel1.TestModel1Factory; import testmodel1.TestModel1Package; @@ -52,6 +53,13 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac private EClass emptyNodeEClass = null; /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass emptyRefNodeEClass = 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. @@ -252,6 +260,26 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac * <!-- end-user-doc --> * @generated */ + public EClass getEmptyRefNode() + { + return emptyRefNodeEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getEmptyRefNode_MoreReferences() + { + return (EReference) emptyRefNodeEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public TestModel1Factory getTestModel1Factory() { return (TestModel1Factory) getEFactoryInstance(); @@ -291,6 +319,9 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac createEAttribute(extendedNodeEClass, EXTENDED_NODE__STRING_FEATURE2); emptyNodeEClass = createEClass(EMPTY_NODE); + + emptyRefNodeEClass = createEClass(EMPTY_REF_NODE); + createEReference(emptyRefNodeEClass, EMPTY_REF_NODE__MORE_REFERENCES); } /** @@ -325,6 +356,7 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac treeNodeEClass.getESuperTypes().add(theCDOPackage.getCDOPersistent()); extendedNodeEClass.getESuperTypes().add(this.getTreeNode()); emptyNodeEClass.getESuperTypes().add(this.getTreeNode()); + emptyRefNodeEClass.getESuperTypes().add(this.getTreeNode()); // Initialize classes and features; add operations and parameters initEClass(treeNodeEClass, TreeNode.class, "TreeNode", !IS_ABSTRACT, !IS_INTERFACE, @@ -365,6 +397,12 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac initEClass(emptyNodeEClass, EmptyNode.class, "EmptyNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(emptyRefNodeEClass, EmptyRefNode.class, "EmptyRefNode", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getEmptyRefNode_MoreReferences(), this.getTreeNode(), null, "moreReferences", + null, 0, -1, EmptyRefNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + // Create resource createResource(eNS_URI); } 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 936856a9ac..8d813a4273 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 @@ -16,6 +16,7 @@ import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; import org.eclipse.emf.ecore.EObject; import testmodel1.EmptyNode; +import testmodel1.EmptyRefNode; import testmodel1.ExtendedNode; import testmodel1.TestModel1Package; import testmodel1.TreeNode; @@ -97,6 +98,11 @@ public class TestModel1AdapterFactory extends AdapterFactoryImpl return createEmptyNodeAdapter(); } + public Object caseEmptyRefNode(EmptyRefNode object) + { + return createEmptyRefNodeAdapter(); + } + public Object caseCDOPersistable(CDOPersistable object) { return createCDOPersistableAdapter(); @@ -172,6 +178,21 @@ public class TestModel1AdapterFactory extends AdapterFactoryImpl } /** + * Creates a new adapter for an object of class '{@link testmodel1.EmptyRefNode <em>Empty Ref 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.EmptyRefNode + * @generated + */ + public Adapter createEmptyRefNodeAdapter() + { + 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 3132480e67..b48228af88 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 @@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import testmodel1.EmptyNode; +import testmodel1.EmptyRefNode; import testmodel1.ExtendedNode; import testmodel1.TestModel1Package; import testmodel1.TreeNode; @@ -131,6 +132,16 @@ public class TestModel1Switch if (result == null) result = defaultCase(theEObject); return result; } + case TestModel1Package.EMPTY_REF_NODE: + { + EmptyRefNode emptyRefNode = (EmptyRefNode) theEObject; + Object result = caseEmptyRefNode(emptyRefNode); + if (result == null) result = caseTreeNode(emptyRefNode); + if (result == null) result = caseCDOPersistent(emptyRefNode); + if (result == null) result = caseCDOPersistable(emptyRefNode); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } @@ -185,6 +196,22 @@ public class TestModel1Switch } /** + * Returns the result of interpretting the object as an instance of '<em>Empty Ref 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 Ref Node</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public Object caseEmptyRefNode(EmptyRefNode object) + { + return null; + } + + /** * Returns the result of interpretting the object as an instance of '<em>Persistable</em>'. * <!-- begin-user-doc --> * This implementation returns null; |