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/trunk@15883 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Gail Badner 2009-02-04 04:05:44 +00:00
parent 832b611185
commit cc78cbf6fe
6 changed files with 35 additions and 8 deletions

View File

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

View File

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

View File

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

View File

@ -27,6 +27,7 @@ import org.hibernate.dialect.Oracle9Dialect;
import org.hibernate.dialect.OracleDialect; import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.SybaseDialect; import org.hibernate.dialect.SybaseDialect;
import org.hibernate.dialect.TimesTenDialect; import org.hibernate.dialect.TimesTenDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.function.SQLFunction; import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite; import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@ -498,6 +499,14 @@ public class SQLFunctionsTest extends LegacyTestCase {
//s.refresh(b); //s.refresh(b);
//assertTrue( b.getClob() instanceof ClobImpl ); //assertTrue( b.getClob() instanceof ClobImpl );
s.flush(); 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); s.refresh(b);
//b.getBlob().setBytes( 2, "abc".getBytes() ); //b.getBlob().setBytes( 2, "abc".getBytes() );
b.getClob().getSubString(2, 3); b.getClob().getSubString(2, 3);

View File

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

View File

@ -6,7 +6,6 @@ import junit.framework.Test;
import org.hibernate.Hibernate; import org.hibernate.Hibernate;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.junit.functional.FunctionalTestCase; import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite; import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@ -57,7 +56,10 @@ public class MixedTest extends FunctionalTestCase {
t.commit(); t.commit();
s.close(); 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() ); s = openSession( new DocumentInterceptor() );
t = s.beginTransaction(); t = s.beginTransaction();