diff options
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/BasicTest.java | 33 | ||||
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TreeNodeImpl.java | 10 |
2 files changed, 34 insertions, 9 deletions
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 ba1e2313a7..c717f55888 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 @@ -226,6 +226,39 @@ public class BasicTest extends AbstractModel1Test } } + public void testInterResourceXRef3() throws Exception + { + final String RESOURCE1 = "/test/res1"; + final String RESOURCE2 = "/test/res2"; + final String ROOT1 = "root1"; + final String ROOT2 = "root2"; + final String CHILD2 = "child2"; + + { // Execution + TreeNode root1 = createNode(ROOT1); + saveRoot(root1, RESOURCE1); + + TreeNode root2 = createNode(ROOT2); + TreeNode child2 = createNode(CHILD2, root2); + child2.getReferences().add(root1); + saveRoot(root2, RESOURCE2); + } + + { // Verification + TreeNode root2 = (TreeNode) loadRoot(RESOURCE2); + assertNode(ROOT2, root2); + assertResource(RESOURCE2, root2); + + TreeNode child2 = (TreeNode) root2.getChildren().get(0); + assertNode(CHILD2, child2); + assertResource(RESOURCE2, child2); + + TreeNode root1 = (TreeNode) child2.getReferences().get(0); + assertNode(ROOT1, root1); + assertResource(RESOURCE1, root1); + } + } + public void testGetContainer() throws Exception { final String RESOURCE = "/test/res"; 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 4a084bd976..63b1ab1e47 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 @@ -158,7 +158,7 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode */ public TreeNode getParent() { - + cdoLoad(); if (eContainerFeatureID != TestModel1Package.TREE_NODE__PARENT) return null; return (TreeNode) eContainer(); } @@ -209,7 +209,6 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode */ public EList getChildren() { - cdoLoad(); if (children == null) { @@ -226,7 +225,6 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode */ public EList getReferences() { - cdoLoad(); if (references == null) { @@ -243,7 +241,6 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode */ public boolean isBooleanFeature() { - cdoLoad(); return booleanFeature; } @@ -255,7 +252,6 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode */ public void setBooleanFeature(boolean newBooleanFeature) { - cdoLoad(); boolean oldBooleanFeature = booleanFeature; booleanFeature = newBooleanFeature; @@ -271,7 +267,6 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode */ public int getIntFeature() { - cdoLoad(); return intFeature; } @@ -283,7 +278,6 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode */ public void setIntFeature(int newIntFeature) { - cdoLoad(); int oldIntFeature = intFeature; intFeature = newIntFeature; @@ -299,7 +293,6 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode */ public String getStringFeature() { - cdoLoad(); return stringFeature; } @@ -311,7 +304,6 @@ public class TreeNodeImpl extends CDOPersistentImpl implements TreeNode */ public void setStringFeature(String newStringFeature) { - cdoLoad(); String oldStringFeature = stringFeature; stringFeature = newStringFeature; |