Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtaal2008-08-11 20:39:57 +0000
committermtaal2008-08-11 20:39:57 +0000
commitb986bd823b125e912f918103927ab1d4097c65b9 (patch)
tree9a9fb26db2e55567b75fd4592195c3de0d50b4f0 /tests/org.eclipse.emf.teneo.commontest
parentdc57433481a6d8038e3a799a018cc0cb1e16756f (diff)
downloadorg.eclipse.emf.teneo-b986bd823b125e912f918103927ab1d4097c65b9.tar.gz
org.eclipse.emf.teneo-b986bd823b125e912f918103927ab1d4097c65b9.tar.xz
org.eclipse.emf.teneo-b986bd823b125e912f918103927ab1d4097c65b9.zip
[243348]
[243616]
Diffstat (limited to 'tests/org.eclipse.emf.teneo.commontest')
-rw-r--r--tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/emf/sample/LibraryAction.java8
-rw-r--r--tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237361Action.java65
2 files changed, 69 insertions, 4 deletions
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/emf/sample/LibraryAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/emf/sample/LibraryAction.java
index 249fadf9f..82a424979 100644
--- a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/emf/sample/LibraryAction.java
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/emf/sample/LibraryAction.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: LibraryAction.java,v 1.15 2008/02/28 07:08:15 mtaal Exp $
+ * $Id: LibraryAction.java,v 1.16 2008/08/11 20:39:57 mtaal Exp $
*/
package org.eclipse.emf.teneo.test.emf.sample;
@@ -34,7 +34,7 @@ import org.eclipse.emf.teneo.test.stores.TestStore;
* Tests the library example of emf/xsd.
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.15 $
+ * @version $Revision: 1.16 $
*/
public class LibraryAction extends AbstractTestAction {
/**
@@ -119,7 +119,7 @@ public class LibraryAction extends AbstractTestAction {
if (true) {
store.beginTransaction();
- final Writer writ = (Writer) store.getObjects(Writer.class).get(0);
+ final Writer writ = store.getObjects(Writer.class).get(0);
// store.refresh(writ);
@@ -157,7 +157,7 @@ public class LibraryAction extends AbstractTestAction {
}
}
- final Book bk = (Book) store.getObjects(Book.class).get(0);
+ final Book bk = store.getObjects(Book.class).get(0);
assertTrue(bk.eContainer() == lib);
// check if the containing feature is also set correctly
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237361Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237361Action.java
new file mode 100644
index 000000000..6df71dcc4
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237361Action.java
@@ -0,0 +1,65 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005, 2006, 2007, 2008 Springsite BV (The Netherlands) 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:
+ * Martin Taal
+ * </copyright>
+ *
+ * $Id: BZ237361Action.java,v 1.1 2008/08/11 20:39:57 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.bz237361.Bz237361Factory;
+import org.eclipse.emf.teneo.samples.issues.bz237361.Bz237361Package;
+import org.eclipse.emf.teneo.samples.issues.bz237361.Many;
+import org.eclipse.emf.teneo.samples.issues.bz237361.One;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 237361
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class BZ237361Action extends AbstractTestAction {
+ public BZ237361Action() {
+ super(new EPackage[] { Bz237361Package.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ store.disableDrop();
+ final Bz237361Factory factory = Bz237361Factory.eINSTANCE;
+ {
+ store.beginTransaction();
+ final One one = factory.createOne();
+ final Many many1 = factory.createMany();
+ many1.setName("zzz");
+ final Many many2 = factory.createMany();
+ many2.setName("aaa");
+ one.getManies().add(many1);
+ one.getManies().add(many2);
+ store.store(one);
+ store.commitTransaction();
+ }
+
+ {
+ store.beginTransaction();
+ final One one = store.getObject(One.class);
+ final Many m1 = one.getManies().get(0);
+ assertEquals("zzz", m1.getName());
+ final Many m2 = one.getManies().get(1);
+ assertEquals("aaa", m2.getName());
+ store.commitTransaction();
+ }
+ }
+} \ No newline at end of file

Back to the top