diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/beanvalidation/TypeSafeActivator.java b/hibernate-core/src/main/java/org/hibernate/cfg/beanvalidation/TypeSafeActivator.java index 9dc5886c8b..7917f99080 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/beanvalidation/TypeSafeActivator.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/beanvalidation/TypeSafeActivator.java @@ -41,6 +41,7 @@ import javax.validation.metadata.BeanDescriptor; import javax.validation.metadata.ConstraintDescriptor; import javax.validation.metadata.PropertyDescriptor; +import org.hibernate.EntityMode; import org.hibernate.boot.registry.classloading.spi.ClassLoaderService; import org.hibernate.cfg.Environment; import org.hibernate.dialect.Dialect; @@ -166,7 +167,7 @@ class TypeSafeActivator { for ( EntityBinding entityBinding : activationContext.getMetadata().getEntityBindings() ) { final String className = entityBinding.getEntity().getDescriptor().getName().toString(); - if ( entityBinding.getEntity().getDescriptor() == null ) { + if ( entityBinding.getHierarchyDetails().getEntityMode() != EntityMode.POJO ) { continue; } diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/AbstractOneSessionTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/AbstractOneSessionTest.java index f8359434e3..0509faff9b 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/AbstractOneSessionTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/AbstractOneSessionTest.java @@ -69,7 +69,9 @@ public abstract class AbstractOneSessionTest extends AbstractEnversTest { @AfterClassOnce public void closeSessionFactory() { try { - sessionFactory.close(); + if ( sessionFactory != null ) { + sessionFactory.close(); + } } finally { if ( serviceRegistry != null ) { diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/merge/AddDelTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/merge/AddDelTest.java index 2edc3cda6e..e6c750db4f 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/merge/AddDelTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/merge/AddDelTest.java @@ -25,7 +25,6 @@ public class AddDelTest extends BaseEnversFunctionalTestCase { @Test @Priority(10) - @FailureExpectedWithNewMetamodel public void initData() { // Revision 1 Session session = openSession(); @@ -54,7 +53,6 @@ public class AddDelTest extends BaseEnversFunctionalTestCase { } @Test - @FailureExpectedWithNewMetamodel public void testRevisionsCountOfGivenIdStrEntity() { // Revision 2 has not changed entity's state. Assert.assertEquals( Arrays.asList( 1, 3 ), getAuditReader().getRevisions( GivenIdStrEntity.class, 1 ) ); @@ -63,7 +61,6 @@ public class AddDelTest extends BaseEnversFunctionalTestCase { } @Test - @FailureExpectedWithNewMetamodel public void testHistoryOfGivenIdStrEntity() { Assert.assertEquals( new GivenIdStrEntity( 1, "data" ), getAuditReader().find( GivenIdStrEntity.class, 1, 1 ) ); Assert.assertEquals( diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/ProxyIdentifier.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/ProxyIdentifier.java index 97cedf0b40..5134cd13c3 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/ProxyIdentifier.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/ProxyIdentifier.java @@ -44,7 +44,6 @@ import org.hibernate.testing.TestForIssue; /** * @author Eugene Goroschenya */ -@FailureExpectedWithNewMetamodel( message = "@NotFound(action = NotFoundAction.IGNORE) not supported yet." ) public class ProxyIdentifier extends BaseEnversJPAFunctionalTestCase { private TargetNotAuditedEntity tnae1 = null; private ManyToOneNotAuditedNullEntity mtonane1 = null; diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java index acb8564587..4d57480dbd 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java @@ -26,7 +26,6 @@ public class QueryingWithProxyObjectTest extends BaseEnversFunctionalTestCase { @Test @Priority(10) - @FailureExpectedWithNewMetamodel public void initData() { // Revision 1 getSession().getTransaction().begin(); @@ -39,7 +38,6 @@ public class QueryingWithProxyObjectTest extends BaseEnversFunctionalTestCase { @Test @TestForIssue(jiraKey = "HHH-4760") - @FailureExpectedWithNewMetamodel @SuppressWarnings("unchecked") public void testQueryingWithProxyObject() { StrTestEntity originalSte = new StrTestEntity( "data", id ); diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditClassOverrideTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditClassOverrideTest.java index fc00544f29..0f2ed23ae8 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditClassOverrideTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditClassOverrideTest.java @@ -16,7 +16,6 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-4439") -@FailureExpectedWithNewMetamodel( message = "Audit overrides on MappedSuperclasses not supported yet." ) public class AuditClassOverrideTest extends BaseEnversJPAFunctionalTestCase { private Integer classAuditedEntityId = null; private Integer classNotAuditedEntityId = null; diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/MultipleAuditParentsTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/MultipleAuditParentsTest.java index 87919d14b0..08a5400e3e 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/MultipleAuditParentsTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/MultipleAuditParentsTest.java @@ -21,7 +21,6 @@ import org.junit.Test; * * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -@FailureExpectedWithNewMetamodel( message = "Audit overrides on MappedSuperclasses not supported yet.") public class MultipleAuditParentsTest extends BaseEnversJPAFunctionalTestCase { private long childMultipleId = 1L; private Integer siteMultipleId = null; diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/SingleAuditParentsTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/SingleAuditParentsTest.java index 007fdb4caa..8733f85cd9 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/SingleAuditParentsTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/SingleAuditParentsTest.java @@ -21,7 +21,6 @@ import org.junit.Test; * * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -@FailureExpectedWithNewMetamodel( message = "Audit overrides on MappedSuperclasses not supported yet.") public class SingleAuditParentsTest extends BaseEnversJPAFunctionalTestCase { private long childSingleId = 1L; private Integer siteSingleId = null; diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/TotalAuditParentsTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/TotalAuditParentsTest.java index c3b6138029..2d61a5b7cd 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/TotalAuditParentsTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/TotalAuditParentsTest.java @@ -21,7 +21,6 @@ import org.junit.Test; * * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -@FailureExpectedWithNewMetamodel( message = "Audit overrides on MappedSuperclasses not supported yet.") public class TotalAuditParentsTest extends BaseEnversJPAFunctionalTestCase { private long babyCompleteId = 1L; private Integer siteCompleteId = null; diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/TransitiveAuditParentsTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/TransitiveAuditParentsTest.java index a0f77a5c68..ca23562b0d 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/TransitiveAuditParentsTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/superclass/auditparents/TransitiveAuditParentsTest.java @@ -19,7 +19,6 @@ import org.junit.Test; * * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -@FailureExpectedWithNewMetamodel( message = "Audit overrides on MappedSuperclasses not supported yet.") public class TransitiveAuditParentsTest extends BaseEnversJPAFunctionalTestCase { private long childImpTransId = 1L; private long childExpTransId = 2L; diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java index aefb6ba0da..8bb888098e 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java @@ -33,7 +33,6 @@ public class SchemaExportTest extends BaseEnversFunctionalTestCase { @Test @Priority(10) - @FailureExpectedWithNewMetamodel public void testSchemaCreation() { // Generate complete schema. new EnversSchemaGenerator( metadata() ).export().create( true, true ); @@ -50,7 +49,6 @@ public class SchemaExportTest extends BaseEnversFunctionalTestCase { @Test @Priority(9) - @FailureExpectedWithNewMetamodel public void testAuditDataRetrieval() { Assert.assertEquals( Arrays.asList( 1 ), getAuditReader().getRevisions( StrTestEntity.class, id ) ); Assert.assertEquals( new StrTestEntity( "data", id ), getAuditReader().find( StrTestEntity.class, id, 1 ) );