HHH-15046: test for db2z & db2i initalization error

both errors ocure because private property "version" is used
through the super-constructor before being intialized.
This commit is contained in:
Atgoogat 2022-01-21 12:46:00 +01:00 committed by Christian Beikov
parent 5c4ab4eaf6
commit b2c29f9ba1
2 changed files with 55 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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<Integer> getSupportedJdbcTypeCodes() {
return List.of(TIMESTAMP_WITH_TIMEZONE);
}
}
@Test
public void testInitWithTimezoneSupport() {
final var db2zDialect = new DB2zDialectWithExplicitTimezoneSupport();
assertNotNull(db2zDialect);
}
}