diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/AbstractCharsetNamingStrategyTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/AbstractCharsetNamingStrategyTest.java index 8e0c02e1d3..044b569e65 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/AbstractCharsetNamingStrategyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/AbstractCharsetNamingStrategyTest.java @@ -40,11 +40,11 @@ import static org.junit.Assert.assertEquals; @TestForIssue( jiraKey = "HHH-12357" ) public abstract class AbstractCharsetNamingStrategyTest extends BaseUnitTestCase { - private ServiceRegistry serviceRegistry; + protected ServiceRegistry serviceRegistry; @Before public void setUp() { - Map properties = new HashMap( Environment.getProperties() ); + Map properties = new HashMap<>( Environment.getProperties() ); properties.put( AvailableSettings.HBM2DDL_CHARSET_NAME, charsetName() ); serviceRegistry = ServiceRegistryBuilder.buildServiceRegistry( properties ); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/Iso88591CharsetNamingStrategyTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/Iso88591CharsetNamingStrategyTest.java index bc16dbd668..7ae6a2f401 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/Iso88591CharsetNamingStrategyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/Iso88591CharsetNamingStrategyTest.java @@ -8,6 +8,9 @@ // $Id$ package org.hibernate.test.annotations.namingstrategy.charset; +import org.hibernate.dialect.AbstractHANADialect; +import org.hibernate.engine.jdbc.spi.JdbcServices; + /** * @author Vlad Mihalcea */ @@ -20,16 +23,31 @@ public class Iso88591CharsetNamingStrategyTest extends AbstractCharsetNamingStra @Override protected String expectedUniqueKeyName() { - return "UKq2jxex2hrvg4139p85npyj71g"; + if ( this.serviceRegistry.getService( JdbcServices.class ).getDialect() instanceof AbstractHANADialect ) { + return "UK38xspy14r49kkcmmyltias1j4"; // Non-ASCII, non-alphanumeric identifiers are quoted on HANA + } + else { + return "UKq2jxex2hrvg4139p85npyj71g"; + } } @Override protected String expectedForeignKeyName() { - return "FKdeqq4y6cesc2yfgi97u2hp61g"; + if ( this.serviceRegistry.getService( JdbcServices.class ).getDialect() instanceof AbstractHANADialect ) { + return "FKdvmx00nr88d03v6xhrjyujrq2"; // Non-ASCII, non-alphanumeric identifiers are quoted on HANA + } + else { + return "FKdeqq4y6cesc2yfgi97u2hp61g"; + } } @Override protected String expectedIndexName() { - return "IDXq2jxex2hrvg4139p85npyj71g"; + if ( this.serviceRegistry.getService( JdbcServices.class ).getDialect() instanceof AbstractHANADialect ) { + return "IDX38xspy14r49kkcmmyltias1j4"; // Non-ASCII, non-alphanumeric identifiers are quoted on HANA + } + else { + return "IDXq2jxex2hrvg4139p85npyj71g"; + } } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/Utf8CharsetNamingStrategyTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/Utf8CharsetNamingStrategyTest.java index 669ff5cf06..d35ca0cc75 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/Utf8CharsetNamingStrategyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/namingstrategy/charset/Utf8CharsetNamingStrategyTest.java @@ -8,7 +8,8 @@ // $Id$ package org.hibernate.test.annotations.namingstrategy.charset; -import org.hibernate.testing.TestForIssue; +import org.hibernate.dialect.AbstractHANADialect; +import org.hibernate.engine.jdbc.spi.JdbcServices; /** * @author Vlad Mihalcea @@ -22,16 +23,31 @@ public class Utf8CharsetNamingStrategyTest extends AbstractCharsetNamingStrategy @Override protected String expectedUniqueKeyName() { - return "UKpm66tdjkgtsca5x2uwux487t5"; + if ( this.serviceRegistry.getService( JdbcServices.class ).getDialect() instanceof AbstractHANADialect ) { + return "UKinnacp0woeltj5l0k4vgabf8k"; // Non-ASCII, non-alphanumeric identifiers are quoted on HANA + } + else { + return "UKpm66tdjkgtsca5x2uwux487t5"; + } } @Override protected String expectedForeignKeyName() { - return "FKgvrnki5fwp3qo0hfp1bu1jj0q"; + if ( this.serviceRegistry.getService( JdbcServices.class ).getDialect() instanceof AbstractHANADialect ) { + return "FKe1lr9dd16cmmon53r7m736yev"; // Non-ASCII, non-alphanumeric identifiers are quoted on HANA + } + else { + return "FKgvrnki5fwp3qo0hfp1bu1jj0q"; + } } @Override protected String expectedIndexName() { - return "IDXpm66tdjkgtsca5x2uwux487t5"; + if ( this.serviceRegistry.getService( JdbcServices.class ).getDialect() instanceof AbstractHANADialect ) { + return "IDXinnacp0woeltj5l0k4vgabf8k"; // Non-ASCII, non-alphanumeric identifiers are quoted on HANA + } + else { + return "IDXpm66tdjkgtsca5x2uwux487t5"; + } } }