Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.hibernate/model1.ecore75
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java84
3 files changed, 71 insertions, 89 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
index e5326a83ec..fbe6b96ddf 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
@@ -593,6 +593,7 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS
public void write(InternalCommitContext context, OMMonitor monitor)
{
// NOTE: the same flow is also present in the super class (StoreAccessor)
+ // changes in flow can mean that the flow here also has to change
HibernateThreadContext.setCommitContext(context);
if (context.getNewPackageUnits().length > 0)
diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/model1.ecore b/plugins/org.eclipse.emf.cdo.tests.hibernate/model1.ecore
deleted file mode 100644
index 716968f5d2..0000000000
--- a/plugins/org.eclipse.emf.cdo.tests.hibernate/model1.ecore
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model1"
- nsURI="http://www.eclipse.org/emf/CDO/tests/model1/1.0.0" nsPrefix="model1">
- <eClassifiers xsi:type="ecore:EClass" name="Address">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="street" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="city" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Company" eSuperTypes="#//Address">
- <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1"
- eType="#//Category" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="suppliers" upperBound="-1"
- eType="#//Supplier" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="customers" upperBound="-1"
- eType="#//Customer" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1"
- eType="#//PurchaseOrder" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1"
- eType="#//SalesOrder" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Supplier" eSuperTypes="#//Address">
- <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1"
- eType="#//PurchaseOrder" eOpposite="#//PurchaseOrder/supplier"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="preferred" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
- defaultValueLiteral="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Customer" eSuperTypes="#//Address">
- <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" unique="false"
- upperBound="-1" eType="#//SalesOrder" eOpposite="#//SalesOrder/customer"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Order">
- <eStructuralFeatures xsi:type="ecore:EReference" name="orderDetails" upperBound="-1"
- eType="#//OrderDetail" containment="true" eOpposite="#//OrderDetail/order"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="OrderDetail">
- <eStructuralFeatures xsi:type="ecore:EReference" name="order" lowerBound="1" eType="#//Order"
- eOpposite="#//Order/orderDetails"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="product" eType="#//Product"
- eOpposite="#//Product/orderDetails"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="price" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="PurchaseOrder" eSuperTypes="#//Order">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="date" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="supplier" lowerBound="1"
- eType="#//Supplier" eOpposite="#//Supplier/purchaseOrders"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="SalesOrder" eSuperTypes="#//Order">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="customer" lowerBound="1"
- eType="#//Customer" eOpposite="#//Customer/salesOrders"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Category">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1"
- eType="#//Category" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="products" upperBound="-1"
- eType="#//Product" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Product">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="orderDetails" upperBound="-1"
- eType="#//OrderDetail" eOpposite="#//OrderDetail/product"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="vat" eType="#//VAT" defaultValueLiteral="vat15"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="VAT">
- <eLiterals name="vat0"/>
- <eLiterals name="vat7" value="7"/>
- <eLiterals name="vat15" value="15"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="OrderAddress" eSuperTypes="#//Address #//Order #//OrderDetail">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="testAttribute" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java
index 51cdc7e194..8dd6c8c086 100644
--- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java
+++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.tests.BranchingTest;
import org.eclipse.emf.cdo.tests.BranchingTestSameSession;
import org.eclipse.emf.cdo.tests.CommitInfoTest;
import org.eclipse.emf.cdo.tests.ComplexTest;
+import org.eclipse.emf.cdo.tests.ContainmentTest;
import org.eclipse.emf.cdo.tests.ExternalReferenceTest;
import org.eclipse.emf.cdo.tests.LobTest;
import org.eclipse.emf.cdo.tests.LockingManagerTest;
@@ -35,11 +36,13 @@ import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_252214_Test;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_258933_Test;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_272861_Test;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_273565_Test;
+import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_279982_Test;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_283985_CDOTest;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_283985_CDOTest2;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_308895_Test;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_316444_Test;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_319836_Test;
+import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_322804_Test;
import org.eclipse.emf.cdo.tests.config.impl.ConfigTest;
import org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig;
import org.eclipse.emf.cdo.util.CommitException;
@@ -70,24 +73,13 @@ public class AllTestsHibernate extends AllConfigs
@Override
protected void initTestClasses(List<Class<? extends ConfigTest>> testClasses)
{
- // if (true)
- // {
- // testClasses.clear();
- // testClasses.add(XRefTest.class);
- // return;
- // }
- // // current failing testcases
- // testClasses.add(ContainmentTest.class);
- // testClasses.add(Bugzilla_279982_Test.class);
- // testClasses.add(Bugzilla_316273_Test.class);
- // testClasses.add(Bugzilla_320690_Test.class);
- // testClasses.add(Bugzilla_322804_Test.class);
- // testClasses.add(Bugzilla_323930_Test.class);
-
testClasses.add(XRefTest.class);
testClasses.add(LobTest.class);
testClasses.add(RepositoryTest.class);
+ testClasses.add(Hibernate_Bugzilla_279982_Test.class);
+ testClasses.add(Hibernate_ContainmentTest.class);
+ testClasses.add(HibernateXATransactionTest.class);
testClasses.add(Hibernate_Bugzilla_308895_Test.class);
testClasses.add(HibernateExternalAnnotationTest.class);
testClasses.add(HibernateMultiValuedOfAttributeTest.class);
@@ -106,8 +98,15 @@ public class AllTestsHibernate extends AllConfigs
super.initTestClasses(testClasses);
+ // Teneo does not yet support lists of int arrays:
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=330212
+ testClasses.remove(Bugzilla_322804_Test.class);
+
+ testClasses.remove(Bugzilla_279982_Test.class);
+
// are replaced by Hibernate specific ones, mostly
// to prevent tests doing move from one container to another
+ testClasses.remove(ContainmentTest.class);
testClasses.remove(ComplexTest.class);
testClasses.remove(ResourceTest.class);
testClasses.remove(SetFeatureTest.class);
@@ -278,4 +277,61 @@ public class AllTestsHibernate extends AllConfigs
}
}
+
+ public static class Hibernate_ContainmentTest extends ContainmentTest
+ {
+ // this testcase is overridden because it uses an ereference which should be
+ // annotated with @External, but which can't be mapped like that because it is
+ // also used non-externally by other testcases
+ @Override
+ public void testObjectNotSameResourceThanItsContainerCDOANDXMI() throws Exception
+ {
+ }
+
+ // see:
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=330207#c1
+ @Override
+ public void testModeledBackPointer_Transient() throws Exception
+ {
+ }
+
+ // see:
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=330207#c1
+ @Override
+ public void testModeledBackPointer_Transient_Load() throws Exception
+ {
+ }
+ }
+
+ // overridden because Hibernate will treat all stale references as an exception
+ public static class Hibernate_Bugzilla_279982_Test extends Bugzilla_279982_Test
+ {
+ @Override
+ public void testBugzilla_279982_Single() throws Exception
+ {
+ try
+ {
+ super.testBugzilla_279982_Single();
+ }
+ catch (Exception e)
+ {
+ assertTrue(e instanceof CommitException);
+ assertTrue(e.getMessage().contains("org.hibernate.ObjectNotFoundException"));
+ }
+ }
+
+ @Override
+ public void testBugzilla_279982_Multi_RevisionPrefetchingPolicy() throws Exception
+ {
+ try
+ {
+ super.testBugzilla_279982_Multi_RevisionPrefetchingPolicy();
+ }
+ catch (Exception e)
+ {
+ assertTrue(e instanceof CommitException);
+ assertTrue(e.getMessage().contains("org.hibernate.ObjectNotFoundException"));
+ }
+ }
+ }
}

Back to the top