diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/AccessBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/AccessBindingTest.java index 29d520e204..981f4dc3ea 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/AccessBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/AccessBindingTest.java @@ -34,6 +34,8 @@ import org.junit.Test; import org.hibernate.AnnotationException; import org.hibernate.metamodel.spi.binding.EntityBinding; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/BatchSizeBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/BatchSizeBindingTest.java index 3edccfbbaf..77aae2e309 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/BatchSizeBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/BatchSizeBindingTest.java @@ -30,6 +30,8 @@ import org.junit.Test; import org.hibernate.annotations.BatchSize; import org.hibernate.metamodel.spi.binding.EntityBinding; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/CacheBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/CacheBindingTest.java index 60bfc19c14..c489373d55 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/CacheBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/CacheBindingTest.java @@ -35,6 +35,8 @@ import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.cache.spi.access.AccessType; import org.hibernate.metamodel.spi.binding.Caching; import org.hibernate.metamodel.spi.binding.EntityBinding; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/CustomSQLBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/CustomSQLBindingTest.java index 46dbbc8421..5129bfc5b3 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/CustomSQLBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/CustomSQLBindingTest.java @@ -36,6 +36,8 @@ import org.hibernate.annotations.SQLUpdate; import org.hibernate.engine.spi.ExecuteUpdateResultCheckStyle; import org.hibernate.metamodel.spi.binding.CustomSQL; import org.hibernate.metamodel.spi.binding.EntityBinding; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EmbeddableBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EmbeddableBindingTest.java index 8238ffb0d2..86d2912b87 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EmbeddableBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EmbeddableBindingTest.java @@ -36,6 +36,8 @@ import org.hibernate.annotations.Target; import org.hibernate.metamodel.spi.binding.BasicAttributeBinding; import org.hibernate.metamodel.spi.binding.CompositeAttributeBinding; import org.hibernate.metamodel.spi.binding.EntityBinding; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EmbeddedIdTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EmbeddedIdTest.java index 5353c6747b..4c8292efc5 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EmbeddedIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EmbeddedIdTest.java @@ -34,6 +34,8 @@ import org.junit.Test; import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.binding.EntityIdentifier; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertTrue; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EnumeratedBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EnumeratedBindingTest.java index 6073daee9c..04f61c8f54 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EnumeratedBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/EnumeratedBindingTest.java @@ -38,6 +38,8 @@ import org.junit.Test; import org.hibernate.metamodel.spi.binding.AttributeBinding; import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.binding.HibernateTypeDescriptor; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/IdentifierGeneratorTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/IdentifierGeneratorTest.java index d08cd7230c..18f9606f11 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/IdentifierGeneratorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/IdentifierGeneratorTest.java @@ -44,7 +44,8 @@ import org.hibernate.metamodel.spi.binding.EntityIdentifier; import org.hibernate.metamodel.spi.source.MappingException; import org.hibernate.service.ServiceRegistryBuilder; -import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/InheritanceBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/InheritanceBindingTest.java index 18eb2fecfb..7e104a2b6e 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/InheritanceBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/InheritanceBindingTest.java @@ -42,6 +42,8 @@ import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.binding.EntityDiscriminator; import org.hibernate.metamodel.spi.relational.DerivedValue; import org.hibernate.metamodel.spi.relational.Value; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/LobBindingTests.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/LobBindingTests.java index 954ab5b444..c248a73f56 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/LobBindingTests.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/LobBindingTests.java @@ -36,6 +36,8 @@ import org.junit.Test; import org.hibernate.metamodel.spi.binding.AttributeBinding; import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.binding.HibernateTypeDescriptor; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import org.hibernate.type.BlobType; import org.hibernate.type.CharacterArrayClobType; import org.hibernate.type.ClobType; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/MappedSuperclassTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/MappedSuperclassTest.java index 4bb54feb7c..bfe82e53b5 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/MappedSuperclassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/MappedSuperclassTest.java @@ -34,6 +34,8 @@ import org.junit.Test; import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.binding.SingularAttributeBinding; import org.hibernate.metamodel.spi.relational.Column; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/MapsIdTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/MapsIdTest.java index e1a25b5092..27db7a68f3 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/MapsIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/MapsIdTest.java @@ -35,6 +35,8 @@ import org.junit.Test; import org.hibernate.metamodel.MetadataSources; import org.hibernate.metamodel.spi.source.MappingException; import org.hibernate.service.ServiceRegistryBuilder; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/NaturalIdBindingTests.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/NaturalIdBindingTests.java index 5d5e1f6c5a..0e3478cff7 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/NaturalIdBindingTests.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/NaturalIdBindingTests.java @@ -18,6 +18,8 @@ import org.hibernate.metamodel.spi.binding.RelationalValueBinding; import org.hibernate.metamodel.spi.binding.SingularAttributeBinding; import org.hibernate.metamodel.spi.relational.Column; import org.hibernate.metamodel.spi.relational.UniqueKey; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; /** * @author Strong Liu diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/ProxyBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/ProxyBindingTest.java index 7bf201c9d6..c2bb9db8fe 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/ProxyBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/ProxyBindingTest.java @@ -30,6 +30,8 @@ import org.junit.Test; import org.hibernate.annotations.Proxy; import org.hibernate.metamodel.spi.binding.EntityBinding; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/QuotedIdentifierTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/QuotedIdentifierTest.java index 71af52d203..a5c1ed93a8 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/QuotedIdentifierTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/QuotedIdentifierTest.java @@ -32,6 +32,8 @@ import org.junit.Test; import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.relational.Identifier; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static org.junit.Assert.assertEquals; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/RowIdBindingTests.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/RowIdBindingTests.java index 68d907ca4d..988203075f 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/RowIdBindingTests.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/RowIdBindingTests.java @@ -30,6 +30,8 @@ import org.junit.Test; import org.hibernate.annotations.RowId; import org.hibernate.metamodel.spi.binding.EntityBinding; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/SecondaryTableTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/SecondaryTableTest.java index 6d0d8a69a6..cd9d7fa8ff 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/SecondaryTableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/SecondaryTableTest.java @@ -35,6 +35,8 @@ import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.binding.RelationalValueBinding; import org.hibernate.metamodel.spi.relational.ForeignKey; import org.hibernate.metamodel.spi.relational.Table; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/SynchronizeBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/SynchronizeBindingTest.java index 9e96e384e4..a4289fcc9f 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/SynchronizeBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/SynchronizeBindingTest.java @@ -31,6 +31,8 @@ import org.junit.Test; import org.hibernate.annotations.Synchronize; import org.hibernate.metamodel.spi.binding.EntityBinding; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TableNameTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TableNameTest.java index 0ac08057f1..75b0845a7b 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TableNameTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TableNameTest.java @@ -33,6 +33,8 @@ import org.junit.Test; import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.binding.InheritanceType; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TemporalBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TemporalBindingTest.java index 73f914b032..23b5e0ffc6 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TemporalBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TemporalBindingTest.java @@ -35,6 +35,8 @@ import org.hibernate.AnnotationException; import org.hibernate.metamodel.spi.binding.AttributeBinding; import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.binding.HibernateTypeDescriptor; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import org.hibernate.type.TimestampType; import static org.junit.Assert.assertEquals; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/UniqueConstraintBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/UniqueConstraintBindingTest.java index 3605b20d97..0117dd6742 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/UniqueConstraintBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/UniqueConstraintBindingTest.java @@ -32,9 +32,10 @@ import javax.persistence.UniqueConstraint; import org.junit.Test; import org.hibernate.metamodel.spi.binding.EntityBinding; -import org.hibernate.metamodel.spi.relational.Column; import org.hibernate.metamodel.spi.relational.TableSpecification; import org.hibernate.metamodel.spi.relational.UniqueKey; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/VersionBindingTests.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/VersionBindingTests.java index 8f9314113a..f3e070b9e7 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/VersionBindingTests.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/VersionBindingTests.java @@ -26,21 +26,18 @@ package org.hibernate.metamodel.internal.source.annotations.entity; import java.util.Date; import javax.persistence.Entity; import javax.persistence.Id; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; import javax.persistence.Version; import org.junit.Test; -import org.hibernate.AnnotationException; import org.hibernate.annotations.Source; import org.hibernate.annotations.SourceType; -import org.hibernate.metamodel.spi.binding.AttributeBinding; import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.binding.HibernateTypeDescriptor; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import org.hibernate.type.DbTimestampType; import org.hibernate.type.LongType; -import org.hibernate.type.TimestampType; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/WhereClauseTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/WhereClauseTest.java index 3abab67119..385c3e7ef4 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/WhereClauseTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/WhereClauseTest.java @@ -7,6 +7,8 @@ import org.junit.Test; import org.hibernate.annotations.Where; import org.hibernate.metamodel.spi.binding.EntityBinding; +import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; +import org.hibernate.testing.junit4.Resources; import static junit.framework.Assert.assertEquals; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/BaseAnnotationBindingTestCase.java b/hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseAnnotationBindingTestCase.java similarity index 91% rename from hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/BaseAnnotationBindingTestCase.java rename to hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseAnnotationBindingTestCase.java index 42b6000690..a527d5659f 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/BaseAnnotationBindingTestCase.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseAnnotationBindingTestCase.java @@ -21,7 +21,10 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.internal.source.annotations.entity; +package org.hibernate.testing.junit4; + +import java.util.ArrayList; +import java.util.List; import org.junit.After; import org.junit.Rule; @@ -31,10 +34,9 @@ import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.Statement; import org.hibernate.metamodel.MetadataSources; -import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.internal.MetadataImpl; +import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.service.ServiceRegistryBuilder; -import org.hibernate.testing.junit4.BaseUnitTestCase; /** * @author Hardy Ferentschik @@ -42,6 +44,7 @@ import org.hibernate.testing.junit4.BaseUnitTestCase; public abstract class BaseAnnotationBindingTestCase extends BaseUnitTestCase { protected MetadataSources sources; protected MetadataImpl meta; + protected List> annotatedClasses = new ArrayList>(); @Rule public MethodRule buildMetaData = new MethodRule() { @@ -65,6 +68,10 @@ public abstract class BaseAnnotationBindingTestCase extends BaseUnitTestCase { return meta.getRootEntityBinding( clazz.getName() ); } + public List> getAnnotatedClasses() { + return annotatedClasses; + } + class KeepSetupFailureStatement extends Statement { private final Statement origStatement; private final FrameworkMethod origFrameworkMethod; @@ -105,13 +112,14 @@ public abstract class BaseAnnotationBindingTestCase extends BaseUnitTestCase { sources.getMetadataBuilder().with( resourcesAnnotation.cacheMode() ); for ( Class annotatedClass : resourcesAnnotation.annotatedClasses() ) { + annotatedClasses.add( annotatedClass ); sources.addAnnotatedClass( annotatedClass ); } if ( !resourcesAnnotation.ormXmlPath().isEmpty() ) { sources.addResource( resourcesAnnotation.ormXmlPath() ); } } - meta = (MetadataImpl) sources.buildMetadata(); + meta = ( MetadataImpl ) sources.buildMetadata(); } catch ( final Throwable t ) { setupError = t; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/Resources.java b/hibernate-testing/src/main/java/org/hibernate/testing/junit4/Resources.java similarity index 95% rename from hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/Resources.java rename to hibernate-testing/src/main/java/org/hibernate/testing/junit4/Resources.java index 76ba3a1806..8c68b92857 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/Resources.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/junit4/Resources.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.internal.source.annotations.entity; +package org.hibernate.testing.junit4; import java.lang.annotation.Retention; import java.lang.annotation.Target;