From 7c2d88df8bcc4c1023b56aeaaad9622fe06cd665 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Thu, 20 Oct 2011 13:01:16 -0700 Subject: [PATCH] HHH-6751 : Test failure due to inconsistent scale returned for BigDecimal properties --- .../intermediate/IntermediateMappedSuperclassTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/IntermediateMappedSuperclassTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/IntermediateMappedSuperclassTest.java index 02d439a730..a064fbfa66 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/IntermediateMappedSuperclassTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/IntermediateMappedSuperclassTest.java @@ -55,7 +55,12 @@ public class IntermediateMappedSuperclassTest extends BaseCoreFunctionalTestCase session = openSession(); session.beginTransaction(); Account account = (Account) session.get( Account.class, savingsAccount.getId() ); - assertEquals( withdrawalLimit, ( (SavingsAccount) account ).getWithdrawalLimit() ); + // Oracle returns the BigDecimal with scale=0, which is equal to 1000 (not 1000.00); + // compare using BigDecimal.doubleValue; + assertEquals( + withdrawalLimit.doubleValue(), + ( (SavingsAccount) account ).getWithdrawalLimit().doubleValue(), + 0.001); session.delete( account ); session.getTransaction().commit(); session.close();