From 23aad981a8fc1e2d914a3156b2d72cbb31149783 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Thu, 13 Apr 2017 20:29:31 +0200 Subject: [PATCH] HHH-11593 - Remove mockito dependencies from hibernate-testing --- .../jpa/test/criteria/nulliteral/CriteriaLiteralsTest.java | 2 +- .../DisableDiscardPersistenceContextOnCloseTest.java | 2 +- .../EnableDiscardPersistenceContextOnCloseTest.java | 2 +- .../lock/StatementIsClosedAfterALockExceptionTest.java | 6 +----- .../xml/EmbeddableWithOneToMany_HHH_11302_xml_Test.java | 2 +- .../MySQLDropConstraintThrowsExceptionTest.java | 2 +- .../org/hibernate/test/criteria/CriteriaQueryTest.java | 2 +- .../test/dialect/functional/OracleFollowOnLockingTest.java | 2 +- .../org/hibernate/test/distinct/SelectDistinctHqlTest.java | 2 +- .../java/org/hibernate/test/id/SequenceGeneratorTest.java | 2 +- .../test/insertordering/ElementCollectionTest.java | 2 +- .../InsertOrderingWithBidirectionalManyToMany.java | 2 +- .../InsertOrderingWithBidirectionalMapsIdOneToOne.java | 2 +- .../InsertOrderingWithBidirectionalOneToMany.java | 2 +- .../InsertOrderingWithBidirectionalOneToOne.java | 2 +- .../InsertOrderingWithJoinedTableInheritance.java | 2 +- ...InsertOrderingWithJoinedTableMultiLevelInheritance.java | 2 +- .../InsertOrderingWithSingleTableInheritance.java | 2 +- .../InsertOrderingWithTablePerClassInheritance.java | 2 +- .../InsertOrderingWithUnidirectionalOneToOne.java | 2 +- .../hibernate/test/jdbc/internal/SessionJdbcBatchTest.java | 2 +- .../test/locking/PessimisticWriteLockTimeoutTest.java | 2 +- .../test/timestamp/JdbcTimeCustomTimeZoneTest.java | 2 +- .../test/timestamp/JdbcTimeDefaultTimeZoneTest.java | 2 +- .../JdbcTimestampCustomSessionLevelTimeZoneTest.java | 2 +- .../test/timestamp/JdbcTimestampCustomTimeZoneTest.java | 2 +- .../test/timestamp/JdbcTimestampDefaultTimeZoneTest.java | 2 +- .../test/timestamp/JdbcTimestampUTCTimeZoneTest.java | 2 +- .../timestamp/JdbcTimestampWithDefaultUTCTimeZoneTest.java | 2 +- .../timestamp/JdbcTimestampWithoutUTCTimeZoneTest.java | 2 +- .../util}/jdbc/PreparedStatementSpyConnectionProvider.java | 7 +++---- .../hibernate/test/util}/jdbc/SQLStatementInterceptor.java | 2 +- .../test/util}/jdbc/TimeZoneConnectionProvider.java | 4 +++- .../mockito-extensions/org.mockito.plugins.MockMaker | 0 .../cache/ehcache/functional/RefreshUpdatedDataTest.java | 1 - hibernate-testing/hibernate-testing.gradle | 2 -- 36 files changed, 37 insertions(+), 43 deletions(-) rename {hibernate-testing/src/main/java/org/hibernate/testing => hibernate-core/src/test/java/org/hibernate/test/util}/jdbc/PreparedStatementSpyConnectionProvider.java (97%) rename {hibernate-testing/src/main/java/org/hibernate/testing => hibernate-core/src/test/java/org/hibernate/test/util}/jdbc/SQLStatementInterceptor.java (95%) rename {hibernate-testing/src/main/java/org/hibernate/testing => hibernate-core/src/test/java/org/hibernate/test/util}/jdbc/TimeZoneConnectionProvider.java (92%) rename {hibernate-testing/src/main => hibernate-core/src/test}/resources/mockito-extensions/org.mockito.plugins.MockMaker (100%) diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/criteria/nulliteral/CriteriaLiteralsTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/criteria/nulliteral/CriteriaLiteralsTest.java index 25d0f99381..16f850c43f 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/criteria/nulliteral/CriteriaLiteralsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/criteria/nulliteral/CriteriaLiteralsTest.java @@ -28,7 +28,7 @@ import org.hibernate.hql.internal.ast.QuerySyntaxException; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.testing.RequiresDialect; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Before; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/DisableDiscardPersistenceContextOnCloseTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/DisableDiscardPersistenceContextOnCloseTest.java index f98dceb290..ac3e473651 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/DisableDiscardPersistenceContextOnCloseTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/DisableDiscardPersistenceContextOnCloseTest.java @@ -14,7 +14,7 @@ import org.hibernate.jpa.AvailableSettings; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.jpa.test.Wallet; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/EnableDiscardPersistenceContextOnCloseTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/EnableDiscardPersistenceContextOnCloseTest.java index 9b648423d5..31d26f9034 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/EnableDiscardPersistenceContextOnCloseTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/EnableDiscardPersistenceContextOnCloseTest.java @@ -13,7 +13,7 @@ import org.hibernate.jpa.AvailableSettings; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.jpa.test.Wallet; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/lock/StatementIsClosedAfterALockExceptionTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/lock/StatementIsClosedAfterALockExceptionTest.java index 0e8b3c3505..5063c3d0d4 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/lock/StatementIsClosedAfterALockExceptionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/lock/StatementIsClosedAfterALockExceptionTest.java @@ -10,17 +10,13 @@ import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.persistence.LockModeType; import org.hibernate.Session; -import org.hibernate.jpa.AvailableSettings; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; -import org.hibernate.testing.DialectChecks; -import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.TestForIssue; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.hibernate.testing.transaction.TransactionUtil; import org.hibernate.testing.util.ExceptionUtil; import org.junit.Before; 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 c9ef0211f2..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 @@ -13,7 +13,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.testing.TestForIssue; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.junit.Assert.assertTrue; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/uniqueconstraint/MySQLDropConstraintThrowsExceptionTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/uniqueconstraint/MySQLDropConstraintThrowsExceptionTest.java index efd6fff9db..f80948f36a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/uniqueconstraint/MySQLDropConstraintThrowsExceptionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/uniqueconstraint/MySQLDropConstraintThrowsExceptionTest.java @@ -28,7 +28,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseUnitTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java b/hibernate-core/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java index 7439e92691..7a94f9f0e6 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java @@ -51,7 +51,7 @@ import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; import org.hibernate.test.hql.Animal; import org.hibernate.test.hql.Reptile; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/dialect/functional/OracleFollowOnLockingTest.java b/hibernate-core/src/test/java/org/hibernate/test/dialect/functional/OracleFollowOnLockingTest.java index f19539eee7..7139517a74 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/dialect/functional/OracleFollowOnLockingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/dialect/functional/OracleFollowOnLockingTest.java @@ -28,7 +28,7 @@ import org.hibernate.exception.SQLGrammarException; import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.SQLStatementInterceptor; +import org.hibernate.test.util.jdbc.SQLStatementInterceptor; import org.junit.Before; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/test/distinct/SelectDistinctHqlTest.java b/hibernate-core/src/test/java/org/hibernate/test/distinct/SelectDistinctHqlTest.java index 4834fe35b8..9706d719cd 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/distinct/SelectDistinctHqlTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/distinct/SelectDistinctHqlTest.java @@ -20,7 +20,7 @@ import org.hibernate.jpa.QueryHints; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.SQLStatementInterceptor; +import org.hibernate.test.util.jdbc.SQLStatementInterceptor; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/id/SequenceGeneratorTest.java b/hibernate-core/src/test/java/org/hibernate/test/id/SequenceGeneratorTest.java index 67258c4551..86e5bd236f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/id/SequenceGeneratorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/id/SequenceGeneratorTest.java @@ -19,7 +19,7 @@ import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.SQLStatementInterceptor; +import org.hibernate.test.util.jdbc.SQLStatementInterceptor; import org.junit.Test; import static org.junit.Assert.assertTrue; diff --git a/hibernate-core/src/test/java/org/hibernate/test/insertordering/ElementCollectionTest.java b/hibernate-core/src/test/java/org/hibernate/test/insertordering/ElementCollectionTest.java index ab3e83d553..bf147a7964 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/insertordering/ElementCollectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/insertordering/ElementCollectionTest.java @@ -25,7 +25,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalManyToMany.java b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalManyToMany.java index 6df5d85323..2b51659a79 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalManyToMany.java +++ b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalManyToMany.java @@ -24,7 +24,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalMapsIdOneToOne.java b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalMapsIdOneToOne.java index 11ce1b65b9..0cd67a1003 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalMapsIdOneToOne.java +++ b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalMapsIdOneToOne.java @@ -23,7 +23,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalOneToMany.java b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalOneToMany.java index 392126a628..3e8f9fe726 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalOneToMany.java +++ b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalOneToMany.java @@ -25,7 +25,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalOneToOne.java b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalOneToOne.java index cffec0be91..1cab721e0a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalOneToOne.java +++ b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithBidirectionalOneToOne.java @@ -7,7 +7,7 @@ package org.hibernate.test.insertordering; import org.hibernate.cfg.Environment; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithJoinedTableInheritance.java b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithJoinedTableInheritance.java index a428897bc2..aafd95d680 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithJoinedTableInheritance.java +++ b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithJoinedTableInheritance.java @@ -32,7 +32,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithJoinedTableMultiLevelInheritance.java b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithJoinedTableMultiLevelInheritance.java index ae02ae4f34..a238e8b590 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithJoinedTableMultiLevelInheritance.java +++ b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithJoinedTableMultiLevelInheritance.java @@ -31,7 +31,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithSingleTableInheritance.java b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithSingleTableInheritance.java index a840433596..20b0e240cb 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithSingleTableInheritance.java +++ b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithSingleTableInheritance.java @@ -32,7 +32,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithTablePerClassInheritance.java b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithTablePerClassInheritance.java index 562c1b9073..73b4da879e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithTablePerClassInheritance.java +++ b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithTablePerClassInheritance.java @@ -32,7 +32,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithUnidirectionalOneToOne.java b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithUnidirectionalOneToOne.java index 8ae7bbed4a..fd13516d69 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithUnidirectionalOneToOne.java +++ b/hibernate-core/src/test/java/org/hibernate/test/insertordering/InsertOrderingWithUnidirectionalOneToOne.java @@ -22,7 +22,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/jdbc/internal/SessionJdbcBatchTest.java b/hibernate-core/src/test/java/org/hibernate/test/jdbc/internal/SessionJdbcBatchTest.java index 09a6e14822..790b07826b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jdbc/internal/SessionJdbcBatchTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jdbc/internal/SessionJdbcBatchTest.java @@ -17,7 +17,7 @@ import org.hibernate.Session; import org.hibernate.cfg.AvailableSettings; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/hibernate-core/src/test/java/org/hibernate/test/locking/PessimisticWriteLockTimeoutTest.java b/hibernate-core/src/test/java/org/hibernate/test/locking/PessimisticWriteLockTimeoutTest.java index d86a0d52f1..195d118d59 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/locking/PessimisticWriteLockTimeoutTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/locking/PessimisticWriteLockTimeoutTest.java @@ -11,7 +11,7 @@ import org.hibernate.dialect.SQLServer2005Dialect; import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.SQLStatementInterceptor; +import org.hibernate.test.util.jdbc.SQLStatementInterceptor; import org.junit.Before; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimeCustomTimeZoneTest.java b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimeCustomTimeZoneTest.java index bc6ab0ab22..8b486510be 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimeCustomTimeZoneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimeCustomTimeZoneTest.java @@ -25,7 +25,7 @@ import org.hibernate.dialect.MariaDBDialect; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import org.mockito.ArgumentCaptor; diff --git a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimeDefaultTimeZoneTest.java b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimeDefaultTimeZoneTest.java index d49833be6c..3d5ccdfb58 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimeDefaultTimeZoneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimeDefaultTimeZoneTest.java @@ -17,7 +17,7 @@ import javax.persistence.Id; import org.hibernate.cfg.AvailableSettings; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampCustomSessionLevelTimeZoneTest.java b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampCustomSessionLevelTimeZoneTest.java index e362914cf4..098e7507b3 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampCustomSessionLevelTimeZoneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampCustomSessionLevelTimeZoneTest.java @@ -22,7 +22,7 @@ import org.hibernate.dialect.MariaDBDialect; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import org.mockito.ArgumentCaptor; diff --git a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampCustomTimeZoneTest.java b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampCustomTimeZoneTest.java index dc37de971c..a2e50944b7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampCustomTimeZoneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampCustomTimeZoneTest.java @@ -22,7 +22,7 @@ import org.hibernate.dialect.MariaDBDialect; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import org.mockito.ArgumentCaptor; diff --git a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampDefaultTimeZoneTest.java b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampDefaultTimeZoneTest.java index bff860a315..927cf074b7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampDefaultTimeZoneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampDefaultTimeZoneTest.java @@ -16,7 +16,7 @@ import javax.persistence.Id; import org.hibernate.cfg.AvailableSettings; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.PreparedStatementSpyConnectionProvider; +import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampUTCTimeZoneTest.java b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampUTCTimeZoneTest.java index 1a82f6d92c..f07509bda6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampUTCTimeZoneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampUTCTimeZoneTest.java @@ -13,7 +13,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.dialect.PostgreSQL82Dialect; import org.hibernate.testing.RequiresDialect; -import org.hibernate.testing.jdbc.TimeZoneConnectionProvider; +import org.hibernate.test.util.jdbc.TimeZoneConnectionProvider; /** * @author Vlad Mihalcea diff --git a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampWithDefaultUTCTimeZoneTest.java b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampWithDefaultUTCTimeZoneTest.java index 9e5451c0df..817a0c9253 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampWithDefaultUTCTimeZoneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampWithDefaultUTCTimeZoneTest.java @@ -12,7 +12,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.dialect.PostgreSQL82Dialect; import org.hibernate.testing.RequiresDialect; -import org.hibernate.testing.jdbc.TimeZoneConnectionProvider; +import org.hibernate.test.util.jdbc.TimeZoneConnectionProvider; /** * @author Vlad Mihalcea diff --git a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampWithoutUTCTimeZoneTest.java b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampWithoutUTCTimeZoneTest.java index 5bccdf981a..c1187d8cac 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampWithoutUTCTimeZoneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/timestamp/JdbcTimestampWithoutUTCTimeZoneTest.java @@ -20,7 +20,7 @@ import org.hibernate.dialect.PostgreSQL82Dialect; import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.jdbc.TimeZoneConnectionProvider; +import org.hibernate.test.util.jdbc.TimeZoneConnectionProvider; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/PreparedStatementSpyConnectionProvider.java b/hibernate-core/src/test/java/org/hibernate/test/util/jdbc/PreparedStatementSpyConnectionProvider.java similarity index 97% rename from hibernate-testing/src/main/java/org/hibernate/testing/jdbc/PreparedStatementSpyConnectionProvider.java rename to hibernate-core/src/test/java/org/hibernate/test/util/jdbc/PreparedStatementSpyConnectionProvider.java index 76c7ad2a5c..943750daf2 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/PreparedStatementSpyConnectionProvider.java +++ b/hibernate-core/src/test/java/org/hibernate/test/util/jdbc/PreparedStatementSpyConnectionProvider.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.testing.jdbc; +package org.hibernate.test.util.jdbc; import java.sql.Connection; import java.sql.PreparedStatement; @@ -18,13 +18,12 @@ import java.util.stream.Collectors; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; +import org.hibernate.testing.jdbc.ConnectionProviderDelegate; + import org.mockito.ArgumentMatchers; import org.mockito.Mockito; import org.mockito.internal.util.MockUtil; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.doAnswer; - /** * This {@link ConnectionProvider} extends any other ConnectionProvider that would be used by default taken the current configuration properties, and it * intercept the underlying {@link PreparedStatement} method calls. diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/SQLStatementInterceptor.java b/hibernate-core/src/test/java/org/hibernate/test/util/jdbc/SQLStatementInterceptor.java similarity index 95% rename from hibernate-testing/src/main/java/org/hibernate/testing/jdbc/SQLStatementInterceptor.java rename to hibernate-core/src/test/java/org/hibernate/test/util/jdbc/SQLStatementInterceptor.java index bc37c11b97..aba5718df6 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/SQLStatementInterceptor.java +++ b/hibernate-core/src/test/java/org/hibernate/test/util/jdbc/SQLStatementInterceptor.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.testing.jdbc; +package org.hibernate.test.util.jdbc; import java.util.LinkedList; diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/TimeZoneConnectionProvider.java b/hibernate-core/src/test/java/org/hibernate/test/util/jdbc/TimeZoneConnectionProvider.java similarity index 92% rename from hibernate-testing/src/main/java/org/hibernate/testing/jdbc/TimeZoneConnectionProvider.java rename to hibernate-core/src/test/java/org/hibernate/test/util/jdbc/TimeZoneConnectionProvider.java index 07012d9861..f365135a5f 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/jdbc/TimeZoneConnectionProvider.java +++ b/hibernate-core/src/test/java/org/hibernate/test/util/jdbc/TimeZoneConnectionProvider.java @@ -4,12 +4,14 @@ * 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.testing.jdbc; +package org.hibernate.test.util.jdbc; import java.util.TimeZone; import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; +import org.hibernate.testing.jdbc.ConnectionProviderDelegate; + /** * This {@link ConnectionProvider} extends any other ConnectionProvider that would be used by default taken the current configuration properties, and it * just sets a default TimeZone which is different than the current default one. diff --git a/hibernate-testing/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker b/hibernate-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker similarity index 100% rename from hibernate-testing/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker rename to hibernate-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker diff --git a/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/functional/RefreshUpdatedDataTest.java b/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/functional/RefreshUpdatedDataTest.java index bf59daac1c..4bba991f7b 100644 --- a/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/functional/RefreshUpdatedDataTest.java +++ b/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/functional/RefreshUpdatedDataTest.java @@ -21,7 +21,6 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.AvailableSettings; -import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.H2Dialect; diff --git a/hibernate-testing/hibernate-testing.gradle b/hibernate-testing/hibernate-testing.gradle index 9e892ab3a5..9496237a71 100644 --- a/hibernate-testing/hibernate-testing.gradle +++ b/hibernate-testing/hibernate-testing.gradle @@ -16,8 +16,6 @@ dependencies { compile ( libraries.jboss_jta ) { transitive=false; } - compile( libraries.mockito ) - compile( libraries.mockito_inline ) } // resources inherently exclude sources