diff options
author | mtaal | 2007-03-18 22:28:04 +0000 |
---|---|---|
committer | mtaal | 2007-03-18 22:28:04 +0000 |
commit | aec57c81bdef2be3f1e9cbbf1a42a0eba2c33670 (patch) | |
tree | f245c1f412c2c6729fbaa4c2b2e966f4222c9482 /tests | |
parent | 9cf2ea9ced3561267d51a00a75ce4e555113587f (diff) | |
download | org.eclipse.emf.teneo-aec57c81bdef2be3f1e9cbbf1a42a0eba2c33670.tar.gz org.eclipse.emf.teneo-aec57c81bdef2be3f1e9cbbf1a42a0eba2c33670.tar.xz org.eclipse.emf.teneo-aec57c81bdef2be3f1e9cbbf1a42a0eba2c33670.zip |
Solved issue around multiple inheritance and naming of join tables/columns
Diffstat (limited to 'tests')
2 files changed, 100 insertions, 4 deletions
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/EnumTestAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/EnumTestAction.java index 38f1cc205..08b9c5f6e 100644 --- a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/EnumTestAction.java +++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/EnumTestAction.java @@ -11,7 +11,7 @@ * Martin Taal * </copyright> * - * $Id: EnumTestAction.java,v 1.4 2007/02/01 12:35:37 mtaal Exp $ + * $Id: EnumTestAction.java,v 1.5 2007/03/18 22:28:04 mtaal Exp $ */ package org.eclipse.emf.teneo.test.issues; @@ -30,7 +30,7 @@ import org.eclipse.emf.teneo.test.stores.TestStore; * Tests nullable enum and enum as id * * @author <a href="mailto:mtaal@elver.org">Martin Taal</a> - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ */ public class EnumTestAction extends AbstractTestAction { /** @@ -73,9 +73,9 @@ public class EnumTestAction extends AbstractTestAction { { store.beginTransaction(); - List list = store.getObjects(Item.class); + List<?> list = store.getObjects(Item.class); assertEquals(2, list.size()); - for (Iterator it = list.iterator(); it.hasNext();) { + for (Iterator<?> it = list.iterator(); it.hasNext();) { Item item = (Item) it.next(); if (item.getItemType().getValue() == ItemType.PRODUCT_FAMILY) { assertTrue(item.getNullableItemType() == null); diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MultipleInheritanceAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MultipleInheritanceAction.java new file mode 100644 index 000000000..1d5e222ec --- /dev/null +++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MultipleInheritanceAction.java @@ -0,0 +1,96 @@ +/** + * <copyright> + * + * Copyright (c) 2005, 2006, 2007 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: MultipleInheritanceAction.java,v 1.1 2007/03/18 22:28:04 mtaal Exp $ + */ + +package org.eclipse.emf.teneo.test.issues; + +import java.io.IOException; +import java.util.Collections; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.teneo.test.AbstractTestAction; +import org.eclipse.emf.teneo.test.StoreTestException; +import org.eclipse.emf.teneo.test.stores.TestStore; + +import testinheritance.NameValuePair; +import testinheritance.SomeResource; +import testinheritance.TestinheritanceFactory; +import testinheritance.TestinheritancePackage; + +/** + * Tests nullable enum and enum as id + * + * @author <a href="mailto:mtaal@elver.org">Martin Taal</a> + * @version $Revision: 1.1 $ + */ +public class MultipleInheritanceAction extends AbstractTestAction { + /** + * Constructor. + * + * @param arg0 + */ + public MultipleInheritanceAction() { + super(TestinheritancePackage.eINSTANCE); + } + + /** Creates an item, an address and links them to a po. */ + public void doAction(TestStore store) { + store.disableDrop(); + try { + Resource res = null; + try { + res = store.getResource(); + res.load(Collections.EMPTY_MAP); + SomeResource someResource = TestinheritanceFactory.eINSTANCE.createSomeResource(); + someResource.setAnotherProperty(42); + someResource.setProperty("foo"); + NameValuePair nv = TestinheritanceFactory.eINSTANCE.createNameValuePair(); + nv.setName("foo1"); + nv.setValue("bar"); + someResource.getNameValuePairs().add(nv); + res.getContents().add(someResource); + res.save(null); + } finally { + } + SomeResource someResource; + try { + res = store.getResource(); + res.load(Collections.EMPTY_MAP); + someResource = TestinheritanceFactory.eINSTANCE.createSomeResource(); + someResource.setAnotherProperty(13); + someResource.setProperty("baz"); + res.getContents().add(someResource); + res.save(null); + } finally { + } + try { + res = store.getResource(); + res.load(Collections.EMPTY_MAP); + assertNotNull(res.getContents()); + assertEquals(3, res.getContents().size()); + someResource = (SomeResource)res.getContents().get(1); + assertNotNull(someResource); + NameValuePair nv = TestinheritanceFactory.eINSTANCE.createNameValuePair(); + nv.setName("foo1"); + nv.setValue("bar"); + someResource.getNameValuePairs().add(nv); + res.save(null); + } finally { + } + } catch (IOException e) { + throw new StoreTestException("IOException", e); + } + } +} |