HHH-16311 - Fix HANA test issues

This commit is contained in:
Christian Beikov 2023-03-20 17:31:53 +01:00
parent d5e0f064ac
commit 67ba0decd8
1 changed files with 8 additions and 4 deletions

View File

@ -12,9 +12,8 @@ import org.hibernate.boot.Metadata;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.type.ConvertedBasicType;
import org.hibernate.type.CustomType;
import org.hibernate.type.EnumType;
import org.hibernate.type.Type;
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry;
import org.hibernate.testing.ServiceRegistryBuilder;
import org.hibernate.testing.TestForIssue;
@ -23,7 +22,6 @@ import org.hibernate.testing.junit4.ExtraAssertions;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
/**
* @author Steve Ebersole
@ -44,8 +42,14 @@ public class OrmXmlEnumTypeTest extends BaseUnitTestCase {
.getProperty( "bindingStringEnum" )
.getType();
final JdbcTypeRegistry jdbcTypeRegistry = metadata.getDatabase()
.getTypeConfiguration()
.getJdbcTypeRegistry();
ConvertedBasicType<?> enumMapping = ExtraAssertions.assertTyping( ConvertedBasicType.class, bindingPropertyType );
assertEquals( Types.VARCHAR, enumMapping.getJdbcType().getJdbcTypeCode() );
assertEquals(
jdbcTypeRegistry.getDescriptor( Types.VARCHAR ),
jdbcTypeRegistry.getDescriptor( enumMapping.getJdbcType().getJdbcTypeCode() )
);
}
finally {
ServiceRegistryBuilder.destroy( ssr );