diff --git a/hibernate-core/src/test/java/org/hibernate/test/dynamicmap/DynamicMapTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/dynamicmap/DynamicMapTest.java similarity index 64% rename from hibernate-core/src/test/java/org/hibernate/test/dynamicmap/DynamicMapTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/dynamicmap/DynamicMapTest.java index 0e73b3f4fb..41a6356874 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/dynamicmap/DynamicMapTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/dynamicmap/DynamicMapTest.java @@ -4,33 +4,32 @@ * 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.test.dynamicmap; +package org.hibernate.orm.test.dynamicmap; import java.util.HashMap; import java.util.List; import java.util.Map; import org.hibernate.testing.TestForIssue; -import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.junit.Test; +import org.hibernate.testing.orm.junit.DomainModel; +import org.hibernate.testing.orm.junit.SessionFactory; +import org.hibernate.testing.orm.junit.SessionFactoryScope; +import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.notNullValue; -import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; -import static org.junit.Assert.assertThat; -@TestForIssue( jiraKey = "HHH-12539") -public class DynamicMapTest extends BaseCoreFunctionalTestCase { - @Override - protected String[] getMappings() { - return new String[] { - "dynamicmap/Test.hbm.xml" - }; - } +@TestForIssue(jiraKey = "HHH-12539") +@DomainModel( + xmlMappings = "org/hibernate/orm/test/dynamicmap/Test.hbm.xml" +) +@SessionFactory +public class DynamicMapTest { @Test - public void bootstrappingTest() { - doInHibernate( this::sessionFactory, session -> { + public void bootstrappingTest(SessionFactoryScope scope) { + scope.inTransaction( session -> { Map item1 = new HashMap(); item1.put( "name", "cup" ); item1.put( "description", "abc" ); @@ -41,7 +40,7 @@ public class DynamicMapTest extends BaseCoreFunctionalTestCase { session.save( "Item1", item1 ); } ); - doInHibernate( this::sessionFactory, session -> { + scope.inTransaction( session -> { List result = session.createQuery( "from Item1" ).list(); assertThat( result.size(), is( 1 ) ); Map item1 = (Map) result.get( 0 ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/dynamicmap/Test.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/dynamicmap/Test.hbm.xml similarity index 100% rename from hibernate-core/src/test/java/org/hibernate/test/dynamicmap/Test.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/dynamicmap/Test.hbm.xml diff --git a/hibernate-core/src/test/java/org/hibernate/test/strategyselectors/DefaultDialectSelectorTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/strategyselectors/DefaultDialectSelectorTest.java similarity index 81% rename from hibernate-core/src/test/java/org/hibernate/test/strategyselectors/DefaultDialectSelectorTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/strategyselectors/DefaultDialectSelectorTest.java index f77d4acfbc..c57c5ef956 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/strategyselectors/DefaultDialectSelectorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/strategyselectors/DefaultDialectSelectorTest.java @@ -4,13 +4,15 @@ * 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.test.strategyselectors; +package org.hibernate.orm.test.strategyselectors; import org.hibernate.boot.registry.selector.internal.DefaultDialectSelector; import org.hibernate.dialect.*; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class DefaultDialectSelectorTest { @@ -23,21 +25,28 @@ public class DefaultDialectSelectorTest { testDialectNamingResolution( DB2390V8Dialect.class ); testDialectNamingResolution( DB2400Dialect.class ); testDialectNamingResolution( DB2400V7R3Dialect.class ); + + testDialectNamingResolution( DerbyDialect.class ); testDialectNamingResolution( DerbyTenFiveDialect.class ); testDialectNamingResolution( DerbyTenSixDialect.class ); testDialectNamingResolution( DerbyTenSevenDialect.class ); + testDialectNamingResolution( H2Dialect.class ); testDialectNamingResolution( HANAColumnStoreDialect.class ); testDialectNamingResolution( HANARowStoreDialect.class ); testDialectNamingResolution( HSQLDialect.class ); + testDialectNamingResolution( MySQLDialect.class ); testDialectNamingResolution( MySQL5Dialect.class ); testDialectNamingResolution( MySQL57Dialect.class ); testDialectNamingResolution( MySQL8Dialect.class ); + + testDialectNamingResolution( OracleDialect.class ); testDialectNamingResolution( Oracle8iDialect.class ); testDialectNamingResolution( Oracle9iDialect.class ); testDialectNamingResolution( Oracle10gDialect.class ); + testDialectNamingResolution( PostgreSQLDialect.class ); testDialectNamingResolution( PostgresPlusDialect.class ); testDialectNamingResolution( PostgreSQL81Dialect.class ); testDialectNamingResolution( PostgreSQL82Dialect.class ); @@ -46,6 +55,8 @@ public class DefaultDialectSelectorTest { testDialectNamingResolution( SQLServerDialect.class ); testDialectNamingResolution( SQLServer2005Dialect.class ); testDialectNamingResolution( SQLServer2008Dialect.class ); + + testDialectNamingResolution( SybaseDialect.class ); testDialectNamingResolution( Sybase11Dialect.class ); testDialectNamingResolution( SybaseASE15Dialect.class ); testDialectNamingResolution( SybaseASE157Dialect.class ); @@ -57,8 +68,8 @@ public class DefaultDialectSelectorTest { simpleName = simpleName.substring( 0, simpleName.length() - "Dialect".length() ); } Class aClass = strategySelector.resolve( simpleName ); - Assert.assertNotNull( aClass ); - Assert.assertEquals( dialectClass, aClass ); + assertNotNull( aClass ); + assertEquals( dialectClass, aClass ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/strategyselectors/JtaPlatformSelectorTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/strategyselectors/JtaPlatformSelectorTest.java similarity index 95% rename from hibernate-core/src/test/java/org/hibernate/test/strategyselectors/JtaPlatformSelectorTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/strategyselectors/JtaPlatformSelectorTest.java index 1ce871e3f1..b9ea2c29d6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/strategyselectors/JtaPlatformSelectorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/strategyselectors/JtaPlatformSelectorTest.java @@ -4,7 +4,7 @@ * 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.test.strategyselectors; +package org.hibernate.orm.test.strategyselectors; import org.hibernate.boot.registry.selector.internal.DefaultJtaPlatformSelector; import org.hibernate.engine.transaction.jta.platform.internal.AtomikosJtaPlatform; @@ -26,8 +26,10 @@ import org.hibernate.engine.transaction.jta.platform.internal.WebSphereLibertyJt import org.hibernate.engine.transaction.jta.platform.internal.WeblogicJtaPlatform; import org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class JtaPlatformSelectorTest { @@ -167,8 +169,8 @@ public class JtaPlatformSelectorTest { private static void expectResolution(final DefaultJtaPlatformSelector strategySelector, final Class expectedType, final String name) { Class aClass = strategySelector.resolve( name ); - Assert.assertNotNull( aClass ); - Assert.assertEquals( expectedType, aClass ); + assertNotNull( aClass ); + assertEquals( expectedType, aClass ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java b/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java index e3b3823381..b114517d49 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java @@ -76,7 +76,6 @@ import static org.junit.jupiter.api.Assertions.fail; ) @SessionFactory // todo (6.0): needs a composite user type mechanism e.g. by providing a custom ComponentTuplizer/Instantiator -@Disabled( value = "Missing support for composite user types" ) public class NativeSQLQueriesTest { protected String getOrganizationFetchJoinEmploymentSQL() {