summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-08-13 03:44:16 (EDT)
committerEike Stepper2006-08-13 03:44:16 (EDT)
commit9ab034ae86e54fcc64ba1718a1b61e7fd5792b6b (patch)
tree04884fb97159df8e5d03d96e25a09e5380c6802f
parent2f7d34e885cc9fb942c8e08ac313ed0de6cefbae (diff)
downloadcdo-9ab034ae86e54fcc64ba1718a1b61e7fd5792b6b.zip
cdo-9ab034ae86e54fcc64ba1718a1b61e7fd5792b6b.tar.gz
cdo-9ab034ae86e54fcc64ba1718a1b61e7fd5792b6b.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/BasicTest.java174
1 files changed, 87 insertions, 87 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 e1ab807..9658575 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
@@ -19,93 +19,93 @@ import testmodel1.TreeNode;
@SuppressWarnings("unused")
public class BasicTest extends AbstractModel1Test
{
- // public void testSimple() throws Exception
- // {
- // final String RESOURCE = "/test/res";
- // final String ROOT = "root";
- // final String[] CHILDREN = { "a", "b", "c"};
- //
- // // Execution
- // {
- // TreeNode root = createNode(ROOT);
- // for (String name : CHILDREN)
- // createNode(name, root);
- //
- // saveRoot(root, RESOURCE);
- // }
- //
- // // Verification
- // {
- // TreeNode root = (TreeNode) loadRoot(RESOURCE);
- // assertNode(ROOT, root);
- //
- // EList children = root.getChildren();
- // assertChildren(CHILDREN, children);
- // }
- // }
- //
- // public void testContainment() throws Exception
- // {
- // final String RESOURCE = "/test/res";
- // final String ROOT = "root";
- // final String[] CHILDREN_A = { "a1", "a2", "a3", "a4"};
- // final String[] CHILDREN_B = { "b1", "b2", "b3", "b4"};
- //
- // // Execution
- // {
- // TreeNode root = createNode(ROOT);
- // TreeNode a = root;
- // for (String name : CHILDREN_A)
- // a = createNode(name, a);
- //
- // TreeNode b = root;
- // for (String name : CHILDREN_B)
- // b = createNode(name, b);
- //
- // saveRoot(root, RESOURCE);
- // }
- //
- // // Verification
- // {
- // TreeNode root = (TreeNode) loadRoot(RESOURCE);
- // assertNode(ROOT, root);
- // assertPath(CHILDREN_A, root);
- // assertPath(CHILDREN_B, root);
- // }
- // }
- //
- // public void testXRefAlreadyLoaded() throws Exception
- // {
- // final String RESOURCE = "/test/res";
- // final String ROOT = "root";
- // final String[] CHILDREN_A = { "a1", "a2", "a3", "a4"};
- // final String[] CHILDREN_B = { "b1", "b2", "b3", "b4"};
- //
- // // Execution
- // {
- // TreeNode root = createNode(ROOT);
- // TreeNode a = root;
- // for (String name : CHILDREN_A)
- // a = createNode(name, a);
- //
- // TreeNode b = root;
- // for (String name : CHILDREN_B)
- // b = createNode(name, b);
- //
- // a.getReferences().add(b);
- // saveRoot(root, RESOURCE);
- // }
- //
- // // Verification
- // {
- // TreeNode root = (TreeNode) loadRoot(RESOURCE);
- // assertNode(ROOT, root);
- //
- // TreeNode a = findPath(CHILDREN_A, root);
- // TreeNode b = findPath(CHILDREN_B, root); // PRE-LOAD
- // assertNode(CHILDREN_B[3], (TreeNode) a.getReferences().get(0));
- // }
- // }
+ public void testSimple() throws Exception
+ {
+ final String RESOURCE = "/test/res";
+ final String ROOT = "root";
+ final String[] CHILDREN = { "a", "b", "c"};
+
+ // Execution
+ {
+ TreeNode root = createNode(ROOT);
+ for (String name : CHILDREN)
+ createNode(name, root);
+
+ saveRoot(root, RESOURCE);
+ }
+
+ // Verification
+ {
+ TreeNode root = (TreeNode) loadRoot(RESOURCE);
+ assertNode(ROOT, root);
+
+ EList children = root.getChildren();
+ assertChildren(CHILDREN, children);
+ }
+ }
+
+ public void testContainment() throws Exception
+ {
+ final String RESOURCE = "/test/res";
+ final String ROOT = "root";
+ final String[] CHILDREN_A = { "a1", "a2", "a3", "a4"};
+ final String[] CHILDREN_B = { "b1", "b2", "b3", "b4"};
+
+ // Execution
+ {
+ TreeNode root = createNode(ROOT);
+ TreeNode a = root;
+ for (String name : CHILDREN_A)
+ a = createNode(name, a);
+
+ TreeNode b = root;
+ for (String name : CHILDREN_B)
+ b = createNode(name, b);
+
+ saveRoot(root, RESOURCE);
+ }
+
+ // Verification
+ {
+ TreeNode root = (TreeNode) loadRoot(RESOURCE);
+ assertNode(ROOT, root);
+ assertPath(CHILDREN_A, root);
+ assertPath(CHILDREN_B, root);
+ }
+ }
+
+ public void testXRefAlreadyLoaded() throws Exception
+ {
+ final String RESOURCE = "/test/res";
+ final String ROOT = "root";
+ final String[] CHILDREN_A = { "a1", "a2", "a3", "a4"};
+ final String[] CHILDREN_B = { "b1", "b2", "b3", "b4"};
+
+ // Execution
+ {
+ TreeNode root = createNode(ROOT);
+ TreeNode a = root;
+ for (String name : CHILDREN_A)
+ a = createNode(name, a);
+
+ TreeNode b = root;
+ for (String name : CHILDREN_B)
+ b = createNode(name, b);
+
+ a.getReferences().add(b);
+ saveRoot(root, RESOURCE);
+ }
+
+ // Verification
+ {
+ TreeNode root = (TreeNode) loadRoot(RESOURCE);
+ assertNode(ROOT, root);
+
+ TreeNode a = findPath(CHILDREN_A, root);
+ TreeNode b = findPath(CHILDREN_B, root); // PRE-LOAD
+ assertNode(CHILDREN_B[3], (TreeNode) a.getReferences().get(0));
+ }
+ }
public void testXRefNotYetLoaded() throws Exception
{