METAGEN-81 Formatting and moving test into its own method annotated with @TestForIssue

This commit is contained in:
Hardy Ferentschik 2012-03-12 12:43:41 +01:00 committed by Strong Liu
parent 7bb932f505
commit 0ff88cff1f
4 changed files with 8 additions and 13 deletions

View File

@ -23,6 +23,7 @@ import java.util.List;
import org.testng.annotations.Test;
import org.hibernate.jpamodelgen.test.util.CompilationTest;
import org.hibernate.jpamodelgen.test.util.TestForIssue;
import org.hibernate.jpamodelgen.test.util.TestUtil;
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertAbsenceOfFieldInMetamodelFor;
@ -67,12 +68,13 @@ public class AccessTypeTest extends CompilationTest {
assertAbsenceOfFieldInMetamodelFor(
Pet.class, "nonPersistent", "Collection of embeddable not taken care of"
);
// see METAGEN-81
// access type should be inherited from the position of the @Id field annotation from the root entity
// via the @Embedded annotation
}
@Test
@TestForIssue( jiraKey = " METAGEN-81")
public void testAccessTypeForEmbeddableDeterminedByIdAnnotationInRootEntity() {
assertPresenceOfFieldInMetamodelFor( Hotel.class, "webmaster",
"Access type should be inherited from the hierarchy" );
"Access type should be inherited position of the @Id field annotation in the root entity" );
}
@Test

View File

@ -16,7 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package org.hibernate.jpamodelgen.test.accesstype;
import javax.persistence.Embeddable;
@ -27,7 +26,7 @@ import javax.persistence.OneToOne;
*/
@Embeddable
public class Hotel {
@OneToOne
private User webmaster;
@ -38,5 +37,4 @@ public class Hotel {
public void setWebmaster(User webmaster) {
this.webmaster = webmaster;
}
}

View File

@ -16,7 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package org.hibernate.jpamodelgen.test.accesstype;
import javax.persistence.Embedded;
@ -38,5 +37,4 @@ public class HotelRoom extends Room {
public void setHotel(Hotel hotel) {
this.hotel = hotel;
}
}

View File

@ -16,7 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package org.hibernate.jpamodelgen.test.accesstype;
import javax.persistence.Entity;
@ -27,7 +26,6 @@ import javax.persistence.Id;
*/
@Entity
public class Room {
@Id
private Integer id;
@ -38,5 +36,4 @@ public class Room {
public void setId(Integer id) {
this.id = id;
}
}