HHH-6751 : Test failure due to inconsistent scale returned for BigDecimal properties

This commit is contained in:
Gail Badner 2011-10-20 13:01:16 -07:00
parent c5733e7837
commit 7c2d88df8b
1 changed files with 6 additions and 1 deletions

View File

@ -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();