diff --git a/hibernate-core/src/test/java/org/hibernate/dialect/DialectContextTest.java b/hibernate-core/src/test/java/org/hibernate/dialect/DialectContextTest.java new file mode 100644 index 0000000000..9c2dd06df6 --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/dialect/DialectContextTest.java @@ -0,0 +1,21 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.dialect; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.hibernate.testing.orm.junit.DialectContext; +import org.junit.Test; + +public class DialectContextTest { + + @Test + public void smoke() { + Dialect current = DialectContext.getDialect(); + assertThat( current ).isNotNull(); + } +} diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectContext.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectContext.java index 997550274c..2672b89891 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectContext.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectContext.java @@ -14,8 +14,6 @@ import java.util.Properties; import org.hibernate.HibernateException; import org.hibernate.cfg.Environment; import org.hibernate.dialect.Dialect; -import org.hibernate.engine.jdbc.dialect.spi.DatabaseMetaDataDialectResolutionInfoAdapter; -import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; import org.hibernate.internal.util.ReflectHelper; /** @@ -33,13 +31,13 @@ public final class DialectContext { } try { final Class dialectClass = ReflectHelper.classForName( dialectName ); - final Constructor constructor = dialectClass.getConstructor( DialectResolutionInfo.class ); + final Constructor constructor = dialectClass.getConstructor(); Driver driver = (Driver) Class.forName( properties.getProperty( Environment.DRIVER ) ).newInstance(); Properties props = new Properties(); props.setProperty( "user", properties.getProperty( Environment.USER ) ); props.setProperty( "password", properties.getProperty( Environment.PASS ) ); try (Connection connection = driver.connect( properties.getProperty( Environment.URL ), props )) { - dialect = constructor.newInstance( new DatabaseMetaDataDialectResolutionInfoAdapter( connection.getMetaData() ) ); + dialect = constructor.newInstance(); } } catch (ClassNotFoundException cnfe) {