summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Winkler2009-10-07 07:26:34 (EDT)
committerStefan Winkler2009-10-07 07:26:34 (EDT)
commitd22dc192581b634909515e883c6d9f9a97c67607 (patch)
treed629eb246d4941262588083396f380416e580da2
parent7eb982d7e92ad124c432491d62637620c3d6e243 (diff)
downloadcdo-d22dc192581b634909515e883c6d9f9a97c67607.zip
cdo-d22dc192581b634909515e883c6d9f9a97c67607.tar.gz
cdo-d22dc192581b634909515e883c6d9f9a97c67607.tar.bz2
[291474] [DB] Two testcases fail with HSQLDB
https://bugs.eclipse.org/bugs/show_bug.cgi?id=291474
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBAnnotationsTest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/SQLQueryTest.java20
2 files changed, 22 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBAnnotationsTest.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBAnnotationsTest.java
index b1eb000..7788045 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBAnnotationsTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBAnnotationsTest.java
@@ -260,6 +260,10 @@ public class DBAnnotationsTest extends AbstractCDOTest
public void testColumnNameTypeAnnotationByMetaData()
{
+ // HSQL does not support type annotations
+ skipConfig(AllTestsDBHsqldb.Hsqldb.INSTANCE);
+ skipConfig(AllTestsDBHsqldbNonAudit.HsqldbNonAudit.INSTANCE);
+
// XXX [PSQL] disabled because of Bug 290095
skipConfig(AllTestsDBPsql.Psql.INSTANCE);
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/SQLQueryTest.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/SQLQueryTest.java
index 927a23f..9bea204 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/SQLQueryTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/SQLQueryTest.java
@@ -108,9 +108,25 @@ public class SQLQueryTest extends AbstractCDOTest
msg("Count products");
CDOQuery cdoQuery = transaction.createQuery("sql", "SELECT COUNT(*) from PRODUCT1");
cdoQuery.setParameter(SQLQueryHandler.CDO_OBJECT_QUERY, false);
- final List<Long> counts = cdoQuery.getResult(Long.class);
+
+ // we need to handle objects, because different DBs produce either
+ // Long or Integer results
+ final List<Object> counts = cdoQuery.getResult(Object.class);
assertEquals(counts.size(), 1);
- assertEquals(counts.get(0).intValue(), NUM_OF_PRODUCTS);
+
+ Object result = counts.get(0);
+ int intResult;
+ if (result instanceof Integer)
+ {
+ intResult = ((Integer)result).intValue();
+ }
+ else
+ {
+ assertTrue(result instanceof Long);
+ intResult = ((Long)result).intValue();
+ }
+
+ assertEquals(intResult, NUM_OF_PRODUCTS);
}
transaction.commit();