HHH-5893 : Tests fail for dialects that return null for empty LOBs

This commit is contained in:
Gail Badner 2011-02-07 12:50:53 -08:00
parent 42a38cfefa
commit 9f29d406ff
4 changed files with 16 additions and 8 deletions

View File

@ -135,8 +135,10 @@ public class BlobLocatorTest extends DatabaseSpecificFunctionalTestCase {
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() );
assertEquals( empty.length, entity.getBlobLocator().length() );
assertEquals( empty, extractData( entity.getBlobLocator() ) );
if ( entity.getBlobLocator() != null) {
assertEquals( empty.length, entity.getBlobLocator().length() );
assertEquals( empty, extractData( entity.getBlobLocator() ) );
}
s.delete( entity );
s.getTransaction().commit();
s.close();

View File

@ -133,8 +133,10 @@ public class ClobLocatorTest extends DatabaseSpecificFunctionalTestCase {
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() );
assertEquals( empty.length(), entity.getClobLocator().length() );
assertEquals( empty, extractData( entity.getClobLocator() ) );
if ( entity.getClobLocator() != null) {
assertEquals( empty.length(), entity.getClobLocator().length() );
assertEquals( empty, extractData( entity.getClobLocator() ) );
}
s.delete( entity );
s.getTransaction().commit();
s.close();

View File

@ -91,8 +91,10 @@ public abstract class LongByteArrayTest extends DatabaseSpecificFunctionalTestCa
s = openSession();
s.beginTransaction();
entity = ( LongByteArrayHolder ) s.get( LongByteArrayHolder.class, entity.getId() );
assertEquals( empty.length, entity.getLongByteArray().length );
assertEquals( empty, entity.getLongByteArray() );
if ( entity.getLongByteArray() != null ) {
assertEquals( empty.length, entity.getLongByteArray().length );
assertEquals( empty, entity.getLongByteArray() );
}
s.delete( entity );
s.getTransaction().commit();
s.close();

View File

@ -89,8 +89,10 @@ public abstract class LongStringTest extends DatabaseSpecificFunctionalTestCase
s = openSession();
s.beginTransaction();
entity = ( LongStringHolder ) s.get( LongStringHolder.class, entity.getId() );
assertEquals( empty.length(), entity.getLongString().length() );
assertEquals( empty, entity.getLongString() );
if ( entity.getLongString() != null ) {
assertEquals( empty.length(), entity.getLongString().length() );
assertEquals( empty, entity.getLongString() );
}
s.delete( entity );
s.getTransaction().commit();
s.close();