Skip to content

Commit 5b4a720

Browse files
committed
HHH-19846 - Drop JUnit 4 usage
Not converted... * org.hibernate.orm.test.hql.PostgreSQLFunctionSelectClauseTest - registering custom function * org.hibernate.orm.test.hql.PostgreSQLFunctionWhereClauseTest - aux-db-object * org.hibernate.orm.test.id.usertype - type registrations * org.hibernate.orm.test.idgen.enhanced.HiloOptimizerConcurrencyTest - recreation of SF during tests * org.hibernate.orm.test.type.AbstractJavaTimeTypeTest subtypes - crazy parameterization (see org.hibernate.orm.test.tm.InterceptorTransactionTest) * org.hibernate.orm.test.cdi.general.hibernatesearch.extended.HibernateSearchExtendedCdiSupportTest - not sure yet, all the other tests here pass with conversion - shelved for now
1 parent d72d436 commit 5b4a720

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/hql/DB297SubStringFunctionsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public void testSubstrWithoutStringUnits(SessionFactoryScope factoryScope) {
114114
assertThat( value ).isEqualTo( "description" );
115115
} );
116116
assertThat( sqlCollector.getSqlQueries() ).hasSize( 1 );
117-
assertThat( sqlCollector.getSqlQueries().get( 0 ) ).contains( "substring(" );
117+
assertThat( sqlCollector.getSqlQueries().get( 0 ) ).contains( "substr(" );
118118
}
119119

120120
@Entity(name="AnEntity")

hibernate-core/src/test/java/org/hibernate/orm/test/schemafilter/CatalogFilterTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.hibernate.testing.orm.junit.RequiresDialect;
2121
import org.hibernate.testing.orm.junit.ServiceRegistry;
2222
import org.hibernate.testing.orm.junit.ServiceRegistryScope;
23+
import org.hibernate.testing.orm.junit.Setting;
2324
import org.hibernate.tool.schema.internal.DefaultSchemaFilter;
2425
import org.hibernate.tool.schema.internal.SchemaCreatorImpl;
2526
import org.hibernate.tool.schema.internal.SchemaDropperImpl;
@@ -30,9 +31,10 @@
3031
import org.junit.jupiter.api.Test;
3132

3233
import static org.hamcrest.MatcherAssert.assertThat;
34+
import static org.hibernate.cfg.JdbcSettings.FORMAT_SQL;
3335

3436
@SuppressWarnings({"rawtypes", "unchecked", "JUnitMalformedDeclaration"})
35-
@ServiceRegistry
37+
@ServiceRegistry(settings = @Setting(name = FORMAT_SQL, value = "false"))
3638
@RequiresDialect(value = SQLServerDialect.class, comment = "Unit test - limit to minimize complexity of checks")
3739
@DomainModel(annotatedClasses = {
3840
CatalogFilterTest.CatalogNoneEntity0.class,

hibernate-core/src/test/java/org/hibernate/orm/test/where/hbm/LazyManyToManyNonUniqueIdNotFoundWhereTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
@SuppressWarnings("JUnitMalformedDeclaration")
3131
@DomainModel(xmlMappings = "hbm/where/LazyManyToManyNonUniqueIdNotFoundWhereTest.hbm.xml")
32-
@SessionFactory(exportSchema = false)
32+
@SessionFactory
3333
public class LazyManyToManyNonUniqueIdNotFoundWhereTest {
3434
@AfterAll
3535
static void dropSchema(SessionFactoryScope factoryScope) {
@@ -41,9 +41,9 @@ public void createSchema(SessionFactoryScope factoryScope) {
4141
factoryScope.inTransaction( session -> session.doWork( connection -> {
4242
final Dialect dialect = session.getDialect();
4343
try (final Statement statement = connection.createStatement()) {
44+
statement.executeUpdate( dialect.getDropTableString( "MATERIAL_RATINGS" ) );
4445
statement.executeUpdate( dialect.getDropTableString( "BUILDING_RATINGS" ) );
4546
statement.executeUpdate( dialect.getDropTableString( "ASSOCIATION_TABLE" ) );
46-
statement.executeUpdate( dialect.getDropTableString( "MATERIAL_RATINGS" ) );
4747
statement.executeUpdate( dialect.getDropTableString( "MAIN_TABLE" ) );
4848

4949
statement.executeUpdate( """

0 commit comments

Comments
 (0)