[hibernate-commits] Hibernate SVN: r10837 - in branches/Branch_3_2/Hibernate3/test/org/hibernate/test: . lob

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Thu Nov 16 16:56:16 EST 2006


Author: steve.ebersole at jboss.com
Date: 2006-11-16 16:56:15 -0500 (Thu, 16 Nov 2006)
New Revision: 10837

Modified:
   branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java
   branches/Branch_3_2/Hibernate3/test/org/hibernate/test/lob/ClobTest.java
Log:
fixed f'd up import

Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java	2006-11-16 21:56:01 UTC (rev 10836)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java	2006-11-16 21:56:15 UTC (rev 10837)
@@ -577,9 +577,8 @@
 	 * @return True if expected usage pattern is support; false otherwise.
 	 */
 	protected boolean supportsExpectedLobUsagePattern() {
-		// note : For H2, the insertions get truncated...
 		// note : For Derby, the insertions get truncated...
-		Class[] exceptions = new Class[] { H2Dialect.class, DerbyDialect.class };
+		Class[] exceptions = new Class[] { DerbyDialect.class };
 		if ( dialectIsOneOf( exceptions ) ) {
 			reportSkip( "database/driver does not support expected LOB usage pattern", "LOB support" );
 			return false;
@@ -600,7 +599,7 @@
 		// note: at least my local MySQL 5.1 install shows this not working...
 		// note: at least my local SQL Server 2005 Express shows this not working...
 		Class[] exceptions = new Class[] {
-				HSQLDialect.class, MySQLDialect.class, SQLServerDialect.class
+				HSQLDialect.class, H2Dialect.class, MySQLDialect.class, SQLServerDialect.class
 		};
 		if ( dialectIsOneOf( exceptions ) ) {
 			reportSkip( "database/driver does not support propogating LOB value change back to database", "LOB support" );

Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/lob/ClobTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/lob/ClobTest.java	2006-11-16 21:56:01 UTC (rev 10836)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/lob/ClobTest.java	2006-11-16 21:56:15 UTC (rev 10837)
@@ -9,9 +9,8 @@
 import org.hibernate.Session;
 import org.hibernate.Hibernate;
 import org.hibernate.LockMode;
+import org.hibernate.dialect.H2Dialect;
 
-import org.h2.engine.Constants;
-
 /**
  * Test various access scenarios for eager and lazy materialization
  * of CLOB data, as well as bounded and unbounded materialization
@@ -175,9 +174,14 @@
 	}
 
 	private String extractData(Clob clob) throws Throwable {
-		char[] data = new char[ (int) clob.length() ];
-		clob.getCharacterStream().read( data );
-		return new String( data );
+		if ( getDialect() instanceof H2Dialect ) {
+			return clob.getSubString( 1, ( int ) clob.length() );
+		}
+		else {
+			char[] data = new char[ (int) clob.length() ];
+			clob.getCharacterStream().read( data );
+			return new String( data );
+		}
 	}
 
 




More information about the hibernate-commits mailing list