- making the test actually assert that the results are correct

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18207 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Adam Warski 2009-12-11 10:37:54 +00:00
parent 36fddaf4fc
commit b402af2eae
1 changed files with 9 additions and 8 deletions

View File

@ -37,6 +37,7 @@ import org.hibernate.envers.test.entities.manytomany.unidirectional.M2MTargetNot
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import static org.testng.Assert.*;
/**
* A test for auditing a many-to-many relation where the target entity is not audited.
@ -143,10 +144,10 @@ public class M2MRelationNotAuditedTarget extends AbstractEntityTest {
M2MTargetNotAuditedEntity rev3 = getAuditReader().find(M2MTargetNotAuditedEntity.class, tnae1_id, 3);
M2MTargetNotAuditedEntity rev4 = getAuditReader().find(M2MTargetNotAuditedEntity.class, tnae1_id, 4);
checkList(rev1.getReferences());
checkList(rev2.getReferences(), uste1);
checkList(rev3.getReferences(), uste1);
checkList(rev4.getReferences(), uste1, uste2);
assertTrue(checkList(rev1.getReferences()));
assertTrue(checkList(rev2.getReferences(), uste1));
assertTrue(checkList(rev3.getReferences(), uste1));
assertTrue(checkList(rev4.getReferences(), uste1, uste2));
}
@Test
@ -159,9 +160,9 @@ public class M2MRelationNotAuditedTarget extends AbstractEntityTest {
M2MTargetNotAuditedEntity rev3 = getAuditReader().find(M2MTargetNotAuditedEntity.class, tnae2_id, 3);
M2MTargetNotAuditedEntity rev4 = getAuditReader().find(M2MTargetNotAuditedEntity.class, tnae2_id, 4);
checkList(rev1.getReferences(), uste1, uste2);
checkList(rev2.getReferences(), uste2);
checkList(rev3.getReferences());
checkList(rev4.getReferences(), uste1);
assertTrue(checkList(rev1.getReferences(), uste1, uste2));
assertTrue(checkList(rev2.getReferences(), uste2));
assertTrue(checkList(rev3.getReferences()));
assertTrue(checkList(rev4.getReferences(), uste1));
}
}