HHH-8505: Small improvements to tests

This commit is contained in:
zuchos 2013-09-30 19:33:49 +02:00 committed by adamw
parent 6bc1d2ef01
commit 631616ec74
2 changed files with 6 additions and 7 deletions

View File

@ -12,6 +12,7 @@ import org.junit.Test;
import org.hibernate.QueryException;
import org.hibernate.Session;
import org.hibernate.envers.exception.AuditException;
import org.hibernate.envers.query.AuditEntity;
import org.hibernate.envers.test.BaseEnversFunctionalTestCase;
import org.hibernate.envers.test.Priority;
@ -290,15 +291,14 @@ public class AuditedDynamicComponentsAdvancedCasesTest extends BaseEnversFunctio
getAuditReader().createQuery()
.forEntitiesAtRevision( AdvancedEntity.class, 1 )
.add(
AuditEntity.property( "dynamicConfiguration_" + INTERNAL_LIST )
.eq( entity.getDynamicConfiguration().get( INTERNAL_LIST ) )
AuditEntity.property( "dynamicConfiguration_" + INTERNAL_MAP_WITH_MANY_TO_MANY )
.eq( entity.getDynamicConfiguration().get( INTERNAL_MAP_WITH_MANY_TO_MANY ) )
)
.getResultList();
Assert.fail();
}
catch ( QueryException e ) {
e.printStackTrace();
catch ( AuditException 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." , e.getMessage());
}
catch ( Exception e ) {
Assert.fail();

View File

@ -111,6 +111,7 @@ public class SanityCheckTest extends BaseEnversFunctionalTestCase {
Assert.fail();
}
catch ( AuditException e ) {
Assert.assertEquals( "This type of relation (org.hibernate.envers.test.integration.components.dynamic.PlainEntity.component_manyToManyList) isn't supported and can't be used in queries." , e.getMessage());
}
catch ( Exception e ) {
Assert.fail();
@ -142,10 +143,8 @@ public class SanityCheckTest extends BaseEnversFunctionalTestCase {
Assert.fail();
}
catch ( QueryException e ) {
e.printStackTrace();
}
catch ( Exception e ) {
e.printStackTrace();
Assert.fail();
}
}