summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-01-08 10:45:54 (EST)
committerEike Stepper2007-01-08 10:45:54 (EST)
commitd9d0368d92920f74317e55af5af34a8f6e18b69e (patch)
treeb94e99556d6f6c5e949c8f0b4ece0886576d2e6c
parent680e6d2c2ff80fc39a7d9159b576a6f06723368a (diff)
downloadcdo-d9d0368d92920f74317e55af5af34a8f6e18b69e.zip
cdo-d9d0368d92920f74317e55af5af34a8f6e18b69e.tar.gz
cdo-d9d0368d92920f74317e55af5af34a8f6e18b69e.tar.bz2
[162961] CDO objects not loading correctly - https://bugs.eclipse.org/bugs/show_bug.cgi?id=162961
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/model/TestModel1.ecore15
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla162961Test.java499
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Author.java78
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Book.java86
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Root.java49
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Factory.java27
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Package.java257
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/AuthorImpl.java261
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/BookImpl.java321
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/RootImpl.java170
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1FactoryImpl.java39
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TestModel1PackageImpl.java142
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TreeNodeImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1AdapterFactory.java60
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/util/TestModel1Switch.java75
15 files changed, 1870 insertions, 223 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/model/TestModel1.ecore b/plugins/org.eclipse.emf.cdo.tests/model/TestModel1.ecore
index 7990b3c..f34605e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/model/TestModel1.ecore
+++ b/plugins/org.eclipse.emf.cdo.tests/model/TestModel1.ecore
@@ -35,4 +35,19 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="moreReferences" upperBound="-1"
eType="#//TreeNode"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Root" eSuperTypes="../../org.eclipse.emf.cdo.client/model/client.ecore#//CDOPersistent">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
+ eType="ecore:EClass ../../org.eclipse.emf.cdo.client/model/client.ecore#//CDOPersistent"
+ containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Author" eSuperTypes="../../org.eclipse.emf.cdo.client/model/client.ecore#//CDOPersistent">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="books" upperBound="-1"
+ eType="#//Book" eOpposite="#//Book/author"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Book" eSuperTypes="../../org.eclipse.emf.cdo.client/model/client.ecore#//CDOPersistent">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="author" eType="#//Author"
+ eOpposite="#//Author/books"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla162961Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla162961Test.java
index 210d7ac..dc3e791 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla162961Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/Bugzilla162961Test.java
@@ -13,7 +13,11 @@ package org.eclipse.emf.cdo.tests.model1;
import org.eclipse.emf.common.util.EList;
+import testmodel1.Author;
+import testmodel1.Book;
import testmodel1.ExtendedNode;
+import testmodel1.Root;
+import testmodel1.TestModel1Factory;
import testmodel1.TreeNode;
@@ -52,252 +56,315 @@ import testmodel1.TreeNode;
*/
public class Bugzilla162961Test extends AbstractModel1Test
{
- public void testViaContainment() throws Exception
- {
+ public void testViaContainment() throws Exception
{
- TreeNode root = createNode("root");
- TreeNode books = createNode("books", root);
- TreeNode genres = createNode("genres", root);
-
- ExtendedNode book0 = createExtended("book0", books);
- ExtendedNode book1 = createExtended("book1", books);
- ExtendedNode book2 = createExtended("book2", books);
- ExtendedNode book3 = createExtended("book3", books);
-
- ExtendedNode genre0 = createExtended("genre0", genres);
- ExtendedNode genre1 = createExtended("genre1", genres);
- ExtendedNode genre2 = createExtended("genre2", genres);
- ExtendedNode genre3 = createExtended("genre3", genres);
-
- book0.getBidiSource().add(genre0);
- book0.getBidiSource().add(genre1);
- book0.getBidiSource().add(genre2);
- book0.getBidiSource().add(genre3);
-
- book1.getBidiSource().add(genre0);
- book1.getBidiSource().add(genre1);
- book1.getBidiSource().add(genre2);
-
- book2.getBidiSource().add(genre0);
- book2.getBidiSource().add(genre1);
-
- book3.getBidiSource().add(genre0);
- saveRoot(root, "/test/res");
+ {
+ TreeNode root = createNode("root");
+ TreeNode books = createNode("books", root);
+ TreeNode genres = createNode("genres", root);
+
+ ExtendedNode book0 = createExtended("book0", books);
+ ExtendedNode book1 = createExtended("book1", books);
+ ExtendedNode book2 = createExtended("book2", books);
+ ExtendedNode book3 = createExtended("book3", books);
+
+ ExtendedNode genre0 = createExtended("genre0", genres);
+ ExtendedNode genre1 = createExtended("genre1", genres);
+ ExtendedNode genre2 = createExtended("genre2", genres);
+ ExtendedNode genre3 = createExtended("genre3", genres);
+
+ book0.getBidiSource().add(genre0);
+ book0.getBidiSource().add(genre1);
+ book0.getBidiSource().add(genre2);
+ book0.getBidiSource().add(genre3);
+
+ book1.getBidiSource().add(genre0);
+ book1.getBidiSource().add(genre1);
+ book1.getBidiSource().add(genre2);
+
+ book2.getBidiSource().add(genre0);
+ book2.getBidiSource().add(genre1);
+
+ book3.getBidiSource().add(genre0);
+ saveRoot(root, "/test/res");
+ }
+
+ {
+ TreeNode root = (TreeNode) loadRoot("/test/res");
+ TreeNode books = findChild("books", root);
+ EList children = books.getChildren();
+ assertEquals("book0", ((ExtendedNode) children.get(0)).getStringFeature());
+ assertEquals("book1", ((ExtendedNode) children.get(1)).getStringFeature());
+ assertEquals("book2", ((ExtendedNode) children.get(2)).getStringFeature());
+ assertEquals("book3", ((ExtendedNode) children.get(3)).getStringFeature());
+ }
}
-
+
+ public void testViaXRef() throws Exception
{
- TreeNode root = (TreeNode) loadRoot("/test/res");
- TreeNode books = findChild("books", root);
- EList children = books.getChildren();
- assertEquals("book0", ((ExtendedNode) children.get(0)).getStringFeature());
- assertEquals("book1", ((ExtendedNode) children.get(1)).getStringFeature());
- assertEquals("book2", ((ExtendedNode) children.get(2)).getStringFeature());
- assertEquals("book3", ((ExtendedNode) children.get(3)).getStringFeature());
+ {
+ TreeNode root = createNode("root");
+ TreeNode books = createNode("books", root);
+ TreeNode genres = createNode("genres", root);
+
+ ExtendedNode book0 = createExtended("book0", books);
+ ExtendedNode book1 = createExtended("book1", books);
+ ExtendedNode book2 = createExtended("book2", books);
+ ExtendedNode book3 = createExtended("book3", books);
+
+ ExtendedNode genre0 = createExtended("genre0", genres);
+ ExtendedNode genre1 = createExtended("genre1", genres);
+ ExtendedNode genre2 = createExtended("genre2", genres);
+ ExtendedNode genre3 = createExtended("genre3", genres);
+
+ book0.getBidiSource().add(genre0);
+ book0.getBidiSource().add(genre1);
+ book0.getBidiSource().add(genre2);
+ book0.getBidiSource().add(genre3);
+
+ book1.getBidiSource().add(genre0);
+ book1.getBidiSource().add(genre1);
+ book1.getBidiSource().add(genre2);
+
+ book2.getBidiSource().add(genre0);
+ book2.getBidiSource().add(genre1);
+
+ book3.getBidiSource().add(genre0);
+ saveRoot(root, "/test/res");
+ }
+
+ {
+ TreeNode root = (TreeNode) loadRoot("/test/res");
+ TreeNode genres = findChild("genres", root);
+ ExtendedNode genre0 = (ExtendedNode) genres.getChildren().get(0);
+ assertEquals("book0", ((ExtendedNode) genre0.getBidiTarget().get(0)).getStringFeature());
+ assertEquals("book1", ((ExtendedNode) genre0.getBidiTarget().get(1)).getStringFeature());
+ assertEquals("book2", ((ExtendedNode) genre0.getBidiTarget().get(2)).getStringFeature());
+ assertEquals("book3", ((ExtendedNode) genre0.getBidiTarget().get(3)).getStringFeature());
+
+ TreeNode books = findChild("books", root);
+ EList children = books.getChildren();
+ assertEquals("book0", ((ExtendedNode) children.get(0)).getStringFeature());
+ assertEquals("book1", ((ExtendedNode) children.get(1)).getStringFeature());
+ assertEquals("book2", ((ExtendedNode) children.get(2)).getStringFeature());
+ assertEquals("book3", ((ExtendedNode) children.get(3)).getStringFeature());
+ }
}
- }
-
- public void testViaXRef() throws Exception
- {
+
+ public void testViaXRefBooksFirst() throws Exception
{
- TreeNode root = createNode("root");
- TreeNode books = createNode("books", root);
- TreeNode genres = createNode("genres", root);
-
- ExtendedNode book0 = createExtended("book0", books);
- ExtendedNode book1 = createExtended("book1", books);
- ExtendedNode book2 = createExtended("book2", books);
- ExtendedNode book3 = createExtended("book3", books);
-
- ExtendedNode genre0 = createExtended("genre0", genres);
- ExtendedNode genre1 = createExtended("genre1", genres);
- ExtendedNode genre2 = createExtended("genre2", genres);
- ExtendedNode genre3 = createExtended("genre3", genres);
-
- book0.getBidiSource().add(genre0);
- book0.getBidiSource().add(genre1);
- book0.getBidiSource().add(genre2);
- book0.getBidiSource().add(genre3);
-
- book1.getBidiSource().add(genre0);
- book1.getBidiSource().add(genre1);
- book1.getBidiSource().add(genre2);
-
- book2.getBidiSource().add(genre0);
- book2.getBidiSource().add(genre1);
-
- book3.getBidiSource().add(genre0);
- saveRoot(root, "/test/res");
+ {
+ TreeNode root = createNode("root");
+ TreeNode books = createNode("books", root);
+ TreeNode genres = createNode("genres", root);
+
+ ExtendedNode book0 = createExtended("book0", books);
+ ExtendedNode book1 = createExtended("book1", books);
+ ExtendedNode book2 = createExtended("book2", books);
+ ExtendedNode book3 = createExtended("book3", books);
+
+ ExtendedNode genre0 = createExtended("genre0", genres);
+ ExtendedNode genre1 = createExtended("genre1", genres);
+ ExtendedNode genre2 = createExtended("genre2", genres);
+ ExtendedNode genre3 = createExtended("genre3", genres);
+
+ book0.getBidiSource().add(genre0);
+ book0.getBidiSource().add(genre1);
+ book0.getBidiSource().add(genre2);
+ book0.getBidiSource().add(genre3);
+
+ book1.getBidiSource().add(genre0);
+ book1.getBidiSource().add(genre1);
+ book1.getBidiSource().add(genre2);
+
+ book2.getBidiSource().add(genre0);
+ book2.getBidiSource().add(genre1);
+
+ book3.getBidiSource().add(genre0);
+ saveRoot(root, "/test/res");
+ }
+
+ {
+ TreeNode root = (TreeNode) loadRoot("/test/res");
+ TreeNode books = findChild("books", root);
+ TreeNode genres = findChild("genres", root);
+
+ ExtendedNode genre0 = (ExtendedNode) genres.getChildren().get(0);
+ assertEquals("book0", ((ExtendedNode) genre0.getBidiTarget().get(0)).getStringFeature());
+ assertEquals("book1", ((ExtendedNode) genre0.getBidiTarget().get(1)).getStringFeature());
+ assertEquals("book2", ((ExtendedNode) genre0.getBidiTarget().get(2)).getStringFeature());
+ assertEquals("book3", ((ExtendedNode) genre0.getBidiTarget().get(3)).getStringFeature());
+
+ EList children = books.getChildren();
+ assertEquals("book0", ((ExtendedNode) children.get(0)).getStringFeature());
+ assertEquals("book1", ((ExtendedNode) children.get(1)).getStringFeature());
+ assertEquals("book2", ((ExtendedNode) children.get(2)).getStringFeature());
+ assertEquals("book3", ((ExtendedNode) children.get(3)).getStringFeature());
+ }
}
-
+
+ public void testViaXRefSharedRoot() throws Exception
{
- TreeNode root = (TreeNode) loadRoot("/test/res");
- TreeNode genres = findChild("genres", root);
- ExtendedNode genre0 = (ExtendedNode) genres.getChildren().get(0);
- assertEquals("book0", ((ExtendedNode) genre0.getBidiTarget().get(0)).getStringFeature());
- assertEquals("book1", ((ExtendedNode) genre0.getBidiTarget().get(1)).getStringFeature());
- assertEquals("book2", ((ExtendedNode) genre0.getBidiTarget().get(2)).getStringFeature());
- assertEquals("book3", ((ExtendedNode) genre0.getBidiTarget().get(3)).getStringFeature());
-
- TreeNode books = findChild("books", root);
- EList children = books.getChildren();
- assertEquals("book0", ((ExtendedNode) children.get(0)).getStringFeature());
- assertEquals("book1", ((ExtendedNode) children.get(1)).getStringFeature());
- assertEquals("book2", ((ExtendedNode) children.get(2)).getStringFeature());
- assertEquals("book3", ((ExtendedNode) children.get(3)).getStringFeature());
+ {
+ TreeNode root = createNode("root");
+
+ ExtendedNode book0 = createExtended("book0", root);
+ ExtendedNode book1 = createExtended("book1", root);
+ ExtendedNode book2 = createExtended("book2", root);
+ ExtendedNode book3 = createExtended("book3", root);
+
+ ExtendedNode genre0 = createExtended("genre0", root);
+ ExtendedNode genre1 = createExtended("genre1", root);
+ ExtendedNode genre2 = createExtended("genre2", root);
+ ExtendedNode genre3 = createExtended("genre3", root);
+
+ book0.getBidiSource().add(genre0);
+ book0.getBidiSource().add(genre1);
+ book0.getBidiSource().add(genre2);
+ book0.getBidiSource().add(genre3);
+
+ book1.getBidiSource().add(genre0);
+ book1.getBidiSource().add(genre1);
+ book1.getBidiSource().add(genre2);
+
+ book2.getBidiSource().add(genre0);
+ book2.getBidiSource().add(genre1);
+
+ book3.getBidiSource().add(genre0);
+ saveRoot(root, "/test/res");
+ }
+
+ {
+ TreeNode root = (TreeNode) loadRoot("/test/res");
+
+ ExtendedNode genre0 = (ExtendedNode) root.getChildren().get(4);
+ assertEquals("book0", ((ExtendedNode) genre0.getBidiTarget().get(0)).getStringFeature());
+ assertEquals("book1", ((ExtendedNode) genre0.getBidiTarget().get(1)).getStringFeature());
+ assertEquals("book2", ((ExtendedNode) genre0.getBidiTarget().get(2)).getStringFeature());
+ assertEquals("book3", ((ExtendedNode) genre0.getBidiTarget().get(3)).getStringFeature());
+
+ EList children = root.getChildren();
+ assertEquals("book0", ((ExtendedNode) children.get(0)).getStringFeature());
+ assertEquals("book1", ((ExtendedNode) children.get(1)).getStringFeature());
+ assertEquals("book2", ((ExtendedNode) children.get(2)).getStringFeature());
+ assertEquals("book3", ((ExtendedNode) children.get(3)).getStringFeature());
+ }
}
- }
-
- public void testViaXRefBooksFirst() throws Exception
- {
+
+ public void testViaXRefChildren2() throws Exception
{
- TreeNode root = createNode("root");
- TreeNode books = createNode("books", root);
- TreeNode genres = createNode("genres", root);
-
- ExtendedNode book0 = createExtended("book0", books);
- ExtendedNode book1 = createExtended("book1", books);
- ExtendedNode book2 = createExtended("book2", books);
- ExtendedNode book3 = createExtended("book3", books);
-
- ExtendedNode genre0 = createExtended("genre0", genres);
- ExtendedNode genre1 = createExtended("genre1", genres);
- ExtendedNode genre2 = createExtended("genre2", genres);
- ExtendedNode genre3 = createExtended("genre3", genres);
-
- book0.getBidiSource().add(genre0);
- book0.getBidiSource().add(genre1);
- book0.getBidiSource().add(genre2);
- book0.getBidiSource().add(genre3);
-
- book1.getBidiSource().add(genre0);
- book1.getBidiSource().add(genre1);
- book1.getBidiSource().add(genre2);
-
- book2.getBidiSource().add(genre0);
- book2.getBidiSource().add(genre1);
-
- book3.getBidiSource().add(genre0);
- saveRoot(root, "/test/res");
+ {
+ TreeNode root = createNode("root");
+
+ // Insert books into children
+ ExtendedNode book0 = createExtended("book0", root);
+ ExtendedNode book1 = createExtended("book1", root);
+ ExtendedNode book2 = createExtended("book2", root);
+ ExtendedNode book3 = createExtended("book3", root);
+
+ // Insert genres into children2
+ ExtendedNode genre0 = createExtended("genre0");
+ genre0.setParent2(root);
+ ExtendedNode genre1 = createExtended("genre1");
+ genre1.setParent2(root);
+ ExtendedNode genre2 = createExtended("genre2");
+ genre2.setParent2(root);
+ ExtendedNode genre3 = createExtended("genre3");
+ genre3.setParent2(root);
+
+ book0.getBidiSource().add(genre0);
+ book0.getBidiSource().add(genre1);
+ book0.getBidiSource().add(genre2);
+ book0.getBidiSource().add(genre3);
+
+ book1.getBidiSource().add(genre0);
+ book1.getBidiSource().add(genre1);
+ book1.getBidiSource().add(genre2);
+
+ book2.getBidiSource().add(genre0);
+ book2.getBidiSource().add(genre1);
+
+ book3.getBidiSource().add(genre0);
+ saveRoot(root, "/test/res");
+ }
+
+ {
+ TreeNode root = (TreeNode) loadRoot("/test/res");
+
+ ExtendedNode genre0 = (ExtendedNode) root.getChildren2().get(0);
+ assertEquals("book0", ((ExtendedNode) genre0.getBidiTarget().get(0)).getStringFeature());
+ assertEquals("book1", ((ExtendedNode) genre0.getBidiTarget().get(1)).getStringFeature());
+ assertEquals("book2", ((ExtendedNode) genre0.getBidiTarget().get(2)).getStringFeature());
+ assertEquals("book3", ((ExtendedNode) genre0.getBidiTarget().get(3)).getStringFeature());
+
+ EList children = root.getChildren();
+ assertEquals("book0", ((ExtendedNode) children.get(0)).getStringFeature());
+ assertEquals("book1", ((ExtendedNode) children.get(1)).getStringFeature());
+ assertEquals("book2", ((ExtendedNode) children.get(2)).getStringFeature());
+ assertEquals("book3", ((ExtendedNode) children.get(3)).getStringFeature());
+ }
}
- {
- TreeNode root = (TreeNode) loadRoot("/test/res");
- TreeNode books = findChild("books", root);
- TreeNode genres = findChild("genres", root);
-
- ExtendedNode genre0 = (ExtendedNode) genres.getChildren().get(0);
- assertEquals("book0", ((ExtendedNode) genre0.getBidiTarget().get(0)).getStringFeature());
- assertEquals("book1", ((ExtendedNode) genre0.getBidiTarget().get(1)).getStringFeature());
- assertEquals("book2", ((ExtendedNode) genre0.getBidiTarget().get(2)).getStringFeature());
- assertEquals("book3", ((ExtendedNode) genre0.getBidiTarget().get(3)).getStringFeature());
-
- EList children = books.getChildren();
- assertEquals("book0", ((ExtendedNode) children.get(0)).getStringFeature());
- assertEquals("book1", ((ExtendedNode) children.get(1)).getStringFeature());
- assertEquals("book2", ((ExtendedNode) children.get(2)).getStringFeature());
- assertEquals("book3", ((ExtendedNode) children.get(3)).getStringFeature());
- }
- }
-
- public void testViaXRefSharedRoot() throws Exception
+ public void testEcoreEList_contains() throws Exception
{
{
- TreeNode root = createNode("root");
+ Root root = TestModel1Factory.eINSTANCE.createRoot();
- ExtendedNode book0 = createExtended("book0", root);
- ExtendedNode book1 = createExtended("book1", root);
- ExtendedNode book2 = createExtended("book2", root);
- ExtendedNode book3 = createExtended("book3", root);
+ Author author = TestModel1Factory.eINSTANCE.createAuthor();
+ author.setName("author");
- ExtendedNode genre0 = createExtended("genre0", root);
- ExtendedNode genre1 = createExtended("genre1", root);
- ExtendedNode genre2 = createExtended("genre2", root);
- ExtendedNode genre3 = createExtended("genre3", root);
+ Book book1 = TestModel1Factory.eINSTANCE.createBook();
+ book1.setName("book1");
- book0.getBidiSource().add(genre0);
- book0.getBidiSource().add(genre1);
- book0.getBidiSource().add(genre2);
- book0.getBidiSource().add(genre3);
+ Book book2 = TestModel1Factory.eINSTANCE.createBook();
+ book2.setName("book2");
- book1.getBidiSource().add(genre0);
- book1.getBidiSource().add(genre1);
- book1.getBidiSource().add(genre2);
+ Book book3 = TestModel1Factory.eINSTANCE.createBook();
+ book3.setName("book3");
- book2.getBidiSource().add(genre0);
- book2.getBidiSource().add(genre1);
-
- book3.getBidiSource().add(genre0);
- saveRoot(root, "/test/res");
- }
+ Book book4 = TestModel1Factory.eINSTANCE.createBook();
+ book4.setName("book4");
- {
- TreeNode root = (TreeNode) loadRoot("/test/res");
+ Book book5 = TestModel1Factory.eINSTANCE.createBook();
+ book5.setName("book5");
- ExtendedNode genre0 = (ExtendedNode) root.getChildren().get(4);
- assertEquals("book0", ((ExtendedNode) genre0.getBidiTarget().get(0)).getStringFeature());
- assertEquals("book1", ((ExtendedNode) genre0.getBidiTarget().get(1)).getStringFeature());
- assertEquals("book2", ((ExtendedNode) genre0.getBidiTarget().get(2)).getStringFeature());
- assertEquals("book3", ((ExtendedNode) genre0.getBidiTarget().get(3)).getStringFeature());
+ Book book6 = TestModel1Factory.eINSTANCE.createBook();
+ book6.setName("book6");
EList children = root.getChildren();
- assertEquals("book0", ((ExtendedNode) children.get(0)).getStringFeature());
- assertEquals("book1", ((ExtendedNode) children.get(1)).getStringFeature());
- assertEquals("book2", ((ExtendedNode) children.get(2)).getStringFeature());
- assertEquals("book3", ((ExtendedNode) children.get(3)).getStringFeature());
- }
- }
+ children.add(author);
+ children.add(book1);
+ children.add(book2);
+ children.add(book3);
+ children.add(book4);
+ children.add(book5);
+ children.add(book6);
- public void testViaXRefChildren2() throws Exception
- {
- {
- TreeNode root = createNode("root");
-
- // Insert books into children
- ExtendedNode book0 = createExtended("book0", root);
- ExtendedNode book1 = createExtended("book1", root);
- ExtendedNode book2 = createExtended("book2", root);
- ExtendedNode book3 = createExtended("book3", root);
+ saveRoot(root, "/test/res");
+ }
- // Insert genres into children2
- ExtendedNode genre0 = createExtended("genre0");
- genre0.setParent2(root);
- ExtendedNode genre1 = createExtended("genre1");
- genre1.setParent2(root);
- ExtendedNode genre2 = createExtended("genre2");
- genre2.setParent2(root);
- ExtendedNode genre3 = createExtended("genre3");
- genre3.setParent2(root);
+ Root root = (Root) loadRoot("/test/res");
+ EList children = root.getChildren();
- book0.getBidiSource().add(genre0);
- book0.getBidiSource().add(genre1);
- book0.getBidiSource().add(genre2);
- book0.getBidiSource().add(genre3);
+ Author author = (Author) children.get(0);
+ EList books = author.getBooks();
- book1.getBidiSource().add(genre0);
- book1.getBidiSource().add(genre1);
- book1.getBidiSource().add(genre2);
+ Object book1 = children.get(1);
+ assertTrue(books.add(book1));
- book2.getBidiSource().add(genre0);
- book2.getBidiSource().add(genre1);
+ Object book2 = children.get(2);
+ assertTrue(books.add(book2));
- book3.getBidiSource().add(genre0);
- saveRoot(root, "/test/res");
- }
+ Object book3 = children.get(3);
+ assertTrue(books.add(book3));
- {
- TreeNode root = (TreeNode) loadRoot("/test/res");
+ Object book4 = children.get(4);
+ assertTrue(books.add(book4));
- ExtendedNode genre0 = (ExtendedNode) root.getChildren2().get(0);
- assertEquals("book0", ((ExtendedNode) genre0.getBidiTarget().get(0)).getStringFeature());
- assertEquals("book1", ((ExtendedNode) genre0.getBidiTarget().get(1)).getStringFeature());
- assertEquals("book2", ((ExtendedNode) genre0.getBidiTarget().get(2)).getStringFeature());
- assertEquals("book3", ((ExtendedNode) genre0.getBidiTarget().get(3)).getStringFeature());
+ Object book5 = children.get(5);
+ assertTrue(books.add(book5));
- EList children = root.getChildren();
- assertEquals("book0", ((ExtendedNode) children.get(0)).getStringFeature());
- assertEquals("book1", ((ExtendedNode) children.get(1)).getStringFeature());
- assertEquals("book2", ((ExtendedNode) children.get(2)).getStringFeature());
- assertEquals("book3", ((ExtendedNode) children.get(3)).getStringFeature());
- }
+ Object book6 = children.get(6);
+ assertTrue(books.add(book6));
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Author.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Author.java
new file mode 100644
index 0000000..006ac45
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Author.java
@@ -0,0 +1,78 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package testmodel1;
+
+
+import org.eclipse.emf.cdo.client.CDOPersistent;
+
+import org.eclipse.emf.common.util.EList;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Author</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link testmodel1.Author#getBooks <em>Books</em>}</li>
+ * <li>{@link testmodel1.Author#getName <em>Name</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see testmodel1.TestModel1Package#getAuthor()
+ * @model
+ * @generated
+ */
+public interface Author extends CDOPersistent
+{
+ /**
+ * Returns the value of the '<em><b>Books</b></em>' reference list.
+ * The list contents are of type {@link testmodel1.Book}.
+ * It is bidirectional and its opposite is '{@link testmodel1.Book#getAuthor <em>Author</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Books</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Books</em>' reference list.
+ * @see testmodel1.TestModel1Package#getAuthor_Books()
+ * @see testmodel1.Book#getAuthor
+ * @model type="testmodel1.Book" opposite="author"
+ * @generated
+ */
+ EList getBooks();
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see testmodel1.TestModel1Package#getAuthor_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link testmodel1.Author#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+} // Author \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Book.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Book.java
new file mode 100644
index 0000000..c5967ed
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Book.java
@@ -0,0 +1,86 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package testmodel1;
+
+
+import org.eclipse.emf.cdo.client.CDOPersistent;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Book</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link testmodel1.Book#getAuthor <em>Author</em>}</li>
+ * <li>{@link testmodel1.Book#getName <em>Name</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see testmodel1.TestModel1Package#getBook()
+ * @model
+ * @generated
+ */
+public interface Book extends CDOPersistent
+{
+ /**
+ * Returns the value of the '<em><b>Author</b></em>' reference.
+ * It is bidirectional and its opposite is '{@link testmodel1.Author#getBooks <em>Books</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Author</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Author</em>' reference.
+ * @see #setAuthor(Author)
+ * @see testmodel1.TestModel1Package#getBook_Author()
+ * @see testmodel1.Author#getBooks
+ * @model opposite="books"
+ * @generated
+ */
+ Author getAuthor();
+
+ /**
+ * Sets the value of the '{@link testmodel1.Book#getAuthor <em>Author</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Author</em>' reference.
+ * @see #getAuthor()
+ * @generated
+ */
+ void setAuthor(Author value);
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see testmodel1.TestModel1Package#getBook_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link testmodel1.Book#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+} // Book \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Root.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Root.java
new file mode 100644
index 0000000..841f95a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/Root.java
@@ -0,0 +1,49 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package testmodel1;
+
+
+import org.eclipse.emf.cdo.client.CDOPersistent;
+
+import org.eclipse.emf.common.util.EList;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Root</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link testmodel1.Root#getChildren <em>Children</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see testmodel1.TestModel1Package#getRoot()
+ * @model
+ * @generated
+ */
+public interface Root extends CDOPersistent
+{
+ /**
+ * Returns the value of the '<em><b>Children</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.emf.cdo.client.CDOPersistent}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Children</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Children</em>' containment reference list.
+ * @see testmodel1.TestModel1Package#getRoot_Children()
+ * @model type="org.eclipse.emf.cdo.client.CDOPersistent" containment="true"
+ * @generated
+ */
+ EList getChildren();
+
+} // Root \ 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 263f3e8..a463e61 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Factory.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Factory.java
@@ -65,6 +65,33 @@ public interface TestModel1Factory extends EFactory
EmptyRefNode createEmptyRefNode();
/**
+ * Returns a new object of class '<em>Root</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Root</em>'.
+ * @generated
+ */
+ Root createRoot();
+
+ /**
+ * Returns a new object of class '<em>Author</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Author</em>'.
+ * @generated
+ */
+ Author createAuthor();
+
+ /**
+ * Returns a new object of class '<em>Book</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Book</em>'.
+ * @generated
+ */
+ Book createBook();
+
+ /**
* 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 809be8b..fd703ae 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Package.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/TestModel1Package.java
@@ -573,6 +573,108 @@ public interface TestModel1Package extends EPackage
int EMPTY_REF_NODE_FEATURE_COUNT = TREE_NODE_FEATURE_COUNT + 1;
/**
+ * The meta object id for the '{@link testmodel1.impl.RootImpl <em>Root</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see testmodel1.impl.RootImpl
+ * @see testmodel1.impl.TestModel1PackageImpl#getRoot()
+ * @generated
+ */
+ int ROOT = 4;
+
+ /**
+ * The feature id for the '<em><b>Children</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ROOT__CHILDREN = CDOPackage.CDO_PERSISTENT_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Root</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ROOT_FEATURE_COUNT = CDOPackage.CDO_PERSISTENT_FEATURE_COUNT + 1;
+
+ /**
+ * The meta object id for the '{@link testmodel1.impl.AuthorImpl <em>Author</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see testmodel1.impl.AuthorImpl
+ * @see testmodel1.impl.TestModel1PackageImpl#getAuthor()
+ * @generated
+ */
+ int AUTHOR = 5;
+
+ /**
+ * The feature id for the '<em><b>Books</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int AUTHOR__BOOKS = CDOPackage.CDO_PERSISTENT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int AUTHOR__NAME = CDOPackage.CDO_PERSISTENT_FEATURE_COUNT + 1;
+
+ /**
+ * The number of structural features of the '<em>Author</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int AUTHOR_FEATURE_COUNT = CDOPackage.CDO_PERSISTENT_FEATURE_COUNT + 2;
+
+ /**
+ * The meta object id for the '{@link testmodel1.impl.BookImpl <em>Book</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see testmodel1.impl.BookImpl
+ * @see testmodel1.impl.TestModel1PackageImpl#getBook()
+ * @generated
+ */
+ int BOOK = 6;
+
+ /**
+ * The feature id for the '<em><b>Author</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BOOK__AUTHOR = CDOPackage.CDO_PERSISTENT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BOOK__NAME = CDOPackage.CDO_PERSISTENT_FEATURE_COUNT + 1;
+
+ /**
+ * The number of structural features of the '<em>Book</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BOOK_FEATURE_COUNT = CDOPackage.CDO_PERSISTENT_FEATURE_COUNT + 2;
+
+ /**
* Returns the meta object for class '{@link testmodel1.TreeNode <em>Tree Node</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -778,6 +880,91 @@ public interface TestModel1Package extends EPackage
EReference getEmptyRefNode_MoreReferences();
/**
+ * Returns the meta object for class '{@link testmodel1.Root <em>Root</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Root</em>'.
+ * @see testmodel1.Root
+ * @generated
+ */
+ EClass getRoot();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link testmodel1.Root#getChildren <em>Children</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Children</em>'.
+ * @see testmodel1.Root#getChildren()
+ * @see #getRoot()
+ * @generated
+ */
+ EReference getRoot_Children();
+
+ /**
+ * Returns the meta object for class '{@link testmodel1.Author <em>Author</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Author</em>'.
+ * @see testmodel1.Author
+ * @generated
+ */
+ EClass getAuthor();
+
+ /**
+ * Returns the meta object for the reference list '{@link testmodel1.Author#getBooks <em>Books</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Books</em>'.
+ * @see testmodel1.Author#getBooks()
+ * @see #getAuthor()
+ * @generated
+ */
+ EReference getAuthor_Books();
+
+ /**
+ * Returns the meta object for the attribute '{@link testmodel1.Author#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see testmodel1.Author#getName()
+ * @see #getAuthor()
+ * @generated
+ */
+ EAttribute getAuthor_Name();
+
+ /**
+ * Returns the meta object for class '{@link testmodel1.Book <em>Book</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Book</em>'.
+ * @see testmodel1.Book
+ * @generated
+ */
+ EClass getBook();
+
+ /**
+ * Returns the meta object for the reference '{@link testmodel1.Book#getAuthor <em>Author</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Author</em>'.
+ * @see testmodel1.Book#getAuthor()
+ * @see #getBook()
+ * @generated
+ */
+ EReference getBook_Author();
+
+ /**
+ * Returns the meta object for the attribute '{@link testmodel1.Book#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see testmodel1.Book#getName()
+ * @see #getBook()
+ * @generated
+ */
+ EAttribute getBook_Name();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -961,6 +1148,76 @@ public interface TestModel1Package extends EPackage
*/
EReference EMPTY_REF_NODE__MORE_REFERENCES = eINSTANCE.getEmptyRefNode_MoreReferences();
+ /**
+ * The meta object literal for the '{@link testmodel1.impl.RootImpl <em>Root</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see testmodel1.impl.RootImpl
+ * @see testmodel1.impl.TestModel1PackageImpl#getRoot()
+ * @generated
+ */
+ EClass ROOT = eINSTANCE.getRoot();
+
+ /**
+ * The meta object literal for the '<em><b>Children</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ROOT__CHILDREN = eINSTANCE.getRoot_Children();
+
+ /**
+ * The meta object literal for the '{@link testmodel1.impl.AuthorImpl <em>Author</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see testmodel1.impl.AuthorImpl
+ * @see testmodel1.impl.TestModel1PackageImpl#getAuthor()
+ * @generated
+ */
+ EClass AUTHOR = eINSTANCE.getAuthor();
+
+ /**
+ * The meta object literal for the '<em><b>Books</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference AUTHOR__BOOKS = eINSTANCE.getAuthor_Books();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute AUTHOR__NAME = eINSTANCE.getAuthor_Name();
+
+ /**
+ * The meta object literal for the '{@link testmodel1.impl.BookImpl <em>Book</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see testmodel1.impl.BookImpl
+ * @see testmodel1.impl.TestModel1PackageImpl#getBook()
+ * @generated
+ */
+ EClass BOOK = eINSTANCE.getBook();
+
+ /**
+ * The meta object literal for the '<em><b>Author</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference BOOK__AUTHOR = eINSTANCE.getBook_Author();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute BOOK__NAME = eINSTANCE.getBook_Name();
+
}
} //TestModel1Package
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/AuthorImpl.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/AuthorImpl.java
new file mode 100644
index 0000000..1857caa
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/AuthorImpl.java
@@ -0,0 +1,261 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+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.util.EObjectWithInverseResolvingEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import testmodel1.Author;
+import testmodel1.Book;
+import testmodel1.TestModel1Package;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Author</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link testmodel1.impl.AuthorImpl#getBooks <em>Books</em>}</li>
+ * <li>{@link testmodel1.impl.AuthorImpl#getName <em>Name</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class AuthorImpl extends CDOPersistentImpl implements Author
+{
+ /**
+ * The cached value of the '{@link #getBooks() <em>Books</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getBooks()
+ * @generated
+ * @ordered
+ */
+ protected EList books = null;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AuthorImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return TestModel1Package.Literals.AUTHOR;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList getBooks()
+ {
+ cdoLoad();
+ if (books == null)
+ {
+ books = new EObjectWithInverseResolvingEList(Book.class, this,
+ TestModel1Package.AUTHOR__BOOKS, TestModel1Package.BOOK__AUTHOR);
+ }
+ return books;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ cdoLoad();
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ cdoLoad();
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, TestModel1Package.AUTHOR__NAME,
+ oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID,
+ NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.AUTHOR__BOOKS:
+ return ((InternalEList) getBooks()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID,
+ NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.AUTHOR__BOOKS:
+ return ((InternalEList) getBooks()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.AUTHOR__BOOKS:
+ return getBooks();
+ case TestModel1Package.AUTHOR__NAME:
+ return getName();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.AUTHOR__BOOKS:
+ getBooks().clear();
+ getBooks().addAll((Collection) newValue);
+ return;
+ case TestModel1Package.AUTHOR__NAME:
+ setName((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.AUTHOR__BOOKS:
+ getBooks().clear();
+ return;
+ case TestModel1Package.AUTHOR__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.AUTHOR__BOOKS:
+ return books != null && !books.isEmpty();
+ case TestModel1Package.AUTHOR__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //AuthorImpl \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/BookImpl.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/BookImpl.java
new file mode 100644
index 0000000..89fb5ee
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/BookImpl.java
@@ -0,0 +1,321 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package testmodel1.impl;
+
+
+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.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import testmodel1.Author;
+import testmodel1.Book;
+import testmodel1.TestModel1Package;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Book</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link testmodel1.impl.BookImpl#getAuthor <em>Author</em>}</li>
+ * <li>{@link testmodel1.impl.BookImpl#getName <em>Name</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class BookImpl extends CDOPersistentImpl implements Book
+{
+ /**
+ * The cached value of the '{@link #getAuthor() <em>Author</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAuthor()
+ * @generated
+ * @ordered
+ */
+ protected Author author = null;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected BookImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return TestModel1Package.Literals.BOOK;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Author getAuthor()
+ {
+ cdoLoad();
+ if (author != null && author.eIsProxy())
+ {
+ InternalEObject oldAuthor = (InternalEObject) author;
+ author = (Author) eResolveProxy(oldAuthor);
+ if (author != oldAuthor)
+ {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, TestModel1Package.BOOK__AUTHOR,
+ oldAuthor, author));
+ }
+ }
+ return author;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Author basicGetAuthor()
+ {
+ cdoLoad();
+ return author;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetAuthor(Author newAuthor, NotificationChain msgs)
+ {
+ cdoLoad();
+ Author oldAuthor = author;
+ author = newAuthor;
+ if (eNotificationRequired())
+ {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
+ TestModel1Package.BOOK__AUTHOR, oldAuthor, newAuthor);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setAuthor(Author newAuthor)
+ {
+ cdoLoad();
+ if (newAuthor != author)
+ {
+ NotificationChain msgs = null;
+ if (author != null)
+ msgs = ((InternalEObject) author).eInverseRemove(this, TestModel1Package.AUTHOR__BOOKS,
+ Author.class, msgs);
+ if (newAuthor != null)
+ msgs = ((InternalEObject) newAuthor).eInverseAdd(this, TestModel1Package.AUTHOR__BOOKS,
+ Author.class, msgs);
+ msgs = basicSetAuthor(newAuthor, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, TestModel1Package.BOOK__AUTHOR,
+ newAuthor, newAuthor));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ cdoLoad();
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ cdoLoad();
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, TestModel1Package.BOOK__NAME, oldName,
+ name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID,
+ NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.BOOK__AUTHOR:
+ if (author != null)
+ msgs = ((InternalEObject) author).eInverseRemove(this, TestModel1Package.AUTHOR__BOOKS,
+ Author.class, msgs);
+ return basicSetAuthor((Author) otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID,
+ NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.BOOK__AUTHOR:
+ return basicSetAuthor(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.BOOK__AUTHOR:
+ if (resolve) return getAuthor();
+ return basicGetAuthor();
+ case TestModel1Package.BOOK__NAME:
+ return getName();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.BOOK__AUTHOR:
+ setAuthor((Author) newValue);
+ return;
+ case TestModel1Package.BOOK__NAME:
+ setName((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.BOOK__AUTHOR:
+ setAuthor((Author) null);
+ return;
+ case TestModel1Package.BOOK__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.BOOK__AUTHOR:
+ return author != null;
+ case TestModel1Package.BOOK__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //BookImpl \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/RootImpl.java b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/RootImpl.java
new file mode 100644
index 0000000..9c71990
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/RootImpl.java
@@ -0,0 +1,170 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package testmodel1.impl;
+
+
+import java.util.Collection;
+
+import org.eclipse.emf.cdo.client.CDOPersistent;
+
+import org.eclipse.emf.cdo.client.impl.CDOPersistentImpl;
+
+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.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import testmodel1.Root;
+import testmodel1.TestModel1Package;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Root</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link testmodel1.impl.RootImpl#getChildren <em>Children</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class RootImpl extends CDOPersistentImpl implements Root
+{
+ /**
+ * The cached value of the '{@link #getChildren() <em>Children</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChildren()
+ * @generated
+ * @ordered
+ */
+ protected EList children = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected RootImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return TestModel1Package.Literals.ROOT;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList getChildren()
+ {
+ cdoLoad();
+ if (children == null)
+ {
+ children = new EObjectContainmentEList(CDOPersistent.class, this,
+ TestModel1Package.ROOT__CHILDREN);
+ }
+ return children;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID,
+ NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.ROOT__CHILDREN:
+ return ((InternalEList) getChildren()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.ROOT__CHILDREN:
+ return getChildren();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.ROOT__CHILDREN:
+ getChildren().clear();
+ getChildren().addAll((Collection) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.ROOT__CHILDREN:
+ getChildren().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case TestModel1Package.ROOT__CHILDREN:
+ return children != null && !children.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //RootImpl \ No newline at end of file
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 2441616..b8d444f 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
@@ -83,6 +83,12 @@ public class TestModel1FactoryImpl extends EFactoryImpl implements TestModel1Fac
return createEmptyNode();
case TestModel1Package.EMPTY_REF_NODE:
return createEmptyRefNode();
+ case TestModel1Package.ROOT:
+ return createRoot();
+ case TestModel1Package.AUTHOR:
+ return createAuthor();
+ case TestModel1Package.BOOK:
+ return createBook();
default:
throw new IllegalArgumentException("The class '" + eClass.getName()
+ "' is not a valid classifier");
@@ -138,6 +144,39 @@ public class TestModel1FactoryImpl extends EFactoryImpl implements TestModel1Fac
* <!-- end-user-doc -->
* @generated
*/
+ public Root createRoot()
+ {
+ RootImpl root = new RootImpl();
+ return root;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Author createAuthor()
+ {
+ AuthorImpl author = new AuthorImpl();
+ return author;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Book createBook()
+ {
+ BookImpl book = new BookImpl();
+ return book;
+ }
+
+ /**
+ * <!-- 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 71d5261..018ce23 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
@@ -15,9 +15,12 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
+import testmodel1.Author;
+import testmodel1.Book;
import testmodel1.EmptyNode;
import testmodel1.EmptyRefNode;
import testmodel1.ExtendedNode;
+import testmodel1.Root;
import testmodel1.TestModel1Factory;
import testmodel1.TestModel1Package;
import testmodel1.TreeNode;
@@ -60,6 +63,27 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac
private EClass emptyRefNodeEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass rootEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass authorEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass bookEClass = 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.
@@ -330,6 +354,86 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getRoot()
+ {
+ return rootEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getRoot_Children()
+ {
+ return (EReference) rootEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getAuthor()
+ {
+ return authorEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getAuthor_Books()
+ {
+ return (EReference) authorEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getAuthor_Name()
+ {
+ return (EAttribute) authorEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getBook()
+ {
+ return bookEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getBook_Author()
+ {
+ return (EReference) bookEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getBook_Name()
+ {
+ return (EAttribute) bookEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public TestModel1Factory getTestModel1Factory()
{
return (TestModel1Factory) getEFactoryInstance();
@@ -377,6 +481,17 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac
emptyRefNodeEClass = createEClass(EMPTY_REF_NODE);
createEReference(emptyRefNodeEClass, EMPTY_REF_NODE__MORE_REFERENCES);
+
+ rootEClass = createEClass(ROOT);
+ createEReference(rootEClass, ROOT__CHILDREN);
+
+ authorEClass = createEClass(AUTHOR);
+ createEReference(authorEClass, AUTHOR__BOOKS);
+ createEAttribute(authorEClass, AUTHOR__NAME);
+
+ bookEClass = createEClass(BOOK);
+ createEReference(bookEClass, BOOK__AUTHOR);
+ createEAttribute(bookEClass, BOOK__NAME);
}
/**
@@ -412,6 +527,9 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac
extendedNodeEClass.getESuperTypes().add(this.getTreeNode());
emptyNodeEClass.getESuperTypes().add(this.getTreeNode());
emptyRefNodeEClass.getESuperTypes().add(this.getTreeNode());
+ rootEClass.getESuperTypes().add(theCDOPackage.getCDOPersistent());
+ authorEClass.getESuperTypes().add(theCDOPackage.getCDOPersistent());
+ bookEClass.getESuperTypes().add(theCDOPackage.getCDOPersistent());
// Initialize classes and features; add operations and parameters
initEClass(treeNodeEClass, TreeNode.class, "TreeNode", !IS_ABSTRACT, !IS_INTERFACE,
@@ -473,6 +591,30 @@ public class TestModel1PackageImpl extends EPackageImpl implements TestModel1Pac
null, 0, -1, EmptyRefNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(rootEClass, Root.class, "Root", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getRoot_Children(), theCDOPackage.getCDOPersistent(), null, "children", null, 0,
+ -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
+ !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(authorEClass, Author.class, "Author", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getAuthor_Books(), this.getBook(), this.getBook_Author(), "books", null, 0, -1,
+ Author.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
+ IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getAuthor_Name(), ecorePackage.getEString(), "name", null, 0, 1, Author.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
+
+ initEClass(bookEClass, Book.class, "Book", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getBook_Author(), this.getAuthor(), this.getAuthor_Books(), "author", null, 0,
+ 1, Book.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
+ IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getBook_Name(), ecorePackage.getEString(), "name", null, 0, 1, Book.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
+
// 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 4f38fe2..dbc8730 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
@@ -223,7 +223,7 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode
*/
public void setParent(TreeNode newParent)
{
-
+ cdoLoad();
if (newParent != eInternalContainer()
|| (eContainerFeatureID != TestModel1Package.TREE_NODE__PARENT && newParent != null))
{
@@ -290,7 +290,7 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode
*/
public void setParent2(TreeNode newParent2)
{
-
+ cdoLoad();
if (newParent2 != eInternalContainer()
|| (eContainerFeatureID != TestModel1Package.TREE_NODE__PARENT2 && newParent2 != null))
{
@@ -348,7 +348,7 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode
*/
public TreeNode getReference()
{
-
+ cdoLoad();
if (reference != null && reference.eIsProxy())
{
InternalEObject oldReference = (InternalEObject) reference;
@@ -396,7 +396,7 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode
*/
public TreeNode getSourceRef()
{
-
+ cdoLoad();
if (sourceRef != null && sourceRef.eIsProxy())
{
InternalEObject oldSourceRef = (InternalEObject) sourceRef;
@@ -451,7 +451,7 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode
*/
public void setSourceRef(TreeNode newSourceRef)
{
-
+ cdoLoad();
if (newSourceRef != sourceRef)
{
NotificationChain msgs = null;
@@ -476,7 +476,7 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode
*/
public TreeNode getTargetRef()
{
-
+ cdoLoad();
if (targetRef != null && targetRef.eIsProxy())
{
InternalEObject oldTargetRef = (InternalEObject) targetRef;
@@ -531,7 +531,7 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode
*/
public void setTargetRef(TreeNode newTargetRef)
{
-
+ cdoLoad();
if (newTargetRef != targetRef)
{
NotificationChain msgs = null;
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 6531ff5..5a7192d 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
@@ -105,6 +105,21 @@ public class TestModel1AdapterFactory extends AdapterFactoryImpl
return createEmptyRefNodeAdapter();
}
+ public Object caseRoot(Root object)
+ {
+ return createRootAdapter();
+ }
+
+ public Object caseAuthor(Author object)
+ {
+ return createAuthorAdapter();
+ }
+
+ public Object caseBook(Book object)
+ {
+ return createBookAdapter();
+ }
+
public Object caseCDOPersistable(CDOPersistable object)
{
return createCDOPersistableAdapter();
@@ -195,6 +210,51 @@ public class TestModel1AdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link testmodel1.Root <em>Root</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.Root
+ * @generated
+ */
+ public Adapter createRootAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link testmodel1.Author <em>Author</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.Author
+ * @generated
+ */
+ public Adapter createAuthorAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link testmodel1.Book <em>Book</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.Book
+ * @generated
+ */
+ public Adapter createBookAdapter()
+ {
+ 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 546df88..1c8f6a0 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
@@ -144,6 +144,33 @@ public class TestModel1Switch
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case TestModel1Package.ROOT:
+ {
+ Root root = (Root) theEObject;
+ Object result = caseRoot(root);
+ if (result == null) result = caseCDOPersistent(root);
+ if (result == null) result = caseCDOPersistable(root);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case TestModel1Package.AUTHOR:
+ {
+ Author author = (Author) theEObject;
+ Object result = caseAuthor(author);
+ if (result == null) result = caseCDOPersistent(author);
+ if (result == null) result = caseCDOPersistable(author);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case TestModel1Package.BOOK:
+ {
+ Book book = (Book) theEObject;
+ Object result = caseBook(book);
+ if (result == null) result = caseCDOPersistent(book);
+ if (result == null) result = caseCDOPersistable(book);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -214,6 +241,54 @@ public class TestModel1Switch
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>Root</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>Root</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public Object caseRoot(Root object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpretting the object as an instance of '<em>Author</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>Author</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public Object caseAuthor(Author object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpretting the object as an instance of '<em>Book</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>Book</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public Object caseBook(Book object)
+ {
+ return null;
+ }
+
+ /**
* Returns the result of interpretting the object as an instance of '<em>Persistable</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;