Fix Envers test failure.
This commit is contained in:
parent
91387adcc8
commit
6edff69101
|
@ -16,6 +16,7 @@ import java.util.Set;
|
|||
|
||||
import org.hibernate.QueryException;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.cfg.AvailableSettings;
|
||||
import org.hibernate.envers.exception.AuditException;
|
||||
import org.hibernate.envers.query.AuditEntity;
|
||||
import org.hibernate.envers.test.BaseEnversFunctionalTestCase;
|
||||
|
@ -48,6 +49,12 @@ public class AuditedDynamicComponentsAdvancedCasesTest extends BaseEnversFunctio
|
|||
public static final String AGE_USER_TYPE = "ageUserType";
|
||||
public static final String INTERNAL_LIST_OF_USER_TYPES = "internalListOfUserTypes";
|
||||
|
||||
@Override
|
||||
protected void addSettings(Map settings) {
|
||||
super.addSettings( settings );
|
||||
settings.put( AvailableSettings.JPA_TRANSACTION_COMPLIANCE, "false" );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getMappings() {
|
||||
return new String[] { "mappings/dynamicComponents/mapAdvanced.hbm.xml" };
|
||||
|
@ -353,6 +360,10 @@ public class AuditedDynamicComponentsAdvancedCasesTest extends BaseEnversFunctio
|
|||
Assert.fail();
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
if ( getSession().getTransaction().isActive() ) {
|
||||
getSession().getTransaction().rollback();
|
||||
}
|
||||
|
||||
assertTyping( IllegalArgumentException.class, e );
|
||||
}
|
||||
|
||||
|
@ -367,6 +378,10 @@ public class AuditedDynamicComponentsAdvancedCasesTest extends BaseEnversFunctio
|
|||
Assert.fail();
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
if ( getSession().getTransaction().isActive() ) {
|
||||
getSession().getTransaction().rollback();
|
||||
}
|
||||
|
||||
assertTyping( AuditException.class, e );
|
||||
Assert.assertEquals(
|
||||
"This type of relation (org.hibernate.envers.test.integration.components.dynamic.AdvancedEntity.dynamicConfiguration_internalMapWithEntities) isn't supported and can't be used in queries.",
|
||||
|
|
Loading…
Reference in New Issue