Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 b1eb000b6d..778804579c 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 927a23f673..9bea20453b 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();

Back to the top