Skip to content

Commit

Permalink
METAGEN-81 Formatting and moving test into its own method annotated w…
Browse files Browse the repository at this point in the history
  • Loading branch information
hferentschik authored and stliu committed Nov 11, 2013
1 parent 7bb932f commit 0ff88cf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
Expand Up @@ -23,6 +23,7 @@
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;
Expand Down Expand Up @@ -67,12 +68,13 @@ public void testInheritedAccessTypeForEmbeddable() {
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
Expand Down
Expand Up @@ -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;
Expand All @@ -27,7 +26,7 @@
*/
@Embeddable
public class Hotel {

@OneToOne
private User webmaster;

Expand All @@ -38,5 +37,4 @@ public User getWebmaster() {
public void setWebmaster(User webmaster) {
this.webmaster = webmaster;
}

}
Expand Up @@ -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;
Expand All @@ -38,5 +37,4 @@ public Hotel getHotel() {
public void setHotel(Hotel hotel) {
this.hotel = hotel;
}

}
Expand Up @@ -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;
Expand All @@ -27,7 +26,6 @@
*/
@Entity
public class Room {

@Id
private Integer id;

Expand All @@ -38,5 +36,4 @@ public Integer getId() {
public void setId(Integer id) {
this.id = id;
}

}

0 comments on commit 0ff88cf

Please sign in to comment.