From e8f4d0c8bc92bb2fa034044dd72f54fd8ff7e70f Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Wed, 23 May 2018 13:54:29 -0400 Subject: [PATCH] HHH-12581 - Revert original fix for HHH-12338 to address regression. (cherry picked from commit df6d44f) --- .../MetaAttributeGenerationVisitor.java | 8 -- .../CollectionAsBasicTypeTest.java | 89 ------------------- 2 files changed, 97 deletions(-) delete mode 100644 tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/collectionbasictype/CollectionAsBasicTypeTest.java diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java index b9147941ff..5a1117b850 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java @@ -138,14 +138,6 @@ public class MetaAttributeGenerationVisitor extends SimpleTypeVisitor6. - */ -package org.hibernate.jpamodelgen.test.collectionbasictype; - -import org.hibernate.jpamodelgen.test.util.CompilationTest; -import org.hibernate.jpamodelgen.test.util.TestForIssue; -import org.hibernate.jpamodelgen.test.util.WithClasses; - -import org.junit.Test; - -import static org.hibernate.jpamodelgen.test.util.TestUtil.assertAttributeTypeInMetaModelFor; -import static org.hibernate.jpamodelgen.test.util.TestUtil.assertListAttributeTypeInMetaModelFor; -import static org.hibernate.jpamodelgen.test.util.TestUtil.assertMetamodelClassGeneratedFor; - -/** - * @author helloztt - */ -public class CollectionAsBasicTypeTest extends CompilationTest { - - @Test - @TestForIssue(jiraKey = "HHH-12338") - @WithClasses({Goods.class, Product.class}) - public void testConvert() throws ClassNotFoundException, NoSuchFieldException { - assertMetamodelClassGeneratedFor(Product.class); - assertMetamodelClassGeneratedFor(Goods.class); - assertListAttributeTypeInMetaModelFor( - Goods.class, - "productList", - Product.class, - "ListAttribute generic type should be Product" - ); - assertAttributeTypeInMetaModelFor( - Goods.class, - "tags", - Goods.class.getDeclaredField("tags").getGenericType(), - "Wrong meta model type" - ); - - } - - @Test - @TestForIssue(jiraKey = "HHH-12338") - @WithClasses({Person.class}) - public void testListType() throws ClassNotFoundException, NoSuchFieldException { - assertMetamodelClassGeneratedFor(Person.class); - - assertAttributeTypeInMetaModelFor( - Person.class, - "phones", - Person.class.getDeclaredField("phones").getGenericType(), - "Wrong meta model type" - ); - - } - - @Test - @TestForIssue(jiraKey = "HHH-12338") - @WithClasses({PersonPhone.class}) - public void testListTypeWithImport() throws ClassNotFoundException, NoSuchFieldException { - assertMetamodelClassGeneratedFor(PersonPhone.class); - - assertAttributeTypeInMetaModelFor( - PersonPhone.class, - "phones", - PersonPhone.class.getDeclaredField("phones").getGenericType(), - "Wrong meta model type" - ); - - } - - @Test - @TestForIssue(jiraKey = "HHH-12338") - @WithClasses({PhoneBook.class}) - public void testMapType() throws ClassNotFoundException, NoSuchFieldException { - assertMetamodelClassGeneratedFor(PhoneBook.class); - - assertAttributeTypeInMetaModelFor( - PhoneBook.class, - "phones", - PhoneBook.class.getDeclaredField("phones").getGenericType(), - "Wrong meta model type" - ); - - } -}