HHH-3691 : Sybase does not support Blobs and Clobs; skip unit tests that use Blobs/Clobs

git-svn-id: https://svn.jboss.org/repos/hibernate/core/branches/Branch_3_2@15877 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Gail Badner 2009-02-04 00:58:42 +00:00
parent 9eb89caa1d
commit 96bd4ad79c
6 changed files with 35 additions and 8 deletions

View File

@ -112,9 +112,9 @@ public class SQLServerDialect extends SybaseDialect {
return false;
}
public boolean supportsCascadeDelete() {
return true;
}
public boolean supportsCascadeDelete() {
return true;
}
public boolean supportsCircularCascadeDeleteConstraints() {
// SQL Server (at least up through 2005) does not support defining
@ -123,6 +123,10 @@ public class SQLServerDialect extends SybaseDialect {
return false;
}
public boolean supportsExpectedLobUsagePattern() {
return true;
}
public boolean supportsLobValueChangePropogation() {
// note: at least my local SQL Server 2005 Express shows this not working...
return false;

View File

@ -228,6 +228,10 @@ public class SybaseDialect extends Dialect {
return false;
}
public boolean supportsExpectedLobUsagePattern() {
return false;
}
public boolean supportsEmptyInList() {
return false;
}

View File

@ -6,7 +6,6 @@ import junit.framework.Test;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@ -33,8 +32,8 @@ public class InterfaceProxyTest extends FunctionalTestCase {
public void testInterfaceProxies() {
if ( getDialect() instanceof PostgreSQLDialect ) {
// TODO : why?
if ( ! getDialect().supportsExpectedLobUsagePattern() ) {
reportSkip( "database/driver does not support expected LOB usage pattern", "LOB support" );
return;
}

View File

@ -25,6 +25,7 @@ import org.hibernate.dialect.MckoiDialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.dialect.TimesTenDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.Oracle9iDialect;
import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@ -496,6 +497,14 @@ public class SQLFunctionsTest extends LegacyTestCase {
//s.refresh(b);
//assertTrue( b.getClob() instanceof ClobImpl );
s.flush();
// Sybase ASE does not support ResultSet.getBlob(String)
if ( getDialect() instanceof SybaseDialect && ! ( getDialect() instanceof SQLServerDialect ) ) {
s.connection().rollback();
s.close();
return;
}
s.refresh(b);
//b.getBlob().setBytes( 2, "abc".getBytes() );
b.getClob().getSubString(2, 3);

View File

@ -28,6 +28,9 @@ package org.hibernate.test.lob;
import junit.framework.Test;
import org.hibernate.Session;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@ -50,11 +53,17 @@ public class SerializableTypeTest extends FunctionalTestCase {
return new FunctionalTestClassTestSuite( SerializableTypeTest.class );
}
public String getCacheConcurrencyStrategy() {
return null;
}
public void testNewSerializableType() {
// Sybase ASE does not support ResultSet.getBlob(String)
if ( getDialect() instanceof SybaseDialect && ! ( getDialect() instanceof SQLServerDialect ) ) {
return;
}
final String payloadText = "Initial payload";
Session s = openSession();

View File

@ -6,7 +6,6 @@ import junit.framework.Test;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@ -57,7 +56,10 @@ public class MixedTest extends FunctionalTestCase {
t.commit();
s.close();
if ( getDialect() instanceof PostgreSQLDialect ) return;
if ( ! getDialect().supportsExpectedLobUsagePattern() ) {
reportSkip( "database/driver does not support expected LOB usage pattern", "LOB support" );
return;
}
s = openSession( new DocumentInterceptor() );
t = s.beginTransaction();