Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2010-02-19 08:13:30 +0000
committerMartin Taal2010-02-19 08:13:30 +0000
commit35e4d303a48b1754cb8786555fa6cf534e482f72 (patch)
tree81ce6116767b6ea2e96ab20f10ebf056d553d98a /plugins/org.eclipse.emf.cdo.tests.hibernate
parentb270e15246d69113f0f677c980354dd0a6be551b (diff)
downloadcdo-35e4d303a48b1754cb8786555fa6cf534e482f72.tar.gz
cdo-35e4d303a48b1754cb8786555fa6cf534e482f72.tar.xz
cdo-35e4d303a48b1754cb8786555fa6cf534e482f72.zip
[300621] [Hibernate] CDO_Package_Unit type has a field which is too long for Derby
[300645] [Hibernate] Ensure that the Teneo extension mechanism works in combination with CDO [300659] [Hibernate] Handle unknown edatatypes as a string [300695] CDOENumStringType.nullSafeGet require identical name and literal for EEnum [283237] [Hibernate] Externalize strings and NON-NLS where appropriate [300256]: [Hibernate] several changes: properties can be set in config file
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.hibernate')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/AllTestsHibernate.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_301104_Test.java64
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateQueryTest.java7
5 files changed, 81 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties b/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties
index d46327f6ff..6b7ef6ff9e 100644
--- a/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties
+++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/build.properties
@@ -21,8 +21,7 @@ bin.includes = META-INF/,\
about.ini,\
about.mappings,\
about.properties,\
- modeling32.png,\
- src/log4j.properties
+ modeling32.png
src.includes = about.html,\
copyright.txt,\
epl-v10.html,\
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 31746601c2..13c3bb4d8a 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
@@ -14,13 +14,14 @@ import org.eclipse.emf.cdo.tests.AllTestsAllConfigs;
import org.eclipse.emf.cdo.tests.AuditTest;
import org.eclipse.emf.cdo.tests.AuditTestSameSession;
import org.eclipse.emf.cdo.tests.ExternalReferenceTest;
-import org.eclipse.emf.cdo.tests.FeatureMapTest;
import org.eclipse.emf.cdo.tests.MEMStoreQueryTest;
import org.eclipse.emf.cdo.tests.MultiValuedOfAttributeTest;
+import org.eclipse.emf.cdo.tests.UnsetTest;
import org.eclipse.emf.cdo.tests.XATransactionTest;
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.config.impl.ConfigTest;
import org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig;
@@ -55,11 +56,14 @@ public class AllTestsHibernate extends AllTestsAllConfigs
// if (true)
// {
// testClasses.clear();
- // // // current failing tests to solve:
- // testClasses.add(ContainmentTest.class);
+ // testClasses.add(InitialTest.class);
// return;
// }
+ // results in infinite loops it seems
+ // runs okay when run standalone
+ testClasses.remove(Bugzilla_273565_Test.class);
+
// add a testcase which has an annotation file
testClasses.add(HibernateExternalAnnotationTest.class);
@@ -89,10 +93,6 @@ public class AllTestsHibernate extends AllTestsAllConfigs
testClasses.remove(ExternalReferenceTest.class);
testClasses.add(HibernateExternalReferenceTest.class);
- // Feature map is not yet supported
- // bug 282711
- testClasses.remove(FeatureMapTest.class);
-
// this testcases removes and creates a resource with the
// same path in one transaction, that's not supported
// by hibernate.. because of unique key constraints
@@ -105,5 +105,11 @@ public class AllTestsHibernate extends AllTestsAllConfigs
// has a different meaning of unset
testClasses.remove(Bugzilla_258933_Test.class);
testClasses.add(HibernateBugzilla_258933_Test.class);
+
+ // remove as unsettable has to be re-visited for the hb store
+ // see bugzilla 298579
+ testClasses.remove(UnsetTest.class);
+
+ testClasses.add(HibernateBugzilla_301104_Test.class);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_301104_Test.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_301104_Test.java
new file mode 100644
index 0000000000..afc1414032
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateBugzilla_301104_Test.java
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Martin Taal - initial API and implementation
+ */
+package org.eclipse.emf.cdo.tests.hibernate;
+
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.tests.legacy.model1.Model1Package;
+import org.eclipse.emf.cdo.tests.model1.Category;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EcoreFactory;
+
+/**
+ * Allow application to set generated id.
+ * <p>
+ * See bug 301104
+ *
+ * @author Martin Taal
+ */
+public class HibernateBugzilla_301104_Test extends AbstractCDOTest
+{
+ public void testSetId() throws Exception
+ {
+ final String uuid = "MyUUID";
+
+ // add the id and generated value annotations
+ final EAnnotation eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
+ eAnnotation.setSource("teneo.jpa");
+ eAnnotation.getDetails().put("value", "@Id @GeneratedValue(generator=\"system-uuid\")");
+ Model1Package.eINSTANCE.getCategory_Name().getEAnnotations().add(eAnnotation);
+
+ Category category1;
+ {
+ final CDOSession session = openModel1Session();
+ final CDOTransaction transaction = session.openTransaction();
+
+ final CDOResource resource = transaction.createResource("/test1");
+ category1 = getModel1Factory().createCategory();
+ category1.setName(uuid);
+ resource.getContents().add(category1);
+
+ transaction.commit();
+ }
+ {
+ final CDOSession session = openModel1Session();
+ final CDOTransaction transaction = session.openTransaction();
+ final CDOResource resource = transaction.getResource("/test1");
+ final Category category2 = (Category)resource.getContents().get(0);
+ assertNotSame(category1, category2);
+ assertEquals(uuid, category2.getName());
+ transaction.commit();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java
index f74c0bf52b..555a83751e 100644
--- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateConfig.java
@@ -67,6 +67,7 @@ public class HibernateConfig extends RepositoryConfig
@Override
protected IStore createStore(String repoName)
{
+ // note the provider properties are read from the store/repository level
IHibernateMappingProvider mappingProvider = TeneoUtil.createMappingProvider();
return CDOHibernateUtil.createStore(mappingProvider);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateQueryTest.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateQueryTest.java
index 525a6462d8..1553f2eb62 100644
--- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateQueryTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HibernateQueryTest.java
@@ -81,9 +81,7 @@ public class HibernateQueryTest extends AbstractCDOTest
{
msg("Query for products with VAT15");
CDOQuery cdoQuery = transaction.createQuery("hql", "from Product1 where vat=:vat");
- // it is nicer to use the enum directly, see bugzilla:
- // bug 282610
- cdoQuery.setParameter("vat", VAT.VAT15.getValue());
+ cdoQuery.setParameter("vat", VAT.VAT15);
final List<Product1> products = cdoQuery.getResult(Product1.class);
assertEquals(10, products.size());
for (Product1 p : products)
@@ -116,8 +114,7 @@ public class HibernateQueryTest extends AbstractCDOTest
{
msg("Orders with sum of order details");
- // result with arrays are not yet supported, see this bugzilla:
- // bug 282612
+ // result with arrays are tested below
// CDOQuery cdoQuery = transaction.createQuery("hql",
// "select so.id, sum(od.price) from SalesOrder so, OrderDetail od where od.order=so group by so.id");
CDOQuery cdoQuery = transaction.createQuery("hql",

Back to the top