HHH-7490 - Integrate Envers with Metamodel
This commit is contained in:
parent
674eeec3a9
commit
b9066312a6
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
Loading…
Reference in New Issue