Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-04-20 10:22:26 +0000
committerEike Stepper2010-04-20 10:22:26 +0000
commitbab1391f34ac61fb7842bc4226613a94825a5d48 (patch)
tree4caf31891c209d4f3b20e1bb1c1f6bfe9724ed49 /plugins
parente5aa70f14ef5dd4f14711ead0f27c70decb6b249 (diff)
downloadcdo-bab1391f34ac61fb7842bc4226613a94825a5d48.tar.gz
cdo-bab1391f34ac61fb7842bc4226613a94825a5d48.tar.xz
cdo-bab1391f34ac61fb7842bc4226613a94825a5d48.zip
added DBType tests
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (Hsqldb).launch2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/CDO AutomatedTests (DBStore).launch16
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java26
3 files changed, 41 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (Hsqldb).launch b/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (Hsqldb).launch
index 7c07e39272..8749f187c4 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (Hsqldb).launch
+++ b/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (Hsqldb).launch
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/AllTestsDBHsqldb.java"/>
+<listEntry value="/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBHsqldb.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/CDO AutomatedTests (DBStore).launch b/plugins/org.eclipse.emf.cdo.tests.db/CDO AutomatedTests (DBStore).launch
new file mode 100644
index 0000000000..71adc0459e
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.db/CDO AutomatedTests (DBStore).launch
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AutomatedTests.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.db.AutomatedTests"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests.db"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx512m"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java
index 4f0c856912..fca5f2c676 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java
@@ -222,8 +222,30 @@ public class Net4jDBTest extends AbstractCDOTest
for (Pair<DBType, Object> column : columns)
{
- assertEquals("Error with type " + column.getElement1(), column.getElement2(), readTypeValue(ins, column
- .getElement1()));
+ Object actual = readTypeValue(ins, column.getElement1());
+ Class<? extends Object> type = column.getElement2().getClass();
+ if (type.isArray())
+ {
+ Class<?> componentType = type.getComponentType();
+ if (componentType == byte.class)
+ {
+ assertEquals("Error with type " + column.getElement1(), true, Arrays.equals((byte[])column.getElement2(),
+ (byte[])actual));
+ }
+ else if (componentType == char.class)
+ {
+ assertEquals("Error with type " + column.getElement1(), true, Arrays.equals((char[])column.getElement2(),
+ (char[])actual));
+ }
+ else
+ {
+ throw new IllegalStateException("Unexpected component type: " + componentType);
+ }
+ }
+ else
+ {
+ assertEquals("Error with type " + column.getElement1(), column.getElement2(), actual);
+ }
}
}

Back to the top