Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues')
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/AbstractReferenceAction.java116
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/AbstractTopClassAction.java103
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ224991Action.java38
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296Action.java38
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296Action.persistence.xml33
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296_2Action.java38
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296_2Action.persistence.xml470
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237361Action.java64
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237498Action.java87
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237790Action.java79
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237994Action.java64
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ247785Action.java67
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ247939Action.java66
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ249246Action.java35
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ249440Action.java46
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ253799Action.java52
-rw-r--r--tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ277546Action.java55
-rw-r--r--tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ277570Action.java79
-rw-r--r--tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ302933Action.java38
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BagDuplicateAction.java85
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/EnumTestAction.java108
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/FruitsAction.java38
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/GeneralTestAction.java143
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/InheritanceAction.java68
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/InterfaceTrueAction.java84
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/LargeMapValueAction.java72
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MTMSameAction.java91
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MainAction.java147
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MultipleInheritanceAction.java172
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/NavTopAction.java46
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/ResourceAction.java99
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/ResourceUnloadAction.java97
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SecondarytableInheritanceAction.java136
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SimplenmAction.java109
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SupInterfacesAction.java308
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/TopClassesAction.java110
-rwxr-xr-xtests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/UpdateAction.java64
37 files changed, 3545 insertions, 0 deletions
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/AbstractReferenceAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/AbstractReferenceAction.java
new file mode 100755
index 000000000..b799be5dc
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/AbstractReferenceAction.java
@@ -0,0 +1,116 @@
+/**
+ * <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: AbstractReferenceAction.java,v 1.6 2008/02/28 07:08:16 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.issues.abstractreference.AbstractreferenceFactory;
+import org.eclipse.emf.teneo.samples.issues.abstractreference.AbstractreferencePackage;
+import org.eclipse.emf.teneo.samples.issues.abstractreference.Person;
+import org.eclipse.emf.teneo.samples.issues.abstractreference.USCity;
+import org.eclipse.emf.teneo.samples.issues.abstractreference.USOfficeAddress;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests reference relations between abstract relations. This failed during compute references, the test is therefore very light.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.6 $
+ */
+public class AbstractReferenceAction extends AbstractTestAction {
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public AbstractReferenceAction() {
+ super(AbstractreferencePackage.eINSTANCE);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.teneo.test.AbstractTestAction#hibernateEnabled()
+ */
+ protected boolean hibernateEnabled() {
+ return true;
+ }
+
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.SET_DEFAULT_CASCADE_ON_NON_CONTAINMENT, "true");
+ return props;
+ }
+
+ /** Creates an item, an address and links them to a po. */
+ @Override
+ @SuppressWarnings("unchecked")
+ public void doAction(TestStore store) {
+ final AbstractreferenceFactory factory = AbstractreferenceFactory.eINSTANCE;
+
+ // create a book, writer and library
+ try {
+ {
+ Resource res = store.getResource();
+ res.load(null);
+
+ final USOfficeAddress uoa = factory.createUSOfficeAddress();
+ uoa.setName("my uoa");
+ uoa.setLocation("my location");
+ uoa.setState("state");
+
+ USCity city = factory.createUSCity();
+ city.setName("my city");
+ city.setState("mystate");
+ uoa.getCountry().add(city);
+
+ res.getContents().add(uoa);
+ res.save(null);
+
+ Person person = factory.createPerson();
+ person.setName("myname");
+ person.getAddress().add(uoa);
+
+ res.getContents().add(person);
+ res.save(null);
+ }
+
+ {
+ Resource res = store.getResource();
+ res.load(null);
+ assertEquals(2, res.getContents().size());
+ // assert(res.getContents().get(0) instanceof Person);
+ res.unload();
+ }
+
+ {
+ USOfficeAddress uoa = store.getObject(USOfficeAddress.class);
+ Object[] eobjs = store.getCrossReferencers(uoa, true);
+ assertEquals(1, eobjs.length);
+ }
+ } catch (IOException e) {
+ throw new StoreTestException("IOException during save", e);
+ }
+
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/AbstractTopClassAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/AbstractTopClassAction.java
new file mode 100755
index 000000000..b2a850a65
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/AbstractTopClassAction.java
@@ -0,0 +1,103 @@
+/**
+ * <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:
+ * InheritanceAnnotationAction.java,v 1.6 2007/03/20 23:33:38 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.math.BigInteger;
+import java.util.Collections;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.teneo.samples.issues.abstractsuper.AbstractsuperFactory;
+import org.eclipse.emf.teneo.samples.issues.abstractsuper.AbstractsuperPackage;
+import org.eclipse.emf.teneo.samples.issues.abstractsuper.DistrictUKAddress;
+import org.eclipse.emf.teneo.samples.issues.abstractsuper.UKAddress;
+import org.eclipse.emf.teneo.samples.issues.abstractsuper.USAddress;
+import org.eclipse.emf.teneo.samples.issues.abstractsuper.USState;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests https://bugs.eclipse.org/bugs/show_bug.cgi?id=220106
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.2 $
+ */
+public class AbstractTopClassAction extends AbstractTestAction {
+
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public AbstractTopClassAction() {
+ super(AbstractsuperPackage.eINSTANCE);
+ }
+
+ /** Creates simple types and tests against */
+ @Override
+ public void doAction(TestStore store) {
+ // test a simple type
+ final AbstractsuperFactory factory = AbstractsuperFactory.eINSTANCE;
+ {
+ store.beginTransaction();
+
+ final USAddress usaddress = factory.createUSAddress();
+ usaddress.setName("Montgomery");
+ usaddress.setCity("Montgomery");
+ usaddress.setState(USState.AL);
+ usaddress.setZip(new BigInteger("36101"));
+ usaddress.setStreet("Montgomery street");
+ store.store(usaddress);
+
+ // test nullable fields
+ final USAddress emptyaddress = factory.createUSAddress();
+ emptyaddress.setName("empty");
+ emptyaddress.setCity("empty");
+ emptyaddress.setStreet("empty");
+ emptyaddress.setState(USState.AL);
+ emptyaddress.setZip(new BigInteger("1231"));
+
+ store.store(usaddress);
+ store.store(emptyaddress);
+
+ // create a uk address and a uk district address
+ final UKAddress ukaddress = factory.createUKAddress();
+ ukaddress.setCity("London");
+ ukaddress.setStreet("Downingstreet 10");
+ ukaddress.setName("Primeminister");
+ ukaddress.setPostcode("0000");
+ store.store(ukaddress);
+
+ final DistrictUKAddress districtaddress = factory.createDistrictUKAddress();
+ districtaddress.setCity("district");
+ districtaddress.setDistrict("district1");
+ districtaddress.setName("My districtaddress");
+ districtaddress.setPostcode("postcode1");
+ districtaddress.setStreet("street1");
+ store.store(districtaddress);
+ store.commitTransaction();
+ }
+
+ try {
+ final Resource res = store.getResource();
+ res.load(Collections.EMPTY_MAP);
+ int cntUsAddress = 0;
+ for (Object o : res.getContents()) {
+ if (o instanceof USAddress) {
+ cntUsAddress++;
+ } else {
+ fail("Unexcepted class" + o.getClass().getName());
+ }
+ }
+ assertEquals(2, cntUsAddress);
+ } catch (Exception e) {
+ throw new StoreTestException(e.getMessage(), e);
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ224991Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ224991Action.java
new file mode 100755
index 000000000..efbec0df7
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ224991Action.java
@@ -0,0 +1,38 @@
+/**
+ * <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: BZ224991Action.java,v 1.1 2008/04/04 11:50:31 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.bz224991.Bz224991Package;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 225296
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class BZ224991Action extends AbstractTestAction {
+ public BZ224991Action() {
+ super(new EPackage[] { Bz224991Package.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296Action.java
new file mode 100755
index 000000000..0bce33961
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296Action.java
@@ -0,0 +1,38 @@
+/**
+ * <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: BZ225296Action.java,v 1.1 2008/04/04 11:50:30 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.bz225296.Bz225296Package;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 225296
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class BZ225296Action extends AbstractTestAction {
+ public BZ225296Action() {
+ super(new EPackage[] { Bz225296Package.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296Action.persistence.xml b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296Action.persistence.xml
new file mode 100755
index 000000000..cb7e17f30
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296Action.persistence.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<persistence-mapping xmlns="http://www.eclipse.org/emft/teneo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.eclipse.org/emft/teneo http://www.elver.org/xsd/teneo/persistence-mapping-hibernate.xsd">
+
+ <epackage namespace-uri="http://www.eclipse.org/emf/teneo/samples/issues/bz225296">
+ <eclass name="Block">
+ <proxy lazy="true" />
+ <table name="ops_block" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="vserver">
+ <join-column name="vserver_id" />
+ </ereference>
+ </eclass>
+
+ <eclass name="VServer">
+ <table name="ops_vserver" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="blocks">
+ <fetch>SELECT</fetch>
+ <one-to-many fetch="LAZY" indexed="false" />
+ <join-column name="vserver_id" />
+ </ereference>
+ </eclass>
+ </epackage>
+
+</persistence-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296_2Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296_2Action.java
new file mode 100755
index 000000000..0d0599877
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296_2Action.java
@@ -0,0 +1,38 @@
+/**
+ * <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: BZ225296_2Action.java,v 1.1 2008/04/06 13:44:01 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.bz225296_2.ops.OpsPackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 225296
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class BZ225296_2Action extends AbstractTestAction {
+ public BZ225296_2Action() {
+ super(new EPackage[] { OpsPackage.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296_2Action.persistence.xml b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296_2Action.persistence.xml
new file mode 100755
index 000000000..13c2bf6be
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ225296_2Action.persistence.xml
@@ -0,0 +1,470 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<persistence-mapping xmlns="http://www.eclipse.org/emft/teneo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.eclipse.org/emft/teneo http://www.elver.org/xsd/teneo/persistence-mapping-hibernate.xsd">
+
+ <epackage namespace-uri="http://www.eclipse.org/emf/teneo/samples/issues/bz225296_2">
+
+ <eclass name="Block">
+ <proxy lazy="true" />
+ <table name="ops_block" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="vserver">
+ <join-column name="vserver_id" />
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="DataCenter">
+ <table name="ops_datacenter" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="host">
+ <fetch>SUBSELECT</fetch>
+ <one-to-many fetch="LAZY" indexed="false" />
+ <join-column name="datacenter_id" />
+ </ereference>
+ <property name="description">
+ <lob />
+ <column length="64000" />
+ </property>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="Domain">
+ <table name="domain" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="systems">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" />
+ <join-table name="domain_system">
+ <join-column name="domain_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="DomainSystem">
+ <table name="domainsystem" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="domains">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" mapped-by="systems" />
+ <join-table name="domain_system">
+ <join-column name="system_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <ereference name="opsSystem">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" mapped-by="systems" />
+ <join-table name="ops_domainsystem_opssystem">
+ <join-column name="domainsystem_id" nullable="false" />
+ <inverse-join-column name="system_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <ereference name="interface">
+ <join-column name="interface_id" />
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="FailoverType">
+ <table name="ops_failovertype" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="Host">
+ <table name="ops_host" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="vserver">
+ <fetch>SUBSELECT</fetch>
+ <one-to-many fetch="LAZY" indexed="false" />
+ <join-column name="host_id" />
+ </ereference>
+ <ereference name="ip">
+ <fetch>SUBSELECT</fetch>
+ <one-to-many fetch="LAZY" indexed="false" />
+ <join-column name="host_id" />
+ </ereference>
+ <ereference name="ownIp">
+ <join-column name="ownip_id" />
+ </ereference>
+ <property name="description">
+ <lob />
+ <column length="64000" />
+ </property>
+ <property name="network">
+ <lob />
+ <column length="64000" />
+ </property>
+ <property name="providerId">
+ <lob />
+ <column length="64000" unique="true" />
+ </property>
+ <property name="block">
+ <fetch>SUBSELECT</fetch>
+ <one-to-many fetch="LAZY" indexed="false" />
+ <join-column name="host_id" />
+ </property>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+
+
+ <eclass name="HostBlock">
+ <table name="ops_hostblock" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="host">
+ <join-column name="host_id" />
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="Interface">
+ <table name="ops_interface" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="role">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" mapped-by="interface" />
+ <join-table name="ops_role_interface">
+ <join-column name="interface_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <ereference name="domainSystem">
+ <fetch>SELECT</fetch>
+ <one-to-many fetch="LAZY" indexed="false" />
+ <join-column name="interface_id" />
+ </ereference>
+ <ereference name="failoverType">
+ <join-column name="failovertype_id" />
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="IP">
+ <table name="ops_ip" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="ipName">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" mapped-by="ip" fetch="LAZY" />
+ <join-table name="ops_ip_ipname">
+ <join-column name="ip_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <ereference name="vserver">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" mapped-by="ip" />
+ <join-table name="ops_vserver_ip">
+ <join-column name="ip_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <ereference name="host">
+ <join-column name="host_id" />
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="MuninInfo">
+ <table name="ops_munininfo" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <property name="pluginName">
+ <lob />
+ <column length="64000" unique="true" />
+ </property>
+ <ereference name="role">
+ <join-column name="role_id" />
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="IPName">
+ <table name="ops_ipname" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="ip">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" />
+ <join-table name="ops_ip_ipname">
+ <join-column name="ipname_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="Parameter">
+ <table name="ops_parameter" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="Role">
+ <table name="ops_role" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="interface">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" />
+ <join-table name="ops_role_interface">
+ <join-column name="role_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <ereference name="vserver">
+ <fetch>SELECT</fetch>
+ <one-to-many fetch="LAZY" indexed="false" />
+ <join-column name="role_id" />
+ </ereference>
+ <ereference name="requiredInterface">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" />
+ <join-table name="ops_role_requredinterface">
+ <join-column name="role_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <ereference name="muninInfo">
+ <fetch>SUBSELECT</fetch>
+ <one-to-many fetch="LAZY" indexed="false" />
+ <join-column name="role_id" />
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="OpsSystem">
+ <table name="ops_opssystem" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="ownVserver">
+ <fetch>SELECT</fetch>
+ <one-to-many fetch="LAZY" indexed="false" />
+ <join-column name="own_opssystem_id" />
+ </ereference>
+ <ereference name="servingVserver">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" mapped-by="servedSystem" />
+ <join-table name="ops_vserver_opssystem">
+ <join-column name="opssystem_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <ereference name="domainSystem">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" mapped-by="opsSystem" />
+ <join-table name="ops_domainsystem_opssystem">
+ <join-column name="opssystem_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+ <eclass name="VServer">
+ <table name="ops_vserver" />
+ <property name="id">
+ <id />
+ <generated-value />
+ </property>
+ <ereference name="block">
+ <fetch>SELECT</fetch>
+ <one-to-many fetch="LAZY" indexed="false" />
+ <join-column name="vserver_id" />
+ </ereference>
+ <ereference name="servedSystem">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" />
+ <join-table name="ops_vserver_opssystem">
+ <join-column name="vserver_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <ereference name="ip">
+ <fetch>SELECT</fetch>
+ <many-to-many indexed="false" fetch="LAZY" />
+ <join-table name="ops_vserver_ip">
+ <join-column name="vserver_id" nullable="false" />
+ </join-table>
+ </ereference>
+ <ereference name="role">
+ <join-column name="role_id" />
+ </ereference>
+ <ereference name="host">
+ <join-column name="host_id" />
+ </ereference>
+ <ereference name="ownSystem">
+ <join-column name="own_opssystem_id" />
+ </ereference>
+ <property name="revision">
+ <version />
+ <column name="e_version" />
+ </property>
+ <property name="modified">
+ <column column-definition="timestamp" insertable="false"
+ updatable="false" />
+ <generated>ALWAYS</generated>
+ <temporal>TIMESTAMP</temporal>
+ </property>
+ </eclass>
+
+
+ </epackage>
+</persistence-mapping>
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 100755
index 000000000..dd0f30627
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237361Action.java
@@ -0,0 +1,64 @@
+/**
+ * <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.2 2008/09/01 13:41:52 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.2 $
+ */
+public class BZ237361Action extends AbstractTestAction {
+ public BZ237361Action() {
+ super(new EPackage[] { Bz237361Package.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ 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
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237498Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237498Action.java
new file mode 100755
index 000000000..e96500d47
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237498Action.java
@@ -0,0 +1,87 @@
+/**
+ * <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: BZ237498Action.java,v 1.3 2009/03/06 12:31:21 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.Properties;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.issues.bz237498.Bz237498Factory;
+import org.eclipse.emf.teneo.samples.issues.bz237498.Bz237498Package;
+import org.eclipse.emf.teneo.samples.issues.bz237498.Many;
+import org.eclipse.emf.teneo.samples.issues.bz237498.One;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 237498
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.3 $
+ */
+public class BZ237498Action extends AbstractTestAction {
+ public BZ237498Action() {
+ super(new EPackage[] { Bz237498Package.eINSTANCE });
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.emf.teneo.test.AbstractTestAction#getExtraConfigurationProperties
+ * ()
+ */
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.ALWAYS_MAP_LIST_AS_BAG, "true");
+ return props;
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+
+ // don't do anything for now
+ if (store.getDatabaseAdapter().getDbDriver().indexOf("hsqldb") != -1) {
+ return;
+ }
+
+ final Bz237498Factory factory = Bz237498Factory.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("aaa", m1.getName());
+ final Many m2 = one.getManies().get(1);
+ assertEquals("zzz", m2.getName());
+ store.commitTransaction();
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237790Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237790Action.java
new file mode 100755
index 000000000..98f4ec449
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237790Action.java
@@ -0,0 +1,79 @@
+/**
+ * <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: BZ237790Action.java,v 1.1 2008/06/28 23:11:49 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.Properties;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.issues.bz237790.Bz237790Factory;
+import org.eclipse.emf.teneo.samples.issues.bz237790.Bz237790Package;
+import org.eclipse.emf.teneo.samples.issues.bz237790.Many;
+import org.eclipse.emf.teneo.samples.issues.bz237790.One;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 237790
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class BZ237790Action extends AbstractTestAction {
+ public BZ237790Action() {
+ super(new EPackage[] { Bz237790Package.eINSTANCE });
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.teneo.test.AbstractTestAction#getExtraConfigurationProperties()
+ */
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.MAP_ALL_LISTS_AS_IDBAG, "true");
+ return props;
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ final Bz237790Factory factory = Bz237790Factory.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
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237994Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237994Action.java
new file mode 100755
index 000000000..203b8e716
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ237994Action.java
@@ -0,0 +1,64 @@
+/**
+ * <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: BZ237994Action.java,v 1.1 2008/06/29 14:23:08 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.bz237994.Bz237994Factory;
+import org.eclipse.emf.teneo.samples.issues.bz237994.Bz237994Package;
+import org.eclipse.emf.teneo.samples.issues.bz237994.Many;
+import org.eclipse.emf.teneo.samples.issues.bz237994.One;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 237994
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class BZ237994Action extends AbstractTestAction {
+ public BZ237994Action() {
+ super(new EPackage[] { Bz237994Package.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ final Bz237994Factory factory = Bz237994Factory.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
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ247785Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ247785Action.java
new file mode 100755
index 000000000..b57d7373c
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ247785Action.java
@@ -0,0 +1,67 @@
+/**
+ * <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: BZ247785Action.java,v 1.1 2008/09/20 21:20:11 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.bz247785.Bz247785Factory;
+import org.eclipse.emf.teneo.samples.issues.bz247785.Bz247785Package;
+import org.eclipse.emf.teneo.samples.issues.bz247785.Owner;
+import org.eclipse.emf.teneo.samples.issues.bz247785.bz247785Sub.Animal;
+import org.eclipse.emf.teneo.samples.issues.bz247785.bz247785Sub.Bz247785SubFactory;
+import org.eclipse.emf.teneo.samples.issues.bz247785.bz247785Sub.Cat;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 247939
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class BZ247785Action extends AbstractTestAction {
+ public BZ247785Action() {
+ super(new EPackage[] { Bz247785Package.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ final Bz247785Factory factory = Bz247785Factory.eINSTANCE;
+ {
+ store.beginTransaction();
+ final Owner o = factory.createOwner();
+ o.setName("n1");
+ store.store(o);
+ for (int i = 0; i < 10; i++) {
+ final Cat c = Bz247785SubFactory.eINSTANCE.createCat();
+ c.setOwner(o);
+ store.store(c);
+ }
+ for (int i = 0; i < 10; i++) {
+ final Animal a = Bz247785SubFactory.eINSTANCE.createAnimal();
+ store.store(a);
+ }
+ store.commitTransaction();
+ }
+ {
+ store.beginTransaction();
+ store.checkNumber(Cat.class, 10);
+ store.checkNumber(Animal.class, 20);
+ store.checkNumber(Owner.class, 1);
+ store.commitTransaction();
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ247939Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ247939Action.java
new file mode 100755
index 000000000..9b701ba09
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ247939Action.java
@@ -0,0 +1,66 @@
+/**
+ * <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: BZ247939Action.java,v 1.2 2008/09/20 21:25:13 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.bz247939.Animal;
+import org.eclipse.emf.teneo.samples.issues.bz247939.Bz247939Factory;
+import org.eclipse.emf.teneo.samples.issues.bz247939.Bz247939Package;
+import org.eclipse.emf.teneo.samples.issues.bz247939.Cat;
+import org.eclipse.emf.teneo.samples.issues.bz247939.Owner;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 247939
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.2 $
+ */
+public class BZ247939Action extends AbstractTestAction {
+ public BZ247939Action() {
+ super(new EPackage[] { Bz247939Package.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ final Bz247939Factory factory = Bz247939Factory.eINSTANCE;
+ {
+ store.beginTransaction();
+ final Owner o = factory.createOwner();
+ o.setName("n1");
+ store.store(o);
+ for (int i = 0; i < 10; i++) {
+ final Cat c = factory.createCat();
+ c.setOwner(o);
+ store.store(c);
+ }
+ for (int i = 0; i < 10; i++) {
+ final Animal a = factory.createAnimal();
+ store.store(a);
+ }
+ store.commitTransaction();
+ }
+ {
+ store.beginTransaction();
+ store.checkNumber(Cat.class, 10);
+ store.checkNumber(Animal.class, 20);
+ store.checkNumber(Owner.class, 1);
+ store.commitTransaction();
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ249246Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ249246Action.java
new file mode 100755
index 000000000..c744a7ddb
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ249246Action.java
@@ -0,0 +1,35 @@
+/**
+ * <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: BZ249246Action.java,v 1.2 2008/10/12 21:02:11 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.teneo.samples.issues.bz249246.Bz249246Package;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.2 $
+ */
+public class BZ249246Action extends AbstractTestAction {
+ public BZ249246Action() {
+ super(Bz249246Package.eINSTANCE);
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ249440Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ249440Action.java
new file mode 100755
index 000000000..9d5964885
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ249440Action.java
@@ -0,0 +1,46 @@
+/**
+ * <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: BZ249440Action.java,v 1.2 2008/10/12 21:02:11 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.Properties;
+
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.emf.sample.library.LibraryPackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.2 $
+ */
+public class BZ249440Action extends AbstractTestAction {
+ public BZ249440Action() {
+ super(LibraryPackage.eINSTANCE);
+ }
+
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS, "false");
+ props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRATEGY, "simple");
+ return props;
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ253799Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ253799Action.java
new file mode 100755
index 000000000..3484168b5
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ253799Action.java
@@ -0,0 +1,52 @@
+/**
+ * <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: BZ253799Action.java,v 1.1 2008/11/15 21:37:37 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.bz253799.Bz253799Factory;
+import org.eclipse.emf.teneo.samples.issues.bz253799.Bz253799Package;
+import org.eclipse.emf.teneo.samples.issues.bz253799.One;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 253799
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class BZ253799Action extends AbstractTestAction {
+ public BZ253799Action() {
+ super(new EPackage[] { Bz253799Package.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ final Bz253799Factory factory = Bz253799Factory.eINSTANCE;
+ {
+ store.beginTransaction();
+ final One one = factory.createOne();
+ try {
+ store.store(one);
+ store.commitTransaction();
+ fail();
+ } catch (Exception e) {
+ // successfull
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ277546Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ277546Action.java
new file mode 100644
index 000000000..ba62050d8
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ277546Action.java
@@ -0,0 +1,55 @@
+/**
+ * <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: BZ277546Action.java,v 1.2 2009/05/23 10:51:26 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.Properties;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.bz277546.Bz277546Factory;
+import org.eclipse.emf.teneo.samples.issues.bz277546.Bz277546Package;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 277546
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.2 $
+ */
+public class BZ277546Action extends AbstractTestAction {
+ public BZ277546Action() {
+ super(new EPackage[] { Bz277546Package.eINSTANCE });
+ }
+
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties(super.getExtraConfigurationProperties());
+ // props.put(PersistenceOptions.XSDDATE_CLASS, "java.util.Date");
+ // props.put(PersistenceOptions.USER_XSDDATETIME_TYPE, "timestamp");
+ return props;
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ final Bz277546Factory factory = Bz277546Factory.eINSTANCE;
+ store.beginTransaction();
+ store.store(factory.createDateVersion());
+ store.store(factory.createSimpleVersion());
+ store.store(factory.createAnotherVersion());
+ store.commitTransaction();
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ277570Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ277570Action.java
new file mode 100644
index 000000000..268352f3e
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ277570Action.java
@@ -0,0 +1,79 @@
+/**
+ * <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: BZ277570Action.java,v 1.3 2009/08/21 15:02:00 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.Properties;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.issues.adept.Bar;
+import org.eclipse.emf.teneo.samples.issues.adept.Biff;
+import org.eclipse.emf.teneo.samples.issues.adept.Bz277570Factory;
+import org.eclipse.emf.teneo.samples.issues.adept.Bz277570Package;
+import org.eclipse.emf.teneo.samples.issues.adept.Foo;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 277570.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.3 $
+ */
+public class BZ277570Action extends AbstractTestAction {
+ public BZ277570Action() {
+ super(new EPackage[] { Bz277570Package.eINSTANCE });
+ }
+
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties(super.getExtraConfigurationProperties());
+ props.put(PersistenceOptions.DISABLE_ECONTAINER_MAPPING, "true");
+ props.put(PersistenceOptions.ALWAYS_VERSION, "false");
+ return props;
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ final Bz277570Factory factory = Bz277570Factory.eINSTANCE;
+ store.beginTransaction();
+ {
+ final Foo foo = factory.createFoo();
+ foo.setId(1);
+ store.store(foo);
+ }
+ store.commitTransaction();
+
+ store.refresh();
+
+ final Foo foo = factory.createFoo();
+ foo.setId(1);
+ final Bar bar = factory.createBar();
+ foo.getBars().add(bar);
+ final Biff biff = factory.createBiff();
+ biff.setId(2);
+ biff.setName("name");
+ foo.getBiffs().add(biff);
+ bar.setBaz(biff);
+ bar.setId(3);
+ bar.setName("name");
+
+ store.beginTransaction();
+ store.merge(foo);
+ store.commitTransaction();
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ302933Action.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ302933Action.java
new file mode 100644
index 000000000..1805e2499
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BZ302933Action.java
@@ -0,0 +1,38 @@
+/**
+ * <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: BZ302933Action.java,v 1.2 2010/03/25 00:32:44 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.bz302933.bz302933_1.Bz302933_1Package;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for bugzilla 302933
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.2 $
+ */
+public class BZ302933Action extends AbstractTestAction {
+ public BZ302933Action() {
+ super(new EPackage[] { Bz302933_1Package.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BagDuplicateAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BagDuplicateAction.java
new file mode 100755
index 000000000..b677c45aa
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/BagDuplicateAction.java
@@ -0,0 +1,85 @@
+/**
+ * <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: BagDuplicateAction.java,v 1.4 2008/02/28 07:08:16 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.Properties;
+
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.issues.bagduplicate.BagduplicateFactory;
+import org.eclipse.emf.teneo.samples.issues.bagduplicate.BagduplicatePackage;
+import org.eclipse.emf.teneo.samples.issues.bagduplicate.Person;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests issue with bag
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.4 $
+ */
+public class BagDuplicateAction extends AbstractTestAction {
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public BagDuplicateAction() {
+ super(BagduplicatePackage.eINSTANCE);
+ }
+
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.SET_DEFAULT_CASCADE_ON_NON_CONTAINMENT, "true");
+ return props;
+ }
+
+ /** Creates an item, an address and links them to a po. */
+ @Override
+ @SuppressWarnings("unchecked")
+ public void doAction(TestStore store) {
+ {
+ store.beginTransaction();
+ Person father = BagduplicateFactory.eINSTANCE.createPerson();
+ father.setName("father");
+ Person mother = BagduplicateFactory.eINSTANCE.createPerson();
+ mother.setName("mother");
+ Person child1 = BagduplicateFactory.eINSTANCE.createPerson();
+ child1.setName("child1");
+ Person child2 = BagduplicateFactory.eINSTANCE.createPerson();
+ child2.setName("child2");
+ father.getChildren().add(child1);
+ father.getChildren().add(child2);
+ mother.getChildren().add(child1);
+ mother.getChildren().add(child2);
+ store.store(father);
+ store.store(mother);
+ store.commitTransaction();
+ }
+
+ {
+ store.beginTransaction();
+ Person father = (Person) store.query(Person.class, "name", "father", 1).get(0);
+ Person mother = (Person) store.query(Person.class, "name", "mother", 1).get(0);
+ assertEquals(2, father.getChildren().size());
+ assertEquals(2, mother.getChildren().size());
+ assertEquals(father.getChildren().get(0), mother.getChildren().get(0));
+ assertEquals(father.getChildren().get(1), mother.getChildren().get(1));
+ store.commitTransaction();
+ }
+ }
+}
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
new file mode 100755
index 000000000..6425e5e1f
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/EnumTestAction.java
@@ -0,0 +1,108 @@
+/**
+ * <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: EnumTestAction.java,v 1.6 2008/02/28 07:08:16 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.teneo.samples.issues.enumtest.EnumtestFactory;
+import org.eclipse.emf.teneo.samples.issues.enumtest.EnumtestPackage;
+import org.eclipse.emf.teneo.samples.issues.enumtest.Item;
+import org.eclipse.emf.teneo.samples.issues.enumtest.ItemType;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+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.6 $
+ */
+public class EnumTestAction extends AbstractTestAction {
+ /**
+ * Constructor.
+ *
+ * @param arg0
+ */
+ public EnumTestAction() {
+ super(EnumtestPackage.eINSTANCE);
+ }
+
+ /** Creates an item, an address and links them to a po. */
+ public void doAction(TestStore store) {
+ {
+ store.beginTransaction();
+ Item itemFamily = EnumtestFactory.eINSTANCE.createItem();
+ itemFamily.setItemType(ItemType.PRODUCT_FAMILY_LITERAL);
+ itemFamily.setNullableItemType(null);
+ store.store(itemFamily);
+ Item item = EnumtestFactory.eINSTANCE.createItem();
+ item.setItemType(ItemType.PRODUCT_LITERAL);
+ item.setNullableItemType(ItemType.PRODUCT_LITERAL);
+ store.store(item);
+ store.commitTransaction();
+ }
+
+ {
+ try {
+ store.beginTransaction();
+ Item itemFamily = EnumtestFactory.eINSTANCE.createItem();
+ itemFamily.setItemType(ItemType.PRODUCT_FAMILY_LITERAL);
+ store.store(itemFamily);
+ store.commitTransaction();
+ fail("Enum primary key does not work");
+ } catch (Exception e) {
+ // correct this should fail
+ store.rollbackTransaction();
+ }
+ }
+
+ {
+ store.beginTransaction();
+ List<?> list = store.getObjects(Item.class);
+ assertEquals(2, list.size());
+ for (Iterator<?> it = list.iterator(); it.hasNext();) {
+ Item item = (Item) it.next();
+ if (item.getItemType().getValue() == ItemType.PRODUCT_FAMILY) {
+ assertTrue(item.getNullableItemType() == null);
+ } else if (item.getItemType().getValue() == ItemType.PRODUCT) {
+ assertTrue(item.getNullableItemType().getValue() == ItemType.PRODUCT);
+ } else {
+ fail("Unknown item");
+ }
+ }
+ store.commitTransaction();
+ }
+/*
+ // do save action with a resource
+ try {
+ final Resource rs = store.getResource();
+ final Item item1 = EnumtestFactory.eINSTANCE.createItem();
+ item1.setItemType(ItemType.PRODUCT_FAMILY_LITERAL);
+ item1.setNullableItemType(null);
+ rs.getContents().add(item1);
+ final Item item2 = EnumtestFactory.eINSTANCE.createItem();
+ item2.setItemType(ItemType.PRODUCT_FAMILY_LITERAL);
+ item2.setNullableItemType(ItemType.PRODUCT_LITERAL);
+ rs.getContents().add(item2);
+ rs.save(Collections.EMPTY_MAP);
+ } catch (IOException e) {
+ throw new StoreTestException("Exception while saving resource", e);
+ }
+*/
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/FruitsAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/FruitsAction.java
new file mode 100755
index 000000000..0d5fbfb0d
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/FruitsAction.java
@@ -0,0 +1,38 @@
+/**
+ * <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: FruitsAction.java,v 1.2 2008/02/28 07:08:16 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+import tc.apple.ApplePackage;
+import tc.tree.TreePackage;
+
+/**
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.2 $
+ */
+public class FruitsAction extends AbstractTestAction {
+ public FruitsAction() {
+ super(new EPackage[] { TreePackage.eINSTANCE, ApplePackage.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/GeneralTestAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/GeneralTestAction.java
new file mode 100755
index 000000000..1414eea5d
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/GeneralTestAction.java
@@ -0,0 +1,143 @@
+/**
+ * <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: GeneralTestAction.java,v 1.4 2008/02/28 07:08:16 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.Properties;
+
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.issues.generaltest.Address;
+import org.eclipse.emf.teneo.samples.issues.generaltest.City;
+import org.eclipse.emf.teneo.samples.issues.generaltest.Contact;
+import org.eclipse.emf.teneo.samples.issues.generaltest.Country;
+import org.eclipse.emf.teneo.samples.issues.generaltest.GeneralTestFactory;
+import org.eclipse.emf.teneo.samples.issues.generaltest.GeneralTestPackage;
+import org.eclipse.emf.teneo.samples.issues.generaltest.State;
+import org.eclipse.emf.teneo.samples.issues.generaltest.TC;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * General Test, contains test cases for different issues: - 187984 - 193697 - 193697 - 188973
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.4 $ $Date: 2008/02/28 07:08:16 $
+ */
+public class GeneralTestAction extends AbstractTestAction {
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public GeneralTestAction() {
+ super(GeneralTestPackage.eINSTANCE);
+ }
+
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.SET_DEFAULT_CASCADE_ON_NON_CONTAINMENT, "false");
+ return props;
+ }
+
+ /** Doaction */
+ @Override
+ public void doAction(TestStore store) {
+ // check
+ if (store.isHibernateTestStore()) {
+ final Address a = GeneralTestFactory.eINSTANCE.createAddress();
+ a.setName("a");
+ a.setVolatileString("v1");
+ final Contact contact = GeneralTestFactory.eINSTANCE.createContact();
+ contact.setName("c");
+ a.getContacts().add(contact);
+ final City c = GeneralTestFactory.eINSTANCE.createCity();
+ c.setName("c");
+ a.setCity(c);
+ final Country country = GeneralTestFactory.eINSTANCE.createCountry();
+ country.setName("c");
+ a.setCountry(country);
+ final State s = GeneralTestFactory.eINSTANCE.createState();
+ s.setName("s");
+ a.setState(s);
+ try {
+ store.beginTransaction();
+ store.store(a);
+ store.commitTransaction();
+ fail("This should fail as 'a' references an object 'country' which is not saved automatically because cascade is set of as a default for mto");
+ } catch (Exception e) {
+ // okay, many-to-one is not cascaded
+
+ // note we can't resave a because in the IdentifierCacheHandler already an id has
+ // been
+ // assigned to a and saving this same object again will result in a
+ // staleobjectexception
+ }
+ }
+
+ // do it again but now better
+ {
+ final Address a = GeneralTestFactory.eINSTANCE.createAddress();
+ a.setName("a");
+ a.setVolatileString("v1");
+ final Contact contact = GeneralTestFactory.eINSTANCE.createContact();
+ contact.setName("c");
+ a.getContacts().add(contact);
+ final City c = GeneralTestFactory.eINSTANCE.createCity();
+ c.setName("c");
+ a.setCity(c);
+ final TC tc = GeneralTestFactory.eINSTANCE.createTC();
+ tc.setName("tc");
+ a.getTc().add(tc);
+ final Country country = GeneralTestFactory.eINSTANCE.createCountry();
+ country.setName("c");
+ a.setCountry(country);
+ final State s = GeneralTestFactory.eINSTANCE.createState();
+ s.setName("s");
+ a.setState(s);
+ store.refresh();
+ store.beginTransaction();
+ store.store(tc);
+ store.store(country);
+ store.store(a);
+ store.commitTransaction();
+ }
+
+ // and read the data
+ {
+ store.beginTransaction();
+ if (store.isHibernateTestStore()) {
+ // check call 187984
+ final City c = store.getObject(City.class);
+ final Contact contact = store.getObject(Contact.class);
+ final TC tc = store.getObject(TC.class);
+ assertNotNull("econtainer should be set", c.eContainer());
+ assertNotNull("econtainer should be set", contact.eContainer());
+ assertNotNull("econtainer should be set", tc.eContainer());
+ assertTrue("contained object should be part of parent container", ((Address) tc.eContainer()).getTc()
+ .contains(tc));
+ }
+
+ // check default transient
+ final Address a = store.getObject(Address.class);
+ assertNull("A reference to a transient class should be transient also", a.getState());
+ if (store.isHibernateTestStore()) {
+ assertEquals("v1", a.getVolatileString());
+ }
+ store.commitTransaction();
+ }
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/InheritanceAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/InheritanceAction.java
new file mode 100755
index 000000000..67bc3b969
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/InheritanceAction.java
@@ -0,0 +1,68 @@
+/**
+ * <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: InheritanceAction.java,v 1.3 2008/02/28 07:08:16 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.inheritance.InheritanceFactory;
+import org.eclipse.emf.teneo.samples.issues.inheritance.InheritancePackage;
+import org.eclipse.emf.teneo.samples.issues.inheritance.SubOne;
+import org.eclipse.emf.teneo.samples.issues.inheritance.SubTwo;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests setting resource when a single ref. relation is loaded.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.3 $
+ */
+public class InheritanceAction extends AbstractTestAction {
+
+ /**
+ *
+ *
+ * @param arg0
+ */
+ public InheritanceAction() {
+ super(new EPackage[] { InheritancePackage.eINSTANCE});
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.teneo.test.AbstractTestAction#hibernateEnabled()
+ */
+ protected boolean hibernateEnabled() {
+ return true;
+ }
+
+ /** Creates simple types and tests against */
+ public void doAction(TestStore store) {
+ // test a simple type
+ final InheritanceFactory factory = InheritanceFactory.eINSTANCE;
+ {
+ store.beginTransaction();
+ SubOne subOne = factory.createSubOne();
+ subOne.setName("subOne");
+ SubTwo subTwo = factory.createSubTwo();
+ subTwo.setName("subTwo");
+ store.store(subOne);
+ store.store(subTwo);
+ store.commitTransaction();
+ }
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/InterfaceTrueAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/InterfaceTrueAction.java
new file mode 100755
index 000000000..8521f3fa6
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/InterfaceTrueAction.java
@@ -0,0 +1,84 @@
+/**
+ * <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: InterfaceTrueAction.java,v 1.6 2008/09/17 20:28:02 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.teneo.samples.issues.interfacetrue.AddressList;
+import org.eclipse.emf.teneo.samples.issues.interfacetrue.InterfacetrueFactory;
+import org.eclipse.emf.teneo.samples.issues.interfacetrue.InterfacetruePackage;
+import org.eclipse.emf.teneo.samples.issues.interfacetrue.USAddress;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests the setting interface="true" on an eclass
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.6 $
+ */
+public class InterfaceTrueAction extends AbstractTestAction {
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public InterfaceTrueAction() {
+ super(InterfacetruePackage.eINSTANCE);
+ }
+
+ /** Creates an item, an address and links them to a po. */
+ @Override
+ public void doAction(TestStore store) {
+ {
+ store.beginTransaction();
+ USAddress usAddress = InterfacetrueFactory.eINSTANCE.createUSAddress();
+ usAddress.setName("myname");
+ usAddress.setState("mystate");
+ store.store(usAddress);
+ AddressList al = InterfacetrueFactory.eINSTANCE.createAddressList();
+ al.getAddresses().add(usAddress);
+ store.store(al);
+ store.commitTransaction();
+ }
+
+ {
+ store.beginTransaction();
+ USAddress usAddress = store.getObject(USAddress.class);
+ assertTrue("Name is not set", "myname".compareTo(usAddress.getName()) == 0);
+ assertTrue("State is not set", "mystate".compareTo(usAddress.getState()) == 0);
+ store.commitTransaction();
+ }
+
+ {
+ store.beginTransaction();
+ USAddress usAddress = InterfacetrueFactory.eINSTANCE.createUSAddress();
+ usAddress.setName("a2");
+ usAddress.setState("s2");
+ store.store(usAddress);
+ AddressList al = store.getObject(AddressList.class);
+ al.getAddresses().add(usAddress);
+ store.commitTransaction();
+ }
+
+ {
+ store.beginTransaction();
+ AddressList al = store.getObject(AddressList.class);
+ assertEquals(2, al.getAddresses().size());
+ assertTrue(null != al.getAddresses().get(0).getName());
+ store.commitTransaction();
+ }
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/LargeMapValueAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/LargeMapValueAction.java
new file mode 100755
index 000000000..e6d2d6292
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/LargeMapValueAction.java
@@ -0,0 +1,72 @@
+/**
+ * <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: LargeMapValueAction.java,v 1.2 2010/11/12 14:17:00 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.largemapvalue.LargemapvalueFactory;
+import org.eclipse.emf.teneo.samples.issues.largemapvalue.LargemapvaluePackage;
+import org.eclipse.emf.teneo.samples.issues.largemapvalue.TestElement;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Testcase for emap with large value field.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.2 $
+ */
+public class LargeMapValueAction extends AbstractTestAction {
+
+ private String largeString1;
+ private String largeString2;
+
+ public LargeMapValueAction() {
+ super(new EPackage[] { LargemapvaluePackage.eINSTANCE });
+ largeString1 = createLargeString("teneo", 600000);
+ largeString2 = createLargeString("emf", 500000);
+ }
+
+ private String createLargeString(String pattern, int length) {
+ final StringBuilder sb = new StringBuilder(pattern);
+ while (sb.length() < length) {
+ sb.append(sb.toString());
+ }
+ return sb.substring(0, length);
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ TestElement te = LargemapvalueFactory.eINSTANCE.createTestElement();
+ te.setTestProp(largeString1);
+ te.getTestMap().put("key1", largeString1.intern());
+ te.getTestMap().put("key2", largeString2.intern());
+ store.beginTransaction();
+ store.store(te);
+ store.commitTransaction();
+
+ store.beginTransaction();
+ te = store.getObject(TestElement.class);
+ assertEquals(largeString1.length(), te.getTestProp().length());
+ assertNotNull(te.getTestMap().get("key1"));
+ assertNotNull(te.getTestMap().get("key2"));
+ assertNotSame(te.getTestMap().get("key1"), largeString1);
+ assertNotSame(te.getTestMap().get("key2"), largeString2);
+ assertEquals(te.getTestMap().get("key1"), largeString1);
+ assertEquals(te.getTestMap().get("key2"), largeString2);
+ store.commitTransaction();
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MTMSameAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MTMSameAction.java
new file mode 100755
index 000000000..50f02d553
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MTMSameAction.java
@@ -0,0 +1,91 @@
+/**
+ * <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: MTMSameAction.java,v 1.4 2008/02/28 07:08:16 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.teneo.samples.issues.mtmsame.Item;
+import org.eclipse.emf.teneo.samples.issues.mtmsame.MtmsameFactory;
+import org.eclipse.emf.teneo.samples.issues.mtmsame.MtmsamePackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests an mtm relation to itself.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.4 $
+*/
+public class MTMSameAction extends AbstractTestAction {
+ /** The number of testitems created */
+ private static int NO_ITEMS = 10;
+
+ /**
+ * Constructor for ClassHierarchyParsing.
+ * @param arg0
+ */
+ public MTMSameAction() {
+ super(MtmsamePackage.eINSTANCE);
+ }
+
+ /** Creates an item, an address and links them to a po. */
+ @Override
+ @SuppressWarnings("unchecked")
+ public void doAction(TestStore store) {
+ final MtmsameFactory factory = MtmsameFactory.eINSTANCE;
+ {
+ store.beginTransaction();
+
+ final ArrayList<Item> myItems = new ArrayList<Item>();
+ for (int i = 0; i < NO_ITEMS; i++) {
+ final Item myitem = factory.createItem();
+ myitem.setName("myname_" + i);
+ myItems.add(myitem);
+ }
+ for (int i = 0; i < NO_ITEMS; i++) {
+ final Item item = myItems.get(i);
+ for (int j = 0; j < NO_ITEMS; j++) {
+ item.getYourSide().add(myItems.get(j));
+ }
+ store.store(item);
+ }
+ store.commitTransaction();
+ }
+
+ {
+ store.beginTransaction();
+ List list = store.getObjects(Item.class);
+ assertTrue(list.size() == NO_ITEMS);
+ for (int i = 0; i < list.size(); i++) {
+ assertEquals(NO_ITEMS, ((Item) list.get(i)).getYourSide().size());
+ ((Item) list.get(i)).getYourSide().remove(i);
+ }
+ store.commitTransaction();
+ }
+
+ {
+ store.beginTransaction();
+ List list = store.getObjects(Item.class);
+ assertTrue(list.size() == NO_ITEMS);
+ for (int i = 0; i < list.size(); i++) {
+ assertEquals(NO_ITEMS - 1, ((Item) list.get(i)).getYourSide().size());
+ }
+ store.commitTransaction();
+ }
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MainAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MainAction.java
new file mode 100755
index 000000000..7f69616f3
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MainAction.java
@@ -0,0 +1,147 @@
+/**
+ * <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: MainAction.java,v 1.5 2008/02/28 07:08:16 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import main.BaseComponent;
+import main.BaseGroup;
+import main.BaseObject;
+import main.ChildObject1;
+import main.ChildObject2;
+import main.ChildObject3;
+import main.ChildObject4;
+import main.MainFactory;
+import main.MainPackage;
+import main.impl.BaseGroupImpl;
+
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests issue with inheritance and polymorphic relations.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.5 $
+ */
+public class MainAction extends AbstractTestAction {
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public MainAction() {
+ super(MainPackage.eINSTANCE);
+ }
+
+ /** Creates an item, an address and links them to a po. */
+ @Override
+ public void doAction(TestStore store) {
+
+ BaseGroup mainObjectsGroup = MainFactory.eINSTANCE.createBaseGroup();
+ mainObjectsGroup.setName("mainObjectsGroup");
+
+ // =============== create basic objects ++++++++++++++++++++++
+
+ // create ChildObject1
+ ChildObject1 o1 = MainFactory.eINSTANCE.createChildObject1();
+ o1.setGroup(mainObjectsGroup);
+ o1.setName("o1_1");
+
+ ChildObject1 o2 = MainFactory.eINSTANCE.createChildObject1();
+ o2.setGroup(mainObjectsGroup);
+ o2.setName("o1_2");
+
+ ChildObject1 o3 = MainFactory.eINSTANCE.createChildObject1();
+ o3.setGroup(mainObjectsGroup);
+ o3.setName("o1_3");
+
+ ChildObject1 o4 = MainFactory.eINSTANCE.createChildObject1();
+ o4.setGroup(mainObjectsGroup);
+ o4.setName("o1_4");
+
+ ChildObject1 o5 = MainFactory.eINSTANCE.createChildObject1();
+ o5.setGroup(mainObjectsGroup);
+ o5.setName("o1_5");
+
+ // create other ChildObjects
+ ChildObject2 o11 = MainFactory.eINSTANCE.createChildObject2();
+ o11.setGroup(mainObjectsGroup);
+ o11.setName(o11.getClass().getName());
+ o11.setLength(new Integer(13));
+ o11.setObject1(o1);
+
+ ChildObject2 o12 = MainFactory.eINSTANCE.createChildObject2();
+ o12.setGroup(mainObjectsGroup);
+ o12.setName(o12.getClass().getName());
+ o12.setLength(new Integer(15));
+ o12.setObject1(o2);
+
+ ChildObject3 o13 = MainFactory.eINSTANCE.createChildObject3();
+ o13.setGroup(mainObjectsGroup);
+ o13.setName(o13.getClass().getName());
+ o13.setWidth(new Integer(6));
+ o13.setObject1(o3);
+
+ ChildObject4 o14 = MainFactory.eINSTANCE.createChildObject4();
+ o14.setGroup(mainObjectsGroup);
+ o14.setName(o14.getClass().getName());
+ o14.setThickness(new Integer(1));
+ o14.setObject1(o4);
+
+ ChildObject4 o15 = MainFactory.eINSTANCE.createChildObject4();
+ o15.setGroup(mainObjectsGroup);
+ o15.setName(o15.getClass().getName());
+ o15.setThickness(new Integer(2));
+ o15.setObject1(o5);
+ store.beginTransaction();
+ store.store(mainObjectsGroup);
+
+ store.commitTransaction();
+
+ // Reopen the transaction and query for the objects
+ store.beginTransaction();
+
+ List<?> c = store.getObjects(BaseGroupImpl.class);
+ Iterator<?> it = c.iterator();
+ BaseGroup grp = null;// not recursive to limit redondancy display
+
+ // read the TObjectsGroups
+ while (it.hasNext()) {
+ grp = (BaseGroup) it.next();
+ Collection<?> components = grp.getComponents();
+ if (components != null) {
+ Iterator<?> it2 = components.iterator();
+ while (it2.hasNext()) {
+ BaseComponent cpn = (BaseComponent) it2.next();
+ if (cpn instanceof ChildObject1) {
+ ChildObject1 co1 = (ChildObject1) cpn;
+ BaseObject bo = co1.getLinkedObject();
+ assertTrue(bo.getClass().getName().compareTo(bo.getName()) == 0);
+ assertTrue(!(bo instanceof ChildObject1));
+ }
+ }
+ }
+ }
+
+ // pm.makePersistentAll(c);
+ // notify end of display
+ store.commitTransaction();
+ }
+}
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 100755
index 000000000..ac1971902
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/MultipleInheritanceAction.java
@@ -0,0 +1,172 @@
+/**
+ * <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:
+ * MultipleInheritanceAction.java,v 1.6 2007/03/29 22:13:54 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Properties;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+import testinheritance.Child;
+import testinheritance.Child2;
+import testinheritance.NameValuePair;
+import testinheritance.ParentOne;
+import testinheritance.SomeReference;
+import testinheritance.SomeResource;
+import testinheritance.TestinheritanceFactory;
+import testinheritance.TestinheritancePackage;
+
+/**
+ * Tests multiple inheritance.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.13 $
+ */
+public class MultipleInheritanceAction extends AbstractTestAction {
+ /**
+ * Constructor.
+ *
+ * @param arg0
+ */
+ public MultipleInheritanceAction() {
+ super(TestinheritancePackage.eINSTANCE);
+ }
+
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.SET_DEFAULT_CASCADE_ON_NON_CONTAINMENT, "true");
+ // as foreign keys are not unique for this test case because of multiple inheritance
+ // todo: solve this
+ props.setProperty(PersistenceOptions.SET_FOREIGN_KEY_NAME, "false");
+ return props;
+ }
+
+ /** Test */
+ @Override
+ public void doAction(TestStore store) {
+ 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);
+ }
+
+ {
+ store.beginTransaction();
+ ParentOne po = TestinheritanceFactory.eINSTANCE.createParentOne();
+ po.setAnotherProperty(5);
+ store.store(po);
+ store.commitTransaction();
+ }
+
+ // now test mappedsuperclasses
+ {
+ store.beginTransaction();
+ final Child child = TestinheritanceFactory.eINSTANCE.createChild();
+ final SomeReference sr = TestinheritanceFactory.eINSTANCE.createSomeReference();
+ sr.setName("sr");
+ child.setSomeReference(sr);
+ child.setAge(10);
+ child.setName("myName");
+ child.setTestId(4); // this is the key!
+ store.store(child);
+ store.commitTransaction();
+ }
+
+ try {
+ store.beginTransaction();
+ final Child child = TestinheritanceFactory.eINSTANCE.createChild();
+ final SomeReference sr = TestinheritanceFactory.eINSTANCE.createSomeReference();
+ sr.setName("sr1");
+ child.setSomeReference(sr);
+ child.setAge(11);
+ child.setName("myName2");
+ child.setTestId(4); // this is the key!
+ store.store(child);
+ store.commitTransaction();
+ fail("PK is not enforced!");
+ } catch (Exception e) {
+ // should fail
+ store.rollbackTransaction();
+ }
+
+ // this child gets the id from the parent, which has a synthetic id
+ {
+ store.beginTransaction();
+ final Child2 child = TestinheritanceFactory.eINSTANCE.createChild2();
+ final SomeReference sr = TestinheritanceFactory.eINSTANCE.createSomeReference();
+ sr.setName("sr3");
+ store.store(sr);
+ child.setSomeReference(sr);
+ child.setAge(10);
+ child.setAnotherProperty(40);
+ child.setName("myName");
+ child.setTestId(4); // this is not the key!
+ store.store(child);
+ store.commitTransaction();
+ }
+ {
+ store.beginTransaction();
+ final Child2 child = TestinheritanceFactory.eINSTANCE.createChild2();
+ final SomeReference sr = TestinheritanceFactory.eINSTANCE.createSomeReference();
+ sr.setName("sr2");
+ store.store(sr);
+ child.setSomeReference(sr);
+ child.setAge(11);
+ child.setAnotherProperty(41);
+ child.setName("myName2");
+ child.setTestId(4); // this is not the key!
+ store.store(child);
+ }
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/NavTopAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/NavTopAction.java
new file mode 100755
index 000000000..5d62cafa4
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/NavTopAction.java
@@ -0,0 +1,46 @@
+/**
+ * <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: NavTopAction.java,v 1.1 2008/03/19 22:25:33 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.extension.ExtensionManager;
+import org.eclipse.emf.teneo.mapping.strategy.EntityNameStrategy;
+import org.eclipse.emf.teneo.mapping.strategy.impl.QualifyingEntityNameStrategy;
+import org.eclipse.emf.teneo.samples.issues.nav.NavPackage;
+import org.eclipse.emf.teneo.samples.issues.top.TopPackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class NavTopAction extends AbstractTestAction {
+ public NavTopAction() {
+ super(new EPackage[] { NavPackage.eINSTANCE, TopPackage.eINSTANCE });
+ }
+
+ @Override
+ public void setExtensions(ExtensionManager extensionManager) {
+ extensionManager.registerExtension(EntityNameStrategy.class.getName(), QualifyingEntityNameStrategy.class
+ .getName());
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/ResourceAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/ResourceAction.java
new file mode 100755
index 000000000..c81a73d8d
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/ResourceAction.java
@@ -0,0 +1,99 @@
+/**
+ * <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: ResourceAction.java,v 1.7 2008/04/20 10:33:25 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.teneo.resource.StoreResource;
+import org.eclipse.emf.teneo.samples.issues.resource.Head;
+import org.eclipse.emf.teneo.samples.issues.resource.Person;
+import org.eclipse.emf.teneo.samples.issues.resource.ResourceFactory;
+import org.eclipse.emf.teneo.samples.issues.resource.ResourcePackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests setting resource when a single ref. relation is loaded.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.7 $
+ */
+public class ResourceAction extends AbstractTestAction {
+
+ /**
+ *
+ *
+ * @param arg0
+ */
+ public ResourceAction() {
+ super(new EPackage[] { ResourcePackage.eINSTANCE });
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.teneo.test.AbstractTestAction#hibernateEnabled()
+ */
+ protected boolean hibernateEnabled() {
+ return true;
+ }
+
+ /** Creates simple types and tests against */
+ @Override
+ public void doAction(TestStore store) {
+ // test a simple type
+ final ResourceFactory factory = ResourceFactory.eINSTANCE;
+ {
+ store.beginTransaction();
+ Person person = factory.createPerson();
+ person.setName("me");
+ Head head = factory.createHead();
+ head.setHair("blond");
+ person.setHead(head);
+ store.store(person);
+ store.store(head);
+ store.commitTransaction();
+ }
+
+ // now use a resource to read!
+ try {
+
+ final HashMap<String, String> options = new HashMap<String, String>();
+ options.put(StoreResource.LOAD_STRATEGY_PARAM, StoreResource.ADD_TO_CONTENTS);
+ final Resource res = store.getResource("query1=select p from Person p");
+ res.load(options);
+ Iterator<?> it = res.getContents().iterator();
+ while (it.hasNext()) {
+ Object o = it.next();
+ if (!(o instanceof Person)) {
+ continue;
+ }
+ Person obj = (Person) o;
+ assertEquals(obj.eResource(), obj.getHead().eResource());
+ assertTrue(obj.eResource() != null);
+ }
+ res.unload();
+ } catch (IOException e) {
+ throw new StoreTestException("Exception", e);
+ }
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/ResourceUnloadAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/ResourceUnloadAction.java
new file mode 100755
index 000000000..3d3af42cb
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/ResourceUnloadAction.java
@@ -0,0 +1,97 @@
+/**
+ * <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: ResourceUnloadAction.java,v 1.1 2008/04/16 21:07:53 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.io.IOException;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.teneo.samples.issues.resourceunload.Book;
+import org.eclipse.emf.teneo.samples.issues.resourceunload.Library;
+import org.eclipse.emf.teneo.samples.issues.resourceunload.ResourceunloadFactory;
+import org.eclipse.emf.teneo.samples.issues.resourceunload.ResourceunloadPackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests specific unload behavior, see the emft newsgroup for posts with the topic [Teneo] Unload()
+ * questions
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class ResourceUnloadAction extends AbstractTestAction {
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public ResourceUnloadAction() {
+ super(ResourceunloadPackage.eINSTANCE);
+ }
+
+ /** Creates an item, an address and links them to a po. */
+ @Override
+ public void doAction(TestStore store) {
+ final ResourceunloadFactory factory = ResourceunloadFactory.eINSTANCE;
+
+ // create a book, writer and library
+ try {
+ {
+ Resource res = store.getResource();
+ res.load(null);
+
+ final Book book = factory.createBook();
+ book.setTitle("Fellowship of the Ring");
+
+ final Library library = factory.createLibrary();
+ library.setName("Science Fiction");
+ library.getBooks().add(book);
+
+ res.getContents().add(library);
+ res.save(null);
+ }
+
+ // walk through the structure starting from the library
+ {
+ final String qry =
+ "query1=select b from " + Book.class.getName() + " as b&query2=select l from " +
+ Library.class.getName() + " as l";
+ Resource res = store.getResource(qry);
+ res.load(null);
+ Library lib = null;
+ for (Object o : res.getContents()) {
+ if (o instanceof Library) {
+ lib = (Library) o;
+ }
+ }
+
+ assertNotNull(lib);
+ final Book b = lib.getBooks().get(0);
+ assertTrue(lib.getBooks().size() > 0);
+ assertTrue(b.eContainer() == lib);
+ assertTrue(res.getContents().contains(b));
+ res.unload();
+ assertTrue(lib.getBooks().size() > 0);
+ assertTrue(b.eContainer() == lib);
+ assertTrue(!res.getContents().contains(b));
+ }
+ } catch (IOException e) {
+ throw new StoreTestException("IOException during save", e);
+ }
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SecondarytableInheritanceAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SecondarytableInheritanceAction.java
new file mode 100755
index 000000000..9ee5b357b
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SecondarytableInheritanceAction.java
@@ -0,0 +1,136 @@
+/**
+ * <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: SecondarytableInheritanceAction.java,v 1.2 2010/02/06 18:25:53 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.issues.secondary.Person;
+import org.eclipse.emf.teneo.samples.issues.secondary.SecondaryFactory;
+import org.eclipse.emf.teneo.samples.issues.secondary.SecondaryPackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=235949
+ */
+public class SecondarytableInheritanceAction extends AbstractTestAction {
+
+ private static final String ADDRESS = "Amsterdamseweg 123, 4567AZ Amsterdam";
+
+ private static final long ID = 1;
+
+ private static final byte[] PHOTO = new byte[64 * 1024];
+
+ private static final String VERIFICATION_QUERY =
+ "SELECT * FROM GENERIC as A INNER JOIN PERSON_ADDRESS as B ON A.ID = B.ID "
+ + "INNER JOIN PERSON_PHOTO as C ON A.ID = C.ID";
+
+ public SecondarytableInheritanceAction() {
+ super(SecondaryPackage.eINSTANCE);
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ storePerson(store);
+ testPerson(store);
+ testSecondaryTables(store);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.teneo.test.AbstractTestAction#getExtraConfigurationProperties()
+ */
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.SQL_CASE_STRATEGY, "uppercase");
+ return props;
+ }
+
+ /**
+ * Stores a Person in the database.
+ */
+ private void storePerson(TestStore store) {
+ store.beginTransaction();
+
+ final Person person = SecondaryFactory.eINSTANCE.createPerson();
+ person.setId(ID);
+ person.setAddress(ADDRESS);
+ person.setPhoto(PHOTO);
+ store.store(person);
+
+ store.commitTransaction();
+ }
+
+ /**
+ * Retrieves the previously stored Person from the database and checks its attributes.
+ */
+ private void testPerson(TestStore store) {
+ store.beginTransaction();
+
+ final List<?> results = store.query(Person.class, "id", String.valueOf(ID), 1);
+ assertEquals(1, results.size());
+ final Person person = (Person) results.get(0);
+ assertEquals(ID, person.getId());
+ assertEquals(ADDRESS, person.getAddress());
+ final byte[] photo = person.getPhoto();
+ assertEquals(PHOTO.length, photo.length);
+ for (int i = 0; i < photo.length; i++) {
+ assertEquals(PHOTO[i], photo[i]);
+ }
+
+ store.commitTransaction();
+ }
+
+ /**
+ * Executes a query to verify the existence of the secondary tables.
+ */
+ private void testSecondaryTables(TestStore store) {
+ final Connection conn = store.getConnection();
+ Statement statement = null;
+ ResultSet resultSet = null;
+ try {
+ statement = conn.createStatement();
+ resultSet = statement.executeQuery(VERIFICATION_QUERY);
+ } catch (final SQLException e) {
+ throw new StoreTestException(e.getMessage(), e);
+ } finally {
+ try {
+ if (resultSet != null) {
+ resultSet.close();
+ }
+ } catch (final SQLException e) {
+ }
+ try {
+ if (statement != null) {
+ statement.close();
+ }
+ } catch (final SQLException e) {
+ }
+ }
+
+ }
+
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SimplenmAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SimplenmAction.java
new file mode 100755
index 000000000..eb1f535e2
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SimplenmAction.java
@@ -0,0 +1,109 @@
+/**
+ * <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:
+ * SimplenmAction.java,v 1.2 2007/02/01 12:35:37 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.issues.simplenm.Me;
+import org.eclipse.emf.teneo.samples.issues.simplenm.SimplenmFactory;
+import org.eclipse.emf.teneo.samples.issues.simplenm.SimplenmPackage;
+import org.eclipse.emf.teneo.samples.issues.simplenm.You;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests ordering in a nm relation.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.4 $
+ */
+public class SimplenmAction extends AbstractTestAction {
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public SimplenmAction() {
+ super(SimplenmPackage.eINSTANCE);
+ }
+
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.SET_DEFAULT_CASCADE_ON_NON_CONTAINMENT, "true");
+ return props;
+ }
+
+ /** Creates an item, an address and links them to a po. */
+ @Override
+ @SuppressWarnings("unchecked")
+ public void doAction(TestStore store) {
+ final SimplenmFactory factory = SimplenmFactory.eINSTANCE;
+
+ {
+ store.beginTransaction();
+
+ You y1 = factory.createYou();
+ y1.setName("y1");
+ You y2 = factory.createYou();
+ y2.setName("y2");
+ You y3 = factory.createYou();
+ y3.setName("y3");
+
+ Me m1 = factory.createMe();
+ m1.setName("m1");
+ Me m2 = factory.createMe();
+ m2.setName("m2");
+ Me m3 = factory.createMe();
+ m3.setName("m3");
+
+ y1.getMe().add(m1);
+ y1.getMe().add(m2);
+ y1.getMe().add(m3);
+
+ y2.getMe().add(m1);
+ y2.getMe().add(m2);
+ y2.getMe().add(m3);
+
+ y3.getMe().add(m1);
+ y3.getMe().add(m2);
+ y3.getMe().add(m3);
+
+ store.store(y1);
+ store.store(y2);
+ store.store(y3);
+
+ store.commitTransaction();
+ }
+ {
+ store.beginTransaction();
+ final Iterator it = store.getObjects(You.class).iterator();
+ while (it.hasNext()) {
+ You you = (You) it.next();
+ assertTrue(((Me) you.getMe().get(0)).getName().compareTo("m1") == 0);
+ assertTrue(((Me) you.getMe().get(1)).getName().compareTo("m2") == 0);
+ assertTrue(((Me) you.getMe().get(2)).getName().compareTo("m3") == 0);
+ }
+ store.commitTransaction();
+ }
+ {
+ store.beginTransaction();
+ final Iterator it = store.getObjects(Me.class).iterator();
+ while (it.hasNext()) {
+ Me me = (Me) it.next();
+ assertTrue(((You) me.getYou().get(0)).getName().compareTo("y1") == 0);
+ assertTrue(((You) me.getYou().get(1)).getName().compareTo("y2") == 0);
+ assertTrue(((You) me.getYou().get(2)).getName().compareTo("y3") == 0);
+ }
+ store.commitTransaction();
+ }
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SupInterfacesAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SupInterfacesAction.java
new file mode 100755
index 000000000..331ba3a70
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/SupInterfacesAction.java
@@ -0,0 +1,308 @@
+/**
+ * <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: SupInterfacesAction.java,v 1.1 2008/09/15 11:33:40 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.issues.library.Book;
+import org.eclipse.emf.teneo.samples.issues.library.BookCategory;
+import org.eclipse.emf.teneo.samples.issues.library.Library;
+import org.eclipse.emf.teneo.samples.issues.library.LibraryFactory;
+import org.eclipse.emf.teneo.samples.issues.library.LibraryPackage;
+import org.eclipse.emf.teneo.samples.issues.library.Writer;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+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.1 $
+ */
+public class SupInterfacesAction extends AbstractTestAction {
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public SupInterfacesAction() {
+ super(LibraryPackage.eINSTANCE);
+ }
+
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.DEFAULT_CACHE_STRATEGY, "READ_WRITE");
+ props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");
+ props.setProperty(PersistenceOptions.DEFAULT_VARCHAR_LENGTH, "50");
+ return props;
+ }
+
+ /** Creates an item, an address and links them to a po. */
+ @Override
+ @SuppressWarnings("unchecked")
+ public void doAction(TestStore store) {
+ final LibraryFactory factory = LibraryFactory.eINSTANCE;
+
+// {
+// store.beginTransaction();
+//
+// // Create a library.
+// Library library = LibraryFactory.eINSTANCE.createLibrary();
+// library.setName("My Library");
+// // Make it persistent.
+// store.store(library);
+//
+// // Create a writer...
+// Writer writer = LibraryFactory.eINSTANCE.createWriter();
+// writer.setName("JRR Tolkien");
+//
+// // ...and one of his books.
+// Book book = LibraryFactory.eINSTANCE.createBook();
+// book.setAuthor(writer);
+// book.setPages(305);
+// book.setTitle("The Hobbit");
+// book.setCategory(BookCategory.SCIENCE_FICTION_LITERAL);
+//
+// // Add the Writer and Book to the Library. They are made
+// // persistent automatically because the Library is already
+// // persistent.
+// library.getWriters().add(writer);
+// library.getBooks().add(book);
+// store.commitTransaction();
+// }
+
+ // create a book, writer and library
+ {
+ store.beginTransaction();
+
+ final Writer writer = factory.createWriter();
+ writer.setName("JRR Tolkien");
+
+ final Book book = factory.createBook();
+
+ book.setAuthor(writer);
+ book.setPages(5);
+ book.setTitle("The Hobbit");
+ book.setCategory(BookCategory.SCIENCE_FICTION);
+
+ final Book book2 = factory.createBook();
+ book2.setAuthor(writer);
+ book2.setPages(5);
+ book2.setTitle("The fellowship of the ring");
+ book2.setCategory(BookCategory.SCIENCE_FICTION);
+
+ final Library library = factory.createLibrary();
+ library.getBooks().add(book);
+ library.setName("Science Fiction Library");
+ library.getBooks().add(book2);
+ library.getWriters().add(writer);
+ store.store(library);
+
+ store.commitTransaction();
+ assertEquals(2, writer.getBooks().size());
+ }
+
+ // walk through the structure starting from the library
+ {
+ store.beginTransaction();
+ Library lib = (Library) store.query(Library.class, "name", "Science Fiction Library", 1).get(0);
+ assertTrue((lib.getWriters().get(0)).getName().compareTo("JRR Tolkien") == 0);
+
+// final Object[] eobjs = store.getCrossReferencers((EObject)lib.getWriters().get(0), false);
+
+ // these two books should be the same as this book is the first in the writers
+ // collection
+ // and in the library collection
+ Book wBook = (lib.getWriters().get(0)).getBooks().get(0);
+ Book lBook = lib.getBooks().get(0);
+
+ // check container
+ assertTrue(lBook.eContainer() == lib);
+
+ assertTrue(wBook.getTitle().compareTo(lBook.getTitle()) == 0);
+ assertTrue(wBook.getPages() == lBook.getPages());
+ assertTrue(wBook.getCategory() instanceof BookCategory);
+ assertTrue(wBook.getCategory() == BookCategory.SCIENCE_FICTION);
+ store.commitTransaction();
+ }
+
+ // check container relations
+ if (true) {
+ store.beginTransaction();
+
+ final Writer writ = store.getObjects(Writer.class).get(0);
+
+ // store.refresh(writ);
+
+ // test notifications of the elist
+ // disabled this test as the elist notifications have been disabled
+ // WriterAdapter writerAdapter = new WriterAdapter();
+ // writ.eAdapters().add(writerAdapter);
+ // assertEquals(2, writ.getBooks().size()); // this should not trigger the adapter to be
+ // called
+ // assertEquals(1, writerAdapter.getCountNotifications());
+
+ checkContainerAfterWriterRetrieve(store, writ);
+
+ Library lib = (Library) store.getCrossReferencers(writ, true)[0];
+ checkContainerAfterLibraryRetrieve(store, writ);
+ checkDetachCopy(store, writ);
+
+ // now set the container of the writer
+ assertTrue("The container of the writer should be set!", store.setContainer(writ));
+
+ assertEquals(LibraryPackage.eINSTANCE.getLibrary_Writers().getFeatureID(), writ.eContainingFeature()
+ .getFeatureID());
+
+ assertTrue("The container of the writer should be equal to the earlier retrieved Library", lib == writ
+ .eContainer());
+
+ final Object[] eobjs = store.getCrossReferencers(writ, false);
+ assertEquals(3, eobjs.length);
+ for (final Object obj : eobjs) {
+ if (obj instanceof Library) {
+ assertTrue(obj == lib);
+ } else {
+ assertTrue(((Book) obj).getAuthor() == writ);
+ assertTrue(lib.getBooks().contains(obj));
+ }
+ }
+
+ final Book bk = store.getObjects(Book.class).get(0);
+ assertTrue(bk.eContainer() == lib);
+
+ // check if the containing feature is also set correctly
+ assertTrue(bk.eContainingFeature() == LibraryPackage.eINSTANCE.getLibrary_Books());
+
+ assertTrue(lib.getBooks().contains(bk));
+
+ store.refresh(lib);
+
+ store.commitTransaction();
+ }
+
+ dumpPAModel(store);
+ checkTeneoSQLNameStrategy();
+ }
+
+ /** Reads objects in multiple sessions and checks that they are unequal */
+ @SuppressWarnings("unchecked")
+ protected void checkUseCache(TestStore store) {
+ // read the writers in the cache
+ store.refresh();
+ store.beginTransaction();
+ final Writer writer = store.getObject(Writer.class);
+ assertTrue(writer != null);
+ store.commitTransaction();
+ store.refresh();
+ store.beginTransaction();
+ final List books1 = new ArrayList(store.getObjects(Book.class));
+ store.commitTransaction();
+ store.refresh();
+ store.beginTransaction();
+ final List books2 = new ArrayList(store.getObjects(Book.class));
+ assertTrue(books1.size() == books2.size());
+ store.commitTransaction();
+ for (int i = 0; i < books1.size(); i++) {
+ final Book bk1 = (Book) books1.get(i);
+ final Book bk2 = (Book) books2.get(i);
+ assertEquals(bk1.getTitle(), bk2.getTitle());
+ assertTrue(bk1 != bk2);
+ assertTrue(bk1.getAuthor() != bk2.getAuthor());
+ }
+ }
+
+ // check detachcopy for jpox
+ protected void checkDetachCopy(TestStore store, Writer writ) {
+ }
+
+ protected void checkContainerAfterLibraryRetrieve(TestStore store, final Writer writ) {
+ // TODO specialize for Hibernate/JPOX, was:
+ // if (store instanceof JPOXTestStore)
+ // {
+ // assertTrue("Container of writer is not yet set now, because of lazy loading of container
+ // relations",
+ // writ.eContainer() == null);
+ // }
+ }
+
+ protected void checkContainerAfterWriterRetrieve(TestStore store, final Writer writ) {
+ // TODO specialize for Hibernate/JPOX, was:
+ // if (store instanceof HibernateTestStore)
+ // {
+ // assertTrue(writ.eContainer() != null);
+ // assertTrue(writ.eContainer() instanceof Library);
+ // }
+ }
+
+ /**
+ * @return Returns <code>true</code> the given value indeed encodes a list
+ */
+ protected boolean listValueOfCorrectType(Object value) {
+ // TODO specialize hibernate/jpox, was
+ // return (value instanceof PersistableEList || value instanceof
+ // org.eclipse.emf.teneo.jpox.emf.elist.EListWrapper)
+ return true;
+ }
+
+ /** Dump the annotated model to standard output */
+ protected void dumpPAModel(TestStore testStore) {
+ }
+
+ protected void checkTeneoSQLNameStrategy() {
+ }
+
+// /** Small adapter test
+// private class WriterAdapter extends AdapterImpl {
+// /** Counts the number of changes */
+// private int countNotifications = 0;
+//
+// /**
+// * Returns <code>false</code>
+// *
+// * @param type
+// * the type.
+// * @return <code>false</code>
+// */
+// public boolean isAdapterForType(Object type) {
+// return type instanceof Writer;
+// }
+//
+// /**
+// * Does nothing; clients may override so that it does something.
+// */
+// public void notifyChanged(Notification msg) {
+// assertTrue("The new value is of type: " + msg.getNewValue().getClass().getName(),
+// listValueOfCorrectType(msg.getNewValue()));
+//
+// // must be a load event
+// assertTrue("Eventtype is not load notification but: " + msg.getEventType(),
+// msg.getEventType() == AnnotationUtil.ELIST_LOAD_NOTIFICATION);
+//
+// countNotifications++;
+// }
+//
+// /** Returns the number of notifications */
+// public int getCountNotifications() {
+// return countNotifications;
+// }
+// }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/TopClassesAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/TopClassesAction.java
new file mode 100755
index 000000000..bb4f6d5de
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/TopClassesAction.java
@@ -0,0 +1,110 @@
+/**
+ * <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: TopClassesAction.java,v 1.4 2008/02/28 07:08:16 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import java.io.IOException;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.teneo.samples.issues.topclasses.M;
+import org.eclipse.emf.teneo.samples.issues.topclasses.MList;
+import org.eclipse.emf.teneo.samples.issues.topclasses.P;
+import org.eclipse.emf.teneo.samples.issues.topclasses.PList;
+import org.eclipse.emf.teneo.samples.issues.topclasses.R;
+import org.eclipse.emf.teneo.samples.issues.topclasses.TopclassesFactory;
+import org.eclipse.emf.teneo.samples.issues.topclasses.TopclassesPackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests if topclasses are computed correctly also in case of an inheritance strategy. Tests if also for n:m relation lazy loading of
+ * detached objects works for jpox.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.4 $
+ */
+public class TopClassesAction extends AbstractTestAction {
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public TopClassesAction() {
+ super(TopclassesPackage.eINSTANCE);
+ }
+
+ /** Creates an item, an address and links them to a po. */
+ @Override
+ @SuppressWarnings("unchecked")
+ public void doAction(TestStore store) {
+ final TopclassesFactory factory = TopclassesFactory.eINSTANCE;
+
+ // create a book, writer and library
+ try {
+ {
+ Resource res = store.getResource();
+ res.load(null);
+
+ // add other case
+ M m = factory.createM();
+ m.setName("m");
+
+ P p = factory.createP();
+ p.setName("p");
+ m.getP().add(p);
+ assertTrue(p.getM().contains(m));
+
+ MList mlist = factory.createMList();
+ mlist.setName("mlist");
+ mlist.getM().add(m);
+
+ PList plist = factory.createPList();
+ plist.getP().add(p);
+ plist.setName("plist");
+
+ R r = factory.createR();
+ r.setName("r");
+ r.setMlist(mlist);
+ r.setPlist(plist);
+
+ res.getContents().add(r);
+ res.save(null);
+ }
+
+ {
+ Resource res = store.getResource();
+ res.load(null);
+ assertEquals(1, res.getContents().size());
+ R testR = null;
+ for (int i = 0; i < res.getContents().size(); i++) {
+ final Object obj = res.getContents().get(i);
+ if (obj instanceof R) {
+ testR = (R) obj;
+ }
+ }
+
+ M m = (M) testR.getMlist().getM().get(0);
+ P p = (P) testR.getPlist().getP().get(0);
+ assertTrue(m.getP().contains(p));
+ assertTrue(p.getM().contains(m));
+ res.save(null);
+ }
+ } catch (IOException e) {
+ throw new StoreTestException("IOException during save", e);
+ }
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/UpdateAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/UpdateAction.java
new file mode 100755
index 000000000..7dd9586d2
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/issues/UpdateAction.java
@@ -0,0 +1,64 @@
+/**
+ * <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:
+ * AgilAction.java,v 1.1 2007/03/28 13:58:33 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.test.issues;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.samples.issues.update.Child;
+import org.eclipse.emf.teneo.samples.issues.update.Parent;
+import org.eclipse.emf.teneo.samples.issues.update.UpdateFactory;
+import org.eclipse.emf.teneo.samples.issues.update.UpdatePackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.3 $
+ */
+public class UpdateAction extends AbstractTestAction {
+
+ /**
+ * Constructor for ClassHierarchyParsing.
+ *
+ * @param arg0
+ */
+ public UpdateAction() {
+ super(new EPackage[] { UpdatePackage.eINSTANCE });
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ {
+ final Parent p = UpdateFactory.eINSTANCE.createParent();
+ p.setName("p");
+ final Child c1 = UpdateFactory.eINSTANCE.createChild();
+ c1.setName("c1");
+ final Child c2 = UpdateFactory.eINSTANCE.createChild();
+ c2.setName("c2");
+ p.getChildren().add(c1);
+ p.getChildren().add(c2);
+ store.beginTransaction();
+ store.store(p);
+ store.commitTransaction();
+ }
+
+ {
+ final Parent p = UpdateFactory.eINSTANCE.createParent();
+ p.setName("p");
+ final Child c1 = UpdateFactory.eINSTANCE.createChild();
+ c1.setName("c1");
+ final Child c2 = UpdateFactory.eINSTANCE.createChild();
+ c2.setName("c2");
+ p.getChildren().add(c1);
+ p.getChildren().add(c2);
+ store.beginTransaction();
+ store.store(p);
+ store.commitTransaction();
+ }
+ }
+}

Back to the top