diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/AbstractEmbeddableWithManyToManyTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/AbstractEmbeddableWithManyToManyTest.java new file mode 100644 index 0000000000..e5ee89b4a6 --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/AbstractEmbeddableWithManyToManyTest.java @@ -0,0 +1,46 @@ +package org.hibernate.orm.test.annotations.embeddables.collection; + +import org.hibernate.AnnotationException; +import org.hibernate.boot.MetadataSources; +import org.hibernate.boot.registry.BootstrapServiceRegistryBuilder; +import org.hibernate.boot.registry.StandardServiceRegistry; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; + +import org.junit.jupiter.api.Test; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +/** + * @author Andrea Boriero + */ +public abstract class AbstractEmbeddableWithManyToManyTest { + @Test + public void test() { + try { + BootstrapServiceRegistryBuilder bootstrapServiceRegistryBuilder = new BootstrapServiceRegistryBuilder(); + final StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder( + bootstrapServiceRegistryBuilder.build() ); + StandardServiceRegistry ssr = ssrb.build(); + MetadataSources metadataSources = new MetadataSources( ssr ); + addResources( metadataSources ); + addAnnotatedClasses(metadataSources); + + metadataSources.buildMetadata(); + fail( "Should throw AnnotationException!" ); + } + catch (AnnotationException expected) { + assertTrue( expected.getMessage().startsWith( + "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" + ) ); + } + } + + protected void addAnnotatedClasses(MetadataSources metadataSources){ + + } + + protected void addResources(MetadataSources metadataSources){ + + } +} 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/orm/test/annotations/embeddables/collection/EmbeddableWithManyToMany_HHH_11302_Test.java similarity index 84% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithManyToMany_HHH_11302_Test.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/EmbeddableWithManyToMany_HHH_11302_Test.java index 7840a7912d..9bac37a98a 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/orm/test/annotations/embeddables/collection/EmbeddableWithManyToMany_HHH_11302_Test.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.annotations.embeddables.collection; +package org.hibernate.orm.test.annotations.embeddables.collection; import java.io.Serializable; import java.util.ArrayList; @@ -25,48 +25,20 @@ import javax.persistence.ManyToMany; import javax.persistence.Table; import javax.persistence.Version; -import org.hibernate.AnnotationException; +import org.hibernate.boot.MetadataSources; import org.hibernate.testing.TestForIssue; -import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.junit.Test; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; /** * @author Vlad Mihalcea */ @TestForIssue(jiraKey = "HHH-11302") public class EmbeddableWithManyToMany_HHH_11302_Test - extends BaseCoreFunctionalTestCase { + extends AbstractEmbeddableWithManyToManyTest { - // Add your entities here. @Override - protected Class[] getAnnotatedClasses() { - return new Class[] { - ContactType.class, - Person.class - }; - } - - protected void buildSessionFactory() { - try { - super.buildSessionFactory(); - fail( "Should throw AnnotationException!" ); - } - catch ( AnnotationException expected ) { - assertTrue( expected.getMessage().startsWith( - "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" - ) ); - } - finally { - serviceRegistry().destroy(); - } - } - - @Test - public void test() { + protected void addAnnotatedClasses(MetadataSources metadataSources) { + metadataSources.addAnnotatedClasses( ContactType.class, Person.class ); } @Entity 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/orm/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_11302_Test.java similarity index 84% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_11302_Test.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_11302_Test.java index 893d6c1e04..8ed2e810b0 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/orm/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_11302_Test.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.annotations.embeddables.collection; +package org.hibernate.orm.test.annotations.embeddables.collection; import java.io.Serializable; import java.util.ArrayList; @@ -25,48 +25,20 @@ import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Version; -import org.hibernate.AnnotationException; +import org.hibernate.boot.MetadataSources; import org.hibernate.testing.TestForIssue; -import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.junit.Test; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; /** * @author Vlad Mihalcea */ @TestForIssue(jiraKey = "HHH-11302") public class EmbeddableWithOneToMany_HHH_11302_Test - extends BaseCoreFunctionalTestCase { + extends AbstractEmbeddableWithManyToManyTest { - // Add your entities here. @Override - protected Class[] getAnnotatedClasses() { - return new Class[] { - ContactType.class, - Person.class - }; - } - - protected void buildSessionFactory() { - try { - super.buildSessionFactory(); - fail( "Should throw AnnotationException!" ); - } - catch ( AnnotationException expected ) { - assertTrue( expected.getMessage().startsWith( - "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" - ) ); - } - finally { - serviceRegistry().destroy(); - } - } - - @Test - public void test() { + protected void addAnnotatedClasses(MetadataSources metadataSources) { + metadataSources.addAnnotatedClasses( ContactType.class, Person.class ); } @Entity 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/orm/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8564_Test.java similarity index 71% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8564_Test.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8564_Test.java index f69c38aaf7..ae19208b08 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/orm/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8564_Test.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.annotations.embeddables.collection; +package org.hibernate.orm.test.annotations.embeddables.collection; import java.io.Serializable; import java.util.Set; @@ -21,47 +21,20 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; -import org.hibernate.AnnotationException; +import org.hibernate.boot.MetadataSources; import org.hibernate.testing.TestForIssue; -import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.junit.Test; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; /** * @author Vlad Mihalcea */ @TestForIssue(jiraKey = "HHH-8564") public class EmbeddableWithOneToMany_HHH_8564_Test - extends BaseCoreFunctionalTestCase { + extends AbstractEmbeddableWithManyToManyTest { - // Add your entities here. @Override - protected Class[] getAnnotatedClasses() { - return new Class[] { - User.class, - }; - } - - protected void buildSessionFactory() { - try { - super.buildSessionFactory(); - fail( "Should throw AnnotationException!" ); - } - catch ( AnnotationException expected ) { - assertTrue( expected.getMessage().startsWith( - "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" - ) ); - } - finally { - serviceRegistry().destroy(); - } - } - - @Test - public void test() { + protected void addAnnotatedClasses(MetadataSources metadataSources) { + metadataSources.addAnnotatedClasses( User.class ); } @Embeddable @@ -89,7 +62,7 @@ public class EmbeddableWithOneToMany_HHH_8564_Test } - public static enum AddressType { + public enum AddressType { OFFICE, HOME, BILLING 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/orm/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8860_Test.java similarity index 59% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8860_Test.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8860_Test.java index 85212876f8..91209b6eb0 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/orm/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8860_Test.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.annotations.embeddables.collection; +package org.hibernate.orm.test.annotations.embeddables.collection; import java.util.LinkedList; import java.util.List; @@ -19,47 +19,20 @@ import javax.persistence.MapKeyColumn; import javax.persistence.OneToMany; import javax.persistence.Version; -import org.hibernate.AnnotationException; +import org.hibernate.boot.MetadataSources; import org.hibernate.testing.TestForIssue; -import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.junit.Test; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; /** * @author Vlad Mihalcea */ @TestForIssue(jiraKey = "HHH-8860") public class EmbeddableWithOneToMany_HHH_8860_Test - extends BaseCoreFunctionalTestCase { + extends AbstractEmbeddableWithManyToManyTest { - // Add your entities here. @Override - protected Class[] getAnnotatedClasses() { - return new Class[] { - Data.class, - }; - } - - protected void buildSessionFactory() { - try { - super.buildSessionFactory(); - fail( "Should throw AnnotationException!" ); - } - catch ( AnnotationException expected ) { - assertTrue( expected.getMessage().startsWith( - "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" - ) ); - } - finally { - serviceRegistry().destroy(); - } - } - - @Test - public void test() { + protected void addAnnotatedClasses(MetadataSources metadataSources) { + metadataSources.addAnnotatedClasses( Data.class ); } @Entity(name = "Data") diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/ContactInformation.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/ContactInformation.java similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/ContactInformation.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/ContactInformation.java index 70d8936120..a41757a0b1 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/ContactInformation.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/ContactInformation.java @@ -1,4 +1,4 @@ -package org.hibernate.test.annotations.embeddables.collection.xml; +package org.hibernate.orm.test.annotations.embeddables.collection.xml; import java.io.Serializable; import java.util.ArrayList; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/ContactType.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/ContactType.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/ContactType.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/ContactType.java index 9344c197d5..dd3291a827 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/ContactType.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/ContactType.java @@ -1,4 +1,4 @@ -package org.hibernate.test.annotations.embeddables.collection.xml; +package org.hibernate.orm.test.annotations.embeddables.collection.xml; import java.io.Serializable; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/EmbeddableWithOneToMany_HHH_11302_xml_Test.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/EmbeddableWithOneToMany_HHH_11302_xml_Test.java new file mode 100644 index 0000000000..dc85b67ea9 --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/EmbeddableWithOneToMany_HHH_11302_xml_Test.java @@ -0,0 +1,24 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * 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.orm.test.annotations.embeddables.collection.xml; + +import org.hibernate.boot.MetadataSources; +import org.hibernate.orm.test.annotations.embeddables.collection.AbstractEmbeddableWithManyToManyTest; + +import org.hibernate.testing.TestForIssue; + +/** + * @author Vlad Mihalcea + */ +@TestForIssue(jiraKey = "HHH-11302") +public class EmbeddableWithOneToMany_HHH_11302_xml_Test extends AbstractEmbeddableWithManyToManyTest { + + protected void addResources(MetadataSources metadataSources) { + metadataSources.addResource( "org/hibernate/orm/test/annotations/embeddables/collection/orm.xml" ); + } + +} diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/Person.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/Person.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/Person.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/Person.java index 70acf50f27..a52ad8413b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/Person.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/collection/xml/Person.java @@ -1,4 +1,4 @@ -package org.hibernate.test.annotations.embeddables.collection.xml; +package org.hibernate.orm.test.annotations.embeddables.collection.xml; import java.io.Serializable; import java.util.List; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/Customer.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/Customer.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/Customer.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/Customer.java index bb54860ba3..6a7825d2d9 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/Customer.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/Customer.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.annotations.embeddables.nested; +package org.hibernate.orm.test.annotations.embeddables.nested; import java.util.ArrayList; import java.util.List; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/Investment.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/Investment.java similarity index 93% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/Investment.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/Investment.java index f3d789a732..3f930165af 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/Investment.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/Investment.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.annotations.embeddables.nested; +package org.hibernate.orm.test.annotations.embeddables.nested; import java.util.Date; import javax.persistence.Column; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/MonetaryAmount.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/MonetaryAmount.java similarity index 93% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/MonetaryAmount.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/MonetaryAmount.java index 11bec33648..fff4b778b7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/MonetaryAmount.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/MonetaryAmount.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.annotations.embeddables.nested; +package org.hibernate.orm.test.annotations.embeddables.nested; import java.math.BigDecimal; import javax.persistence.Column; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/NestedEmbeddableMetadataTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/NestedEmbeddableMetadataTest.java similarity index 90% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/NestedEmbeddableMetadataTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/NestedEmbeddableMetadataTest.java index 3562e01c24..6c4626cca8 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/NestedEmbeddableMetadataTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/NestedEmbeddableMetadataTest.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.annotations.embeddables.nested; +package org.hibernate.orm.test.annotations.embeddables.nested; import java.sql.Types; @@ -22,16 +22,16 @@ import org.hibernate.mapping.SimpleValue; import org.hibernate.mapping.Value; import org.hibernate.type.CustomType; -import org.hibernate.testing.junit4.BaseUnitTestCase; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hibernate.testing.junit4.ExtraAssertions.assertJdbcTypeCode; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author Steve Ebersole */ -public class NestedEmbeddableMetadataTest extends BaseUnitTestCase { +public class NestedEmbeddableMetadataTest { + @Test public void testEnumTypeInterpretation() { final StandardServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder() diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/Customer.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/Customer.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/Customer.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/Customer.java index 330a9a7d25..aff86ec586 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/Customer.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/Customer.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.annotations.embeddables.nested.fieldaccess; +package org.hibernate.orm.test.annotations.embeddables.nested.fieldaccess; import java.util.ArrayList; import java.util.List; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/FieldAccessedNestedEmbeddableMetadataTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/FieldAccessedNestedEmbeddableMetadataTest.java similarity index 86% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/FieldAccessedNestedEmbeddableMetadataTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/FieldAccessedNestedEmbeddableMetadataTest.java index a0558f8161..2926ca1066 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/FieldAccessedNestedEmbeddableMetadataTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/FieldAccessedNestedEmbeddableMetadataTest.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.annotations.embeddables.nested.fieldaccess; +package org.hibernate.orm.test.annotations.embeddables.nested.fieldaccess; import java.sql.Types; @@ -21,19 +21,19 @@ import org.hibernate.mapping.SimpleValue; import org.hibernate.mapping.Value; import org.hibernate.type.CustomType; -import org.hibernate.testing.FailureExpected; -import org.hibernate.testing.junit4.BaseUnitTestCase; -import org.junit.Test; +import org.hibernate.testing.orm.junit.FailureExpected; +import org.junit.jupiter.api.Test; import static org.hibernate.testing.junit4.ExtraAssertions.assertJdbcTypeCode; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author Steve Ebersole */ -public class FieldAccessedNestedEmbeddableMetadataTest extends BaseUnitTestCase { +public class FieldAccessedNestedEmbeddableMetadataTest { + @Test - @FailureExpected( jiraKey = "HHH-9089" ) + @FailureExpected(jiraKey = "HHH-9089") public void testEnumTypeInterpretation() { StandardServiceRegistry ssr = new StandardServiceRegistryBuilder().build(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/Investment.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/Investment.java similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/Investment.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/Investment.java index 39b58e7ab3..35d10abed4 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/Investment.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/Investment.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.annotations.embeddables.nested.fieldaccess; +package org.hibernate.orm.test.annotations.embeddables.nested.fieldaccess; import java.util.Date; import javax.persistence.Column; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/MonetaryAmount.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/MonetaryAmount.java similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/MonetaryAmount.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/MonetaryAmount.java index f3def51afd..8a9c612be4 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/fieldaccess/MonetaryAmount.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embeddables/nested/fieldaccess/MonetaryAmount.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.annotations.embeddables.nested.fieldaccess; +package org.hibernate.orm.test.annotations.embeddables.nested.fieldaccess; import java.math.BigDecimal; import javax.persistence.Column; 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 deleted file mode 100644 index ee345f5442..0000000000 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/xml/EmbeddableWithOneToMany_HHH_11302_xml_Test.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * 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.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; -import static org.junit.Assert.fail; - -/** - * @author Vlad Mihalcea - */ -@TestForIssue(jiraKey = "HHH-11302") -public class EmbeddableWithOneToMany_HHH_11302_xml_Test extends - BaseEntityManagerFunctionalTestCase { - - @Override - public String[] getEjb3DD() { - return new String[] { - "org/hibernate/test/annotations/embeddables/collection/orm.xml" - }; - } - - public void buildEntityManagerFactory() { - try { - super.buildEntityManagerFactory(); - fail( "Should throw AnnotationException!" ); - } - catch ( AnnotationException expected ) { - assertTrue( expected.getMessage().startsWith( - "@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection" - ) ); - } - } - - @Test - public void test() { - } - -} diff --git a/hibernate-core/src/test/resources/org/hibernate/test/annotations/embeddables/collection/orm.xml b/hibernate-core/src/test/resources/org/hibernate/orm/test/annotations/embeddables/collection/orm.xml similarity index 94% rename from hibernate-core/src/test/resources/org/hibernate/test/annotations/embeddables/collection/orm.xml rename to hibernate-core/src/test/resources/org/hibernate/orm/test/annotations/embeddables/collection/orm.xml index 36e3e68051..a0a978473c 100644 --- a/hibernate-core/src/test/resources/org/hibernate/test/annotations/embeddables/collection/orm.xml +++ b/hibernate-core/src/test/resources/org/hibernate/orm/test/annotations/embeddables/collection/orm.xml @@ -9,7 +9,7 @@ - org.hibernate.test.annotations.embeddables.collection.xml + org.hibernate.orm.test.annotations.embeddables.collection.xml