[hibernate-commits] Hibernate SVN: r10836 - in trunk/Hibernate3/test/org/hibernate/test: . lob

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


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

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

Modified: trunk/Hibernate3/test/org/hibernate/test/TestCase.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/TestCase.java	2006-11-16 21:37:53 UTC (rev 10835)
+++ trunk/Hibernate3/test/org/hibernate/test/TestCase.java	2006-11-16 21:56:01 UTC (rev 10836)
@@ -572,9 +572,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;
@@ -595,7 +594,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: trunk/Hibernate3/test/org/hibernate/test/lob/ClobTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/lob/ClobTest.java	2006-11-16 21:37:53 UTC (rev 10835)
+++ trunk/Hibernate3/test/org/hibernate/test/lob/ClobTest.java	2006-11-16 21:56:01 UTC (rev 10836)
@@ -1,6 +1,7 @@
 package org.hibernate.test.lob;
 
 import java.sql.Clob;
+import java.io.Reader;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -9,6 +10,7 @@
 import org.hibernate.Session;
 import org.hibernate.Hibernate;
 import org.hibernate.LockMode;
+import org.hibernate.dialect.H2Dialect;
 
 /**
  * Test various access scenarios for eager and lazy materialization
@@ -173,9 +175,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