HHH-8061 - Fixing EnumSet test on Oracle
This commit is contained in:
parent
2c5098b9c6
commit
11287c2e02
|
@ -115,11 +115,15 @@ public class EnumSet extends BaseEnversJPAFunctionalTestCase {
|
|||
@TestForIssue( jiraKey = "HHH-7780" )
|
||||
public void testEnumRepresentation() {
|
||||
EntityManager entityManager = getEntityManager();
|
||||
List<Object[]> enums1 = entityManager.createNativeQuery( "SELECT enums1 FROM EnumSetEntity_enums1_AUD ORDER BY rev ASC" ).getResultList();
|
||||
List<Object[]> enums2 = entityManager.createNativeQuery( "SELECT enums2 FROM EnumSetEntity_enums2_AUD ORDER BY rev ASC" ).getResultList();
|
||||
List<Object> enums1 = entityManager.createNativeQuery( "SELECT enums1 FROM EnumSetEntity_enums1_AUD ORDER BY rev ASC" ).getResultList();
|
||||
List<Object> enums2 = entityManager.createNativeQuery( "SELECT enums2 FROM EnumSetEntity_enums2_AUD ORDER BY rev ASC" ).getResultList();
|
||||
entityManager.close();
|
||||
|
||||
Assert.assertEquals( Arrays.asList( "X", "Y", "X" ), enums1 );
|
||||
Assert.assertEquals( Arrays.asList( 0 ), enums2 );
|
||||
|
||||
Assert.assertEquals( 1, enums2.size() );
|
||||
Object enum2 = enums2.get( 0 );
|
||||
// Compare the Strings to account for, as an example, Oracle returning a BigDecimal instead of an int.
|
||||
Assert.assertEquals( "0", enum2.toString() );
|
||||
}
|
||||
}
|
|
@ -43,6 +43,7 @@ public class EnumTypeTest extends BaseEnversJPAFunctionalTestCase {
|
|||
Assert.assertNotNull( values );
|
||||
Assert.assertEquals( 1, values.size() );
|
||||
Object[] results = values.get( 0 );
|
||||
Assert.assertEquals( 2, results.length );
|
||||
Assert.assertEquals( "X", results[0] );
|
||||
// Compare the Strings to account for, as an example, Oracle
|
||||
// returning a BigDecimal instead of an int.
|
||||
|
|
Loading…
Reference in New Issue