Skip to content

Commit 30241bb

Browse files
marko-bekhtabeikov
authored andcommitted
HHH-17295 Change which constructor is looked-up in DialectContext test utils
1 parent 4bf9bfa commit 30241bb

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5+
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
6+
*/
7+
package org.hibernate.dialect;
8+
9+
import static org.assertj.core.api.Assertions.assertThat;
10+
11+
import org.hibernate.testing.orm.junit.DialectContext;
12+
import org.junit.Test;
13+
14+
public class DialectContextTest {
15+
16+
@Test
17+
public void smoke() {
18+
Dialect current = DialectContext.getDialect();
19+
assertThat( current ).isNotNull();
20+
}
21+
}

hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectContext.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import org.hibernate.HibernateException;
1515
import org.hibernate.cfg.Environment;
1616
import org.hibernate.dialect.Dialect;
17-
import org.hibernate.engine.jdbc.dialect.spi.DatabaseMetaDataDialectResolutionInfoAdapter;
18-
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
1917
import org.hibernate.internal.util.ReflectHelper;
2018

2119
/**
@@ -33,13 +31,13 @@ static void init() {
3331
}
3432
try {
3533
final Class<? extends Dialect> dialectClass = ReflectHelper.classForName( dialectName );
36-
final Constructor<? extends Dialect> constructor = dialectClass.getConstructor( DialectResolutionInfo.class );
34+
final Constructor<? extends Dialect> constructor = dialectClass.getConstructor();
3735
Driver driver = (Driver) Class.forName( properties.getProperty( Environment.DRIVER ) ).newInstance();
3836
Properties props = new Properties();
3937
props.setProperty( "user", properties.getProperty( Environment.USER ) );
4038
props.setProperty( "password", properties.getProperty( Environment.PASS ) );
4139
try (Connection connection = driver.connect( properties.getProperty( Environment.URL ), props )) {
42-
dialect = constructor.newInstance( new DatabaseMetaDataDialectResolutionInfoAdapter( connection.getMetaData() ) );
40+
dialect = constructor.newInstance();
4341
}
4442
}
4543
catch (ClassNotFoundException cnfe) {

0 commit comments

Comments
 (0)