Remove HANA related double precision tests that became obsolete since drivers were updated
This commit is contained in:
parent
4453681e00
commit
eece96bb12
|
@ -63,115 +63,6 @@ public class HANADecimalTest extends BaseCoreFunctionalTestCase {
|
|||
} );
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue(jiraKey = "HHH-12995")
|
||||
public void testDecimalTypeFalse() throws Exception {
|
||||
rebuildSessionFactory( configuration -> {
|
||||
configuration.setProperty( "hibernate.dialect.hana.treat_double_typed_fields_as_decimal", Boolean.FALSE.toString() );
|
||||
} );
|
||||
|
||||
Session s = openSession();
|
||||
s.beginTransaction();
|
||||
|
||||
DecimalEntity entity = new DecimalEntity();
|
||||
entity.key = Integer.valueOf( 1 );
|
||||
entity.doubleDouble = 1.19d;
|
||||
entity.decimalDecimal = BigDecimal.valueOf( 1.19d );
|
||||
entity.doubleDecimal = 1.19d;
|
||||
entity.decimalDouble = BigDecimal.valueOf( 1.19d );
|
||||
|
||||
s.persist( entity );
|
||||
|
||||
DecimalEntity entity2 = new DecimalEntity();
|
||||
entity2.key = Integer.valueOf( 2 );
|
||||
entity2.doubleDouble = 0.3d;
|
||||
entity2.decimalDecimal = BigDecimal.valueOf( 0.3d );
|
||||
entity2.doubleDecimal = 0.3d;
|
||||
entity2.decimalDouble = BigDecimal.valueOf( 0.3d );
|
||||
|
||||
s.persist( entity2 );
|
||||
|
||||
s.flush();
|
||||
|
||||
s.getTransaction().commit();
|
||||
|
||||
s.clear();
|
||||
|
||||
Query<DecimalEntity> legacyQuery = s.createQuery( "select b from " + ENTITY_NAME + " b order by key asc", DecimalEntity.class );
|
||||
|
||||
List<DecimalEntity> retrievedEntities = legacyQuery.getResultList();
|
||||
|
||||
assertEquals(2, retrievedEntities.size());
|
||||
|
||||
DecimalEntity retrievedEntity = retrievedEntities.get( 0 );
|
||||
assertEquals( Integer.valueOf( 1 ), retrievedEntity.key );
|
||||
assertEquals( 1.19d, retrievedEntity.doubleDouble, 0 );
|
||||
assertEquals( new BigDecimal( "1.190000000000000" ), retrievedEntity.decimalDecimal );
|
||||
assertEquals( 1.189999999999999d, retrievedEntity.doubleDecimal, 0 );
|
||||
assertEquals( new BigDecimal( "1.19" ), retrievedEntity.decimalDouble );
|
||||
|
||||
retrievedEntity = retrievedEntities.get( 1 );
|
||||
assertEquals( Integer.valueOf( 2 ), retrievedEntity.key );
|
||||
assertEquals( 0.3d, retrievedEntity.doubleDouble, 0 );
|
||||
assertEquals( new BigDecimal( "0.300000000000000" ), retrievedEntity.decimalDecimal );
|
||||
assertEquals( 0.299999999999999d, retrievedEntity.doubleDecimal, 0 );
|
||||
assertEquals( new BigDecimal( "0.3" ), retrievedEntity.decimalDouble );
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue(jiraKey = "HHH-12995")
|
||||
public void testDecimalTypeDefault() throws Exception {
|
||||
rebuildSessionFactory();
|
||||
|
||||
Session s = openSession();
|
||||
s.beginTransaction();
|
||||
|
||||
DecimalEntity entity = new DecimalEntity();
|
||||
entity.key = Integer.valueOf( 1 );
|
||||
entity.doubleDouble = 1.19d;
|
||||
entity.decimalDecimal = BigDecimal.valueOf( 1.19d );
|
||||
entity.doubleDecimal = 1.19d;
|
||||
entity.decimalDouble = BigDecimal.valueOf( 1.19d );
|
||||
|
||||
s.persist( entity );
|
||||
|
||||
DecimalEntity entity2 = new DecimalEntity();
|
||||
entity2.key = Integer.valueOf( 2 );
|
||||
entity2.doubleDouble = 0.3d;
|
||||
entity2.decimalDecimal = BigDecimal.valueOf( 0.3d );
|
||||
entity2.doubleDecimal = 0.3d;
|
||||
entity2.decimalDouble = BigDecimal.valueOf( 0.3d );
|
||||
|
||||
s.persist( entity2 );
|
||||
|
||||
s.flush();
|
||||
|
||||
s.getTransaction().commit();
|
||||
|
||||
s.clear();
|
||||
|
||||
Query<DecimalEntity> legacyQuery = s.createQuery( "select b from " + ENTITY_NAME + " b order by key asc", DecimalEntity.class );
|
||||
|
||||
List<DecimalEntity> retrievedEntities = legacyQuery.getResultList();
|
||||
|
||||
assertEquals(2, retrievedEntities.size());
|
||||
|
||||
DecimalEntity retrievedEntity = retrievedEntities.get( 0 );
|
||||
assertEquals( Integer.valueOf( 1 ), retrievedEntity.key );
|
||||
assertEquals( 1.19d, retrievedEntity.doubleDouble, 0 );
|
||||
assertEquals( new BigDecimal( "1.190000000000000" ), retrievedEntity.decimalDecimal );
|
||||
assertEquals( 1.189999999999999d, retrievedEntity.doubleDecimal, 0 );
|
||||
assertEquals( new BigDecimal( "1.19" ), retrievedEntity.decimalDouble );
|
||||
|
||||
retrievedEntity = retrievedEntities.get( 1 );
|
||||
assertEquals( Integer.valueOf( 2 ), retrievedEntity.key );
|
||||
assertEquals( 0.3d, retrievedEntity.doubleDouble, 0 );
|
||||
assertEquals( new BigDecimal( "0.300000000000000" ), retrievedEntity.decimalDecimal );
|
||||
assertEquals( 0.299999999999999d, retrievedEntity.doubleDecimal, 0 );
|
||||
assertEquals( new BigDecimal( "0.3" ), retrievedEntity.decimalDouble );
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue(jiraKey = "HHH-12995")
|
||||
public void testDecimalTypeTrue() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue