Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 16:52:35 -0400 (Fri, 01 Sep 2006)
New Revision: 10421
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/legacy/QueryByExampleTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/tm/CMTTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/typeparameters/TypeParameterTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java
Log:
fixed failures on SQLServer
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01
20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01
20:52:35 UTC (rev 10421)
@@ -518,6 +518,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: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml 2006-09-01
20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml 2006-09-01
20:52:35 UTC (rev 10421)
@@ -30,7 +30,7 @@
<property name="description"
not-null="true"
length="200"/>
- <property name="price" length="3"/>
+ <property name="price" length="3"
column="cost"/>
<property name="numberAvailable"/>
<property name="numberOrdered"
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
===================================================================
---
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2006-09-01
20:50:08 UTC (rev 10420)
+++
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2006-09-01
20:52:35 UTC (rev 10421)
@@ -47,6 +47,10 @@
}
public void testScrollingJoinFetchesForward() {
+ if ( ! supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() ) {
+ return;
+ }
+
TestData data = new TestData();
data.prepare();
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java
===================================================================
---
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java 2006-09-01
20:50:08 UTC (rev 10420)
+++
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java 2006-09-01
20:52:35 UTC (rev 10421)
@@ -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:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/legacy/QueryByExampleTest.java
===================================================================
---
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/legacy/QueryByExampleTest.java 2006-09-01
20:50:08 UTC (rev 10420)
+++
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/legacy/QueryByExampleTest.java 2006-09-01
20:52:35 UTC (rev 10421)
@@ -26,14 +26,6 @@
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
/**
* @see org.hibernate.test.TestCase#getMappings()
*/
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java
===================================================================
---
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java 2006-09-01
20:50:08 UTC (rev 10420)
+++
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java 2006-09-01
20:52:35 UTC (rev 10421)
@@ -25,7 +25,10 @@
}
public void testJoinedSubclass() {
-
+ if ( ! supportsCircularCascadeDelete() ) {
+ return;
+ }
+
Statistics statistics = getSessions().getStatistics();
statistics.clear();
@@ -71,7 +74,6 @@
List names = s.createQuery("select name from Person").list();
assertTrue( names.isEmpty() );
t.commit();
-
s.close();
}
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/tm/CMTTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/tm/CMTTest.java 2006-09-01
20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/tm/CMTTest.java 2006-09-01
20:52:35 UTC (rev 10421)
@@ -185,10 +185,11 @@
}
public void testConcurrentCachedDirtyQueries() throws Exception {
- if ( reportSkip( "dead-lock bug", "concurrent queries",
getDialect() instanceof SybaseDialect ) ) {
- // sybase and sqlserver have serious locking issues here...
+ if ( getDialect() instanceof SybaseDialect ) {
+ reportSkip( "dead-lock bug", "concurrent queries" );
return;
}
+
DummyTransactionManager.INSTANCE.begin();
Session s = openSession();
Map foo = new HashMap();
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/typeparameters/TypeParameterTest.java
===================================================================
---
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/typeparameters/TypeParameterTest.java 2006-09-01
20:50:08 UTC (rev 10420)
+++
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/typeparameters/TypeParameterTest.java 2006-09-01
20:52:35 UTC (rev 10421)
@@ -24,14 +24,6 @@
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
/**
* @see org.hibernate.test.TestCase#getMappings()
*/
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java
===================================================================
---
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java 2006-09-01
20:50:08 UTC (rev 10420)
+++
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java 2006-09-01
20:52:35 UTC (rev 10421)
@@ -89,7 +89,7 @@
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