Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-08-21 10:46:20 -0400
committerEike Stepper2006-08-21 10:46:20 -0400
commit3009d715dee6bfc028d308aadd2543e2daf5c40a (patch)
treedc947227edf93d4eb572bc40a8f8961566c610af /plugins/org.eclipse.emf.cdo.tests/src
parentb8caced330cd9ba5fd47c1daa4885b0387d12f73 (diff)
downloadcdo-3009d715dee6bfc028d308aadd2543e2daf5c40a.tar.gz
cdo-3009d715dee6bfc028d308aadd2543e2daf5c40a.tar.xz
cdo-3009d715dee6bfc028d308aadd2543e2daf5c40a.zip
[154522] Copy from CDO resource to XMI resource does not work
https://bugs.eclipse.org/bugs/show_bug.cgi?id=154389
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/NotificationTest.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/NotificationTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/NotificationTest.java
new file mode 100644
index 0000000000..ff0fcea2e2
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/NotificationTest.java
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (c) 2004, 2005, 2006 Eike Stepper, Fuggerstr. 39, 10777 Berlin, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.cdo.tests.model1;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+
+import testmodel1.TreeNode;
+import junit.framework.ComparisonFailure;
+
+
+public class NotificationTest extends AbstractModel1Test
+{
+ public void testOneConnection() throws Exception
+ {
+ final String RESOURCE = "/test/res";
+ final String ROOT = "root";
+ final String NEW_ROOT = "new root";
+ final long TIME_LIMIT = 100;
+
+ // Client1 creates resource
+ TreeNode root = createNode(ROOT);
+ saveRoot(root, RESOURCE);
+
+ // Client2 loads resource
+ TreeNode loaded = (TreeNode) loadRoot(RESOURCE);
+
+ // Client1 modifies and commits resource
+ root.setStringFeature(NEW_ROOT);
+ Resource resource = root.eResource();
+ resource.save(null);
+
+ // Give server and client2 enough time to get notified
+ long start = System.currentTimeMillis();
+ try
+ {
+ assertNode(NEW_ROOT, loaded);
+ }
+ catch (ComparisonFailure ex)
+ {
+ long duration = System.currentTimeMillis() - start;
+ if (duration > TIME_LIMIT) throw ex;
+ Thread.sleep(1);
+ }
+ }
+}

Back to the top