From 712fb95b8a31685ae411b2144365d18f1869d6ff Mon Sep 17 00:00:00 2001 From: Strong Liu Date: Thu, 15 Aug 2013 18:15:18 +0800 Subject: [PATCH] HHH-8276 fixing FooBarTest.testRefresh --- .../entity/plan/LegacyBatchingEntityLoaderBuilder.java | 2 +- .../test/java/org/hibernate/test/legacy/FooBarTest.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/LegacyBatchingEntityLoaderBuilder.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/LegacyBatchingEntityLoaderBuilder.java index 849c045257..f2eb459add 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/LegacyBatchingEntityLoaderBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/LegacyBatchingEntityLoaderBuilder.java @@ -127,7 +127,7 @@ public class LegacyBatchingEntityLoaderBuilder extends AbstractBatchingEntityLoa return getObjectFromList( results, id, session ); } } - return ( loaders[batchSizes.length-1] ).load( id, optionalObject, session ); + return ( loaders[batchSizes.length-1] ).load( id, optionalObject, session, lockOptions ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java index 377a6e722e..35da814ffa 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java @@ -4311,11 +4311,11 @@ public class FooBarTest extends LegacyTestCase { } ); s.refresh(foo); - assertTrue( foo.getLong().longValue() == -3l ); - assertTrue( s.getCurrentLockMode(foo)==LockMode.READ ); + assertEquals( Long.valueOf( -3l ), foo.getLong() ); + assertEquals( LockMode.READ, s.getCurrentLockMode(foo) ); s.refresh(foo, LockMode.UPGRADE); if ( getDialect().supportsOuterJoinForUpdate() ) { - assertTrue( s.getCurrentLockMode(foo)==LockMode.UPGRADE ); + assertEquals( LockMode.UPGRADE, s.getCurrentLockMode(foo) ); } s.delete(foo); s.getTransaction().commit(); @@ -4329,7 +4329,7 @@ public class FooBarTest extends LegacyTestCase { FooProxy foo = new Foo(); s.save(foo); assertTrue( "autoflush create", s.createQuery( "from Foo foo" ).list().size()==1 ); - foo.setChar( new Character('X') ); + foo.setChar( 'X' ); assertTrue( "autoflush update", s.createQuery( "from Foo foo where foo.char='X'" ).list().size()==1 ); txn.commit(); s.close();