Skip empty clob test due to HHH-6425

This commit is contained in:
renj 2011-11-07 16:31:09 +08:00 committed by Strong Liu
parent d44b0761be
commit ca2bd08997

View File

@ -32,6 +32,7 @@
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.type.descriptor.java.DataHelper;
import org.hibernate.dialect.SybaseASE15Dialect;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@ -110,25 +111,27 @@ public void testBoundedClobLocatorAccess() throws Throwable {
s.close();
// test empty clob
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() );
assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
assertEquals( changed, extractData( entity.getClobLocator() ) );
entity.setClobLocator( s.getLobHelper().createClob( empty ) );
s.getTransaction().commit();
s.close();
if ( !(getDialect() instanceof SybaseASE15Dialect) ) { // Sybase insert empty string as single space. HHH-6425
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() );
assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
assertEquals( changed, extractData( entity.getClobLocator() ) );
entity.setClobLocator( s.getLobHelper().createClob( empty ) );
s.getTransaction().commit();
s.close();
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() );
if ( entity.getClobLocator() != null) {
assertEquals( empty.length(), entity.getClobLocator().length() );
assertEquals( empty, extractData( entity.getClobLocator() ) );
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() );
if ( entity.getClobLocator() != null) {
assertEquals( empty.length(), entity.getClobLocator().length() );
assertEquals( empty, extractData( entity.getClobLocator() ) );
}
s.delete( entity );
s.getTransaction().commit();
s.close();
}
s.delete( entity );
s.getTransaction().commit();
s.close();
}