Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Dietisheim2009-08-11 14:37:08 +0000
committerAndre Dietisheim2009-08-11 14:37:08 +0000
commit177042363b68b8a47b82f774ead1f8302f81738e (patch)
tree497739762b06279841076d5470da7f6af54594ce /plugins
parent866b2d6823f32018f6319b9e508b8861ac0eeb32 (diff)
downloadcdo-177042363b68b8a47b82f774ead1f8302f81738e.tar.gz
cdo-177042363b68b8a47b82f774ead1f8302f81738e.tar.xz
cdo-177042363b68b8a47b82f774ead1f8302f81738e.zip
testcase for bug 285008 added
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_285008_Test.java62
1 files changed, 62 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_285008_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_285008_Test.java
new file mode 100644
index 0000000000..76a556f477
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_285008_Test.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
+ * 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.bugzilla;
+
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.tests.model3.Class1;
+import org.eclipse.emf.cdo.tests.model3.Model3Package;
+import org.eclipse.emf.cdo.tests.model3.subpackage.Class2;
+import org.eclipse.emf.cdo.tests.model3.subpackage.SubpackageFactory;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+
+/**
+ * Invalid listener might prevent CDOTransaction to close properly
+ * <p>
+ * See https://bugs.eclipse.org/285008
+ *
+ * @author Andre Dietisheim
+ */
+public class Bugzilla_285008_Test extends AbstractCDOTest
+{
+ public void testBugzilla_285008() throws Exception
+ {
+ {
+ CDOSession session = openSession();
+ session.getPackageRegistry().putEPackage(Model3Package.eINSTANCE);
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource res1 = transaction.createResource("/res1");
+
+ Class1 class1 = getModel3Factory().createClass1();
+ Class2 class2a = SubpackageFactory.eINSTANCE.createClass2();
+ Class2 class2b = SubpackageFactory.eINSTANCE.createClass2();
+ class1.getClass2().add(class2a);
+ class1.getClass2().add(class2b);
+
+ res1.getContents().add(class1);
+ res1.getContents().add(class2a);
+ res1.getContents().add(class2b);
+ transaction.commit();
+ session.close();
+ }
+
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource res1 = transaction.getResource("/res1");
+
+ Class1 class1 = (Class1)res1.getContents().get(0);
+ assertNotNull(class1);
+ assertTrue(class1.isSetClass2());
+ }
+ }
+}

Back to the top