Skip to content

Commit 990a5a8

Browse files
committed
Remove HANA related double precision tests that became obsolete since drivers were updated
1 parent 0bc9557 commit 990a5a8

File tree

1 file changed

+0
-109
lines changed

1 file changed

+0
-109
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/dialect/functional/HANADecimalTest.java

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -63,115 +63,6 @@ protected void cleanupTest() throws Exception {
6363
} );
6464
}
6565

66-
@Test
67-
@TestForIssue(jiraKey = "HHH-12995")
68-
public void testDecimalTypeFalse() throws Exception {
69-
rebuildSessionFactory( configuration -> {
70-
configuration.setProperty( "hibernate.dialect.hana.treat_double_typed_fields_as_decimal", Boolean.FALSE.toString() );
71-
} );
72-
73-
Session s = openSession();
74-
s.beginTransaction();
75-
76-
DecimalEntity entity = new DecimalEntity();
77-
entity.key = Integer.valueOf( 1 );
78-
entity.doubleDouble = 1.19d;
79-
entity.decimalDecimal = BigDecimal.valueOf( 1.19d );
80-
entity.doubleDecimal = 1.19d;
81-
entity.decimalDouble = BigDecimal.valueOf( 1.19d );
82-
83-
s.persist( entity );
84-
85-
DecimalEntity entity2 = new DecimalEntity();
86-
entity2.key = Integer.valueOf( 2 );
87-
entity2.doubleDouble = 0.3d;
88-
entity2.decimalDecimal = BigDecimal.valueOf( 0.3d );
89-
entity2.doubleDecimal = 0.3d;
90-
entity2.decimalDouble = BigDecimal.valueOf( 0.3d );
91-
92-
s.persist( entity2 );
93-
94-
s.flush();
95-
96-
s.getTransaction().commit();
97-
98-
s.clear();
99-
100-
Query<DecimalEntity> legacyQuery = s.createQuery( "select b from " + ENTITY_NAME + " b order by key asc", DecimalEntity.class );
101-
102-
List<DecimalEntity> retrievedEntities = legacyQuery.getResultList();
103-
104-
assertEquals(2, retrievedEntities.size());
105-
106-
DecimalEntity retrievedEntity = retrievedEntities.get( 0 );
107-
assertEquals( Integer.valueOf( 1 ), retrievedEntity.key );
108-
assertEquals( 1.19d, retrievedEntity.doubleDouble, 0 );
109-
assertEquals( new BigDecimal( "1.190000000000000" ), retrievedEntity.decimalDecimal );
110-
assertEquals( 1.189999999999999d, retrievedEntity.doubleDecimal, 0 );
111-
assertEquals( new BigDecimal( "1.19" ), retrievedEntity.decimalDouble );
112-
113-
retrievedEntity = retrievedEntities.get( 1 );
114-
assertEquals( Integer.valueOf( 2 ), retrievedEntity.key );
115-
assertEquals( 0.3d, retrievedEntity.doubleDouble, 0 );
116-
assertEquals( new BigDecimal( "0.300000000000000" ), retrievedEntity.decimalDecimal );
117-
assertEquals( 0.299999999999999d, retrievedEntity.doubleDecimal, 0 );
118-
assertEquals( new BigDecimal( "0.3" ), retrievedEntity.decimalDouble );
119-
120-
}
121-
122-
@Test
123-
@TestForIssue(jiraKey = "HHH-12995")
124-
public void testDecimalTypeDefault() throws Exception {
125-
rebuildSessionFactory();
126-
127-
Session s = openSession();
128-
s.beginTransaction();
129-
130-
DecimalEntity entity = new DecimalEntity();
131-
entity.key = Integer.valueOf( 1 );
132-
entity.doubleDouble = 1.19d;
133-
entity.decimalDecimal = BigDecimal.valueOf( 1.19d );
134-
entity.doubleDecimal = 1.19d;
135-
entity.decimalDouble = BigDecimal.valueOf( 1.19d );
136-
137-
s.persist( entity );
138-
139-
DecimalEntity entity2 = new DecimalEntity();
140-
entity2.key = Integer.valueOf( 2 );
141-
entity2.doubleDouble = 0.3d;
142-
entity2.decimalDecimal = BigDecimal.valueOf( 0.3d );
143-
entity2.doubleDecimal = 0.3d;
144-
entity2.decimalDouble = BigDecimal.valueOf( 0.3d );
145-
146-
s.persist( entity2 );
147-
148-
s.flush();
149-
150-
s.getTransaction().commit();
151-
152-
s.clear();
153-
154-
Query<DecimalEntity> legacyQuery = s.createQuery( "select b from " + ENTITY_NAME + " b order by key asc", DecimalEntity.class );
155-
156-
List<DecimalEntity> retrievedEntities = legacyQuery.getResultList();
157-
158-
assertEquals(2, retrievedEntities.size());
159-
160-
DecimalEntity retrievedEntity = retrievedEntities.get( 0 );
161-
assertEquals( Integer.valueOf( 1 ), retrievedEntity.key );
162-
assertEquals( 1.19d, retrievedEntity.doubleDouble, 0 );
163-
assertEquals( new BigDecimal( "1.190000000000000" ), retrievedEntity.decimalDecimal );
164-
assertEquals( 1.189999999999999d, retrievedEntity.doubleDecimal, 0 );
165-
assertEquals( new BigDecimal( "1.19" ), retrievedEntity.decimalDouble );
166-
167-
retrievedEntity = retrievedEntities.get( 1 );
168-
assertEquals( Integer.valueOf( 2 ), retrievedEntity.key );
169-
assertEquals( 0.3d, retrievedEntity.doubleDouble, 0 );
170-
assertEquals( new BigDecimal( "0.300000000000000" ), retrievedEntity.decimalDecimal );
171-
assertEquals( 0.299999999999999d, retrievedEntity.doubleDecimal, 0 );
172-
assertEquals( new BigDecimal( "0.3" ), retrievedEntity.decimalDouble );
173-
}
174-
17566
@Test
17667
@TestForIssue(jiraKey = "HHH-12995")
17768
public void testDecimalTypeTrue() throws Exception {

0 commit comments

Comments
 (0)