diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithManyToMany_HHH_11302_Test.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithManyToMany_HHH_11302_Test.java index c8d6dabc56..7840a7912d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithManyToMany_HHH_11302_Test.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithManyToMany_HHH_11302_Test.java @@ -60,6 +60,9 @@ public class EmbeddableWithManyToMany_HHH_11302_Test "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" ) ); } + finally { + serviceRegistry().destroy(); + } } @Test diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_11302_Test.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_11302_Test.java index d21b36bd37..893d6c1e04 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_11302_Test.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_11302_Test.java @@ -60,6 +60,9 @@ public class EmbeddableWithOneToMany_HHH_11302_Test "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" ) ); } + finally { + serviceRegistry().destroy(); + } } @Test diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8564_Test.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8564_Test.java index 13c575f43c..f69c38aaf7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8564_Test.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8564_Test.java @@ -55,6 +55,9 @@ public class EmbeddableWithOneToMany_HHH_8564_Test "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" ) ); } + finally { + serviceRegistry().destroy(); + } } @Test diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8860_Test.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8860_Test.java index 994b4e02a3..85212876f8 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8860_Test.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8860_Test.java @@ -53,6 +53,9 @@ public class EmbeddableWithOneToMany_HHH_8860_Test "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" ) ); } + finally { + serviceRegistry().destroy(); + } } @Test diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/EmbeddableWithOneToMany_HHH_11302_xml_Test.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/EmbeddableWithOneToMany_HHH_11302_xml_Test.java index 2f382ea4b3..076ba9951b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/EmbeddableWithOneToMany_HHH_11302_xml_Test.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/EmbeddableWithOneToMany_HHH_11302_xml_Test.java @@ -6,10 +6,14 @@ */ package org.hibernate.test.annotations.embeddables.collection.xml; +import java.util.Map; + import org.hibernate.AnnotationException; +import org.hibernate.cfg.AvailableSettings; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.testing.TestForIssue; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.junit.Assert.assertTrue; @@ -22,6 +26,8 @@ import static org.junit.Assert.fail; public class EmbeddableWithOneToMany_HHH_11302_xml_Test extends BaseEntityManagerFunctionalTestCase { + PreparedStatementSpyConnectionProvider connectionProvider = new PreparedStatementSpyConnectionProvider(); + @Override public String[] getEjb3DD() { return new String[] { @@ -39,6 +45,15 @@ public class EmbeddableWithOneToMany_HHH_11302_xml_Test extends "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" ) ); } + finally { + connectionProvider.stop(); + } + } + + protected Map buildSettings() { + Map settings = super.buildSettings(); + settings.put( AvailableSettings.CONNECTION_PROVIDER, connectionProvider ); + return settings; } @Test diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/HQLTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/HQLTest.java index ec4ae26d4b..54dccf240b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/HQLTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/HQLTest.java @@ -127,7 +127,12 @@ public class HQLTest extends QueryTranslatorTestCase { } @Test - @SkipForDialect( value = { Oracle8iDialect.class, AbstractHANADialect.class } ) + @SkipForDialect( value = { + Oracle8iDialect.class, + AbstractHANADialect.class, + PostgreSQL81Dialect.class, + MySQLDialect.class + } ) public void testRowValueConstructorSyntaxInInListBeingTranslated() { QueryTranslatorImpl translator = createNewQueryTranslator("from LineItem l where l.id in (?)"); assertInExist("'in' should be translated to 'and'", false, translator); diff --git a/hibernate-core/src/test/java/org/hibernate/test/tool/schema/SchemaToolTransactionHandlingTest.java b/hibernate-core/src/test/java/org/hibernate/test/tool/schema/SchemaToolTransactionHandlingTest.java index 060291ed23..4369e0144a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/tool/schema/SchemaToolTransactionHandlingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/tool/schema/SchemaToolTransactionHandlingTest.java @@ -17,6 +17,7 @@ import javax.transaction.Transaction; import org.hibernate.boot.Metadata; import org.hibernate.boot.MetadataSources; import org.hibernate.boot.registry.StandardServiceRegistry; +import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl; import org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl; import org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder; import org.hibernate.tool.schema.SourceType; @@ -79,9 +80,9 @@ public class SchemaToolTransactionHandlingTest extends BaseUnitTestCase { throw new RuntimeException( "Unable to access JTA Transaction prior to starting test", e ); } + final StandardServiceRegistry registry = buildJtaStandardServiceRegistry(); // perform the test... try { - final StandardServiceRegistry registry = buildJtaStandardServiceRegistry(); final SchemaManagementTool smt = registry.getService( SchemaManagementTool.class ); final SchemaDropper schemaDropper = smt.getSchemaDropper( Collections.emptyMap() ); final SchemaCreator schemaCreator = smt.getSchemaCreator( Collections.emptyMap() ); @@ -118,6 +119,7 @@ public class SchemaToolTransactionHandlingTest extends BaseUnitTestCase { finally { try { jtaTransaction.commit(); + ((StandardServiceRegistryImpl) registry).destroy(); } catch (Exception e) { // not much we can do... @@ -146,9 +148,9 @@ public class SchemaToolTransactionHandlingTest extends BaseUnitTestCase { throw new RuntimeException( "Unable to access JTA Transaction prior to starting test", e ); } + final StandardServiceRegistry registry = buildJtaStandardServiceRegistry(); // perform the test... try { - final StandardServiceRegistry registry = buildJtaStandardServiceRegistry(); final SchemaManagementTool smt = registry.getService( SchemaManagementTool.class ); final Metadata mappings = buildMappings( registry ); @@ -189,6 +191,7 @@ public class SchemaToolTransactionHandlingTest extends BaseUnitTestCase { finally { try { jtaTransaction.commit(); + ((StandardServiceRegistryImpl) registry).destroy(); } catch (Exception e) { // not much we can do...