Re-enable additional tests

This commit is contained in:
Andrea Boriero 2021-11-16 14:26:12 +01:00 committed by Andrea Boriero
parent 7f574f4a2a
commit 92e8436014
5 changed files with 38 additions and 27 deletions

View File

@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
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"
};
}
@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 );

View File

@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
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<? extends Dialect> aClass = strategySelector.resolve( simpleName );
Assert.assertNotNull( aClass );
Assert.assertEquals( dialectClass, aClass );
assertNotNull( aClass );
assertEquals( dialectClass, aClass );
}
}

View File

@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
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<? extends JtaPlatform> aClass = strategySelector.resolve( name );
Assert.assertNotNull( aClass );
Assert.assertEquals( expectedType, aClass );
assertNotNull( aClass );
assertEquals( expectedType, aClass );
}
}

View File

@ -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() {