summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-08-14 02:41:16 (EDT)
committerEike Stepper2006-08-14 02:41:16 (EDT)
commit1bd1bc5d19703aff720fa56edfb8700b7431e84d (patch)
tree1872298942f92c7022433963be10de545c12c748
parent569cb286f59f30cce08f07cab3631049c8120375 (diff)
downloadcdo-1bd1bc5d19703aff720fa56edfb8700b7431e84d.zip
cdo-1bd1bc5d19703aff720fa56edfb8700b7431e84d.tar.gz
cdo-1bd1bc5d19703aff720fa56edfb8700b7431e84d.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/BasicTest.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/testmodel1/impl/TreeNodeImpl.java10
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 ba1e231..c717f55 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 4a084bd..63b1ab1 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;