Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 16:57:42 -0400 (Fri, 01 Sep 2006)
New Revision: 10423
Modified:
trunk/Hibernate3/test/org/hibernate/test/TestCase.java
trunk/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
trunk/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java
trunk/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java
trunk/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java
Log:
fixed failures on SQLServer
Modified: trunk/Hibernate3/test/org/hibernate/test/TestCase.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01 20:56:40 UTC (rev
10422)
+++ trunk/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01 20:57:42 UTC (rev
10423)
@@ -512,6 +512,37 @@
return canDoIt;
}
+ protected boolean supportsRowValueConstructorSyntaxInInList() {
+ boolean supported = ! (
+ getDialect() instanceof HSQLDialect ||
+ getDialect() instanceof PostgreSQLDialect ||
+ getDialect() instanceof MySQLDialect ||
+ getDialect() instanceof DB2Dialect ||
+ getDialect() instanceof SybaseDialect
+ );
+
+ if ( !supported ) {
+ reportSkip( "Dialect does not support 'tuple' syntax as part of an IN
value list", "query support" );
+ }
+ return supported;
+ }
+
+ protected boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
+ if ( getDialect() instanceof SQLServerDialect ) {
+ reportSkip( "Driver does not support 'position query' methods on
forward-only cursors", "query support" );
+ return false;
+ }
+ return true;
+ }
+
+ protected boolean supportsCircularCascadeDelete() {
+ if ( getDialect() instanceof SQLServerDialect ) {
+ reportSkip( "db/dialect does not support 'circular' cascade delete
constraints", "cascade delete constraint support" );
+ return false;
+ }
+ return true;
+ }
+
private boolean dialectIsNot(Class[] dialectClasses) {
for (int i = 0; i < dialectClasses.length; i++) {
Class dialectClass = dialectClasses[i];
Modified:
trunk/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
===================================================================
---
trunk/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2006-09-01
20:56:40 UTC (rev 10422)
+++
trunk/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2006-09-01
20:57:42 UTC (rev 10423)
@@ -47,6 +47,10 @@
}
public void testScrollingJoinFetchesForward() {
+ if ( ! supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() ) {
+ return;
+ }
+
TestData data = new TestData();
data.prepare();
Modified: trunk/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java
===================================================================
---
trunk/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java 2006-09-01
20:56:40 UTC (rev 10422)
+++
trunk/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java 2006-09-01
20:57:42 UTC (rev 10423)
@@ -89,8 +89,8 @@
mark.setZip("30306");
assertEquals( s.createQuery("from Person p where p.address.zip =
'30306'").list().size(), 1 );
-
- if ( !(getDialect() instanceof HSQLDialect) && !( getDialect() instanceof
PostgreSQLDialect ) && !( getDialect() instanceof MySQLDialect ) && !(
getDialect() instanceof DB2Dialect ) ) {
+
+ if ( ! supportsRowValueConstructorSyntaxInInList() ) {
s.createCriteria(Person.class).add(
Expression.in("address", new Address[] { mark.getAddress(),
joe.getAddress() } )
).list();
Modified: trunk/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java 2006-09-01
20:56:40 UTC (rev 10422)
+++ trunk/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java 2006-09-01
20:57:42 UTC (rev 10423)
@@ -25,7 +25,10 @@
}
public void testJoinedSubclass() {
-
+ if ( ! supportsCircularCascadeDelete() ) {
+ return;
+ }
+
Statistics statistics = getSessions().getStatistics();
statistics.clear();
Modified: trunk/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java
===================================================================
---
trunk/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java 2006-09-01
20:56:40 UTC (rev 10422)
+++
trunk/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java 2006-09-01
20:57:42 UTC (rev 10423)
@@ -88,8 +88,8 @@
mark.setZip("30306");
assertEquals( s.createQuery("from Person p where p.address.zip =
'30306'").list().size(), 1 );
-
- if ( !(getDialect() instanceof HSQLDialect) && !( getDialect() instanceof
PostgreSQLDialect ) && !( getDialect() instanceof MySQLDialect ) && !(
getDialect() instanceof DB2Dialect ) ) {
+
+ if ( ! supportsRowValueConstructorSyntaxInInList() ) {
s.createCriteria(Person.class).add(
Expression.in("address", new Address[] { mark.getAddress(),
joe.getAddress() } )
).list();
Show replies by date