HHH-10981 - Test case

This commit is contained in:
barreiro 2016-07-22 06:18:39 +01:00 committed by Andrea Boriero
parent 5d6678a414
commit 63af953566
2 changed files with 10 additions and 3 deletions

View File

@ -158,6 +158,13 @@ public class EnhancerTest extends BaseUnitTestCase {
@TestForIssue( jiraKey = "HHH-10646" )
public void testMappedSuperclass() {
EnhancerTestUtils.runEnhancerTestTask( MappedSuperclassTestTask.class );
EnhancerTestUtils.runEnhancerTestTask( MappedSuperclassTestTask.class, new EnhancerTestContext() {
@Override
public boolean hasLazyLoadableAttributes(CtClass classDescriptor) {
// HHH-10981 - Without lazy loading, the generation of getters and setters has a different code path
return false;
}
} );
}
@Test

View File

@ -28,7 +28,7 @@ public class MappedSuperclassTestTask extends AbstractEnhancerTestTask {
public void execute() {
Employee charles = new Employee( "Charles", "Engineer" );
charles.oca = 1002;
charles.setOca( 1002 );
// Check that both types of class attributes are being dirty tracked
EnhancerTestUtils.checkDirtyTracking( charles, "title", "oca" );
@ -46,9 +46,9 @@ public class MappedSuperclassTestTask extends AbstractEnhancerTestTask {
@MappedSuperclass private static class Person {
@Id String name;
@Id private String name;
@Version long oca;
@Version private long oca;
public Person(String name) {
this();