diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/DB2iDialectInitTestCase.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/DB2iDialectInitTestCase.java new file mode 100644 index 0000000000..c84a67291f --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/DB2iDialectInitTestCase.java @@ -0,0 +1,23 @@ +package org.hibernate.orm.test.dialect; + +import org.hibernate.dialect.DB2iDialect; +import org.hibernate.testing.RequiresDialect; +import org.hibernate.testing.TestForIssue; +import org.junit.Test; + +import static org.junit.Assert.assertNotNull; + +/** + * @author Onno Goczol + */ +@TestForIssue(jiraKey = "HHH-15046") +@RequiresDialect(DB2iDialect.class) +public class DB2iDialectInitTestCase { + + @Test + public void testInitUniqueDelegate() { + final var db2iDialect = new DB2iDialect(); + assertNotNull(db2iDialect); + } + +} diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/DB2zDialectInitTestCase.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/DB2zDialectInitTestCase.java new file mode 100644 index 0000000000..2de4dba02f --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dialect/DB2zDialectInitTestCase.java @@ -0,0 +1,32 @@ +package org.hibernate.orm.test.dialect; + +import org.hibernate.dialect.DB2zDialect; +import org.hibernate.testing.RequiresDialect; +import org.hibernate.testing.TestForIssue; +import org.junit.Test; + +import java.util.List; + +import static org.hibernate.type.SqlTypes.TIMESTAMP_WITH_TIMEZONE; +import static org.junit.Assert.assertNotNull; + +/** + * @author Onno Goczol + */ +@TestForIssue(jiraKey = "HHH-15046") +@RequiresDialect(DB2zDialect.class) +public class DB2zDialectInitTestCase { + + static class DB2zDialectWithExplicitTimezoneSupport extends DB2zDialect { + @Override + protected List getSupportedJdbcTypeCodes() { + return List.of(TIMESTAMP_WITH_TIMEZONE); + } + } + + @Test + public void testInitWithTimezoneSupport() { + final var db2zDialect = new DB2zDialectWithExplicitTimezoneSupport(); + assertNotNull(db2zDialect); + } +}