HHH-3570: more renaming

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15518 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Adam Warski 2008-11-05 09:17:10 +00:00
parent 4603c8a4dd
commit 5f0bb2f691
98 changed files with 807 additions and 807 deletions

View File

@ -40,7 +40,7 @@ import org.hibernate.ejb.Ejb3Configuration;
public abstract class AbstractEntityTest {
private EntityManagerFactory emf;
private EntityManager entityManager;
private AuditReader versionsReader;
private AuditReader auditReader;
private Ejb3Configuration cfg;
public abstract void configure(Ejb3Configuration cfg);
@ -52,7 +52,7 @@ public abstract class AbstractEntityTest {
}
entityManager = emf.createEntityManager();
versionsReader = AuditReaderFactory.get(entityManager);
auditReader = AuditReaderFactory.get(entityManager);
}
@BeforeClass
@ -69,8 +69,8 @@ public abstract class AbstractEntityTest {
return entityManager;
}
public AuditReader getVersionsReader() {
return versionsReader;
public AuditReader getAuditReader() {
return auditReader;
}
public Ejb3Configuration getCfg() {

View File

@ -60,7 +60,7 @@ public class FieldAccessType extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(FieldAccessTypeEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(FieldAccessTypeEntity.class, id1));
}
@Test
@ -68,7 +68,7 @@ public class FieldAccessType extends AbstractEntityTest {
FieldAccessTypeEntity ver1 = new FieldAccessTypeEntity(id1, "data");
FieldAccessTypeEntity ver2 = new FieldAccessTypeEntity(id1, "data2");
assert getVersionsReader().find(FieldAccessTypeEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(FieldAccessTypeEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(FieldAccessTypeEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(FieldAccessTypeEntity.class, id1, 2).equals(ver2);
}
}

View File

@ -59,7 +59,7 @@ public class MixedAccessType extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(MixedAccessTypeEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(MixedAccessTypeEntity.class, id1));
}
@Test
@ -67,8 +67,8 @@ public class MixedAccessType extends AbstractEntityTest {
MixedAccessTypeEntity ver1 = new MixedAccessTypeEntity(id1, "data");
MixedAccessTypeEntity ver2 = new MixedAccessTypeEntity(id1, "data2");
MixedAccessTypeEntity rev1 = getVersionsReader().find(MixedAccessTypeEntity.class, id1, 1);
MixedAccessTypeEntity rev2 = getVersionsReader().find(MixedAccessTypeEntity.class, id1, 2);
MixedAccessTypeEntity rev1 = getAuditReader().find(MixedAccessTypeEntity.class, id1, 1);
MixedAccessTypeEntity rev2 = getAuditReader().find(MixedAccessTypeEntity.class, id1, 2);
assert rev1.isDataSet();
assert rev2.isDataSet();

View File

@ -59,7 +59,7 @@ public class PropertyAccessType extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(PropertyAccessTypeEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(PropertyAccessTypeEntity.class, id1));
}
@Test
@ -67,8 +67,8 @@ public class PropertyAccessType extends AbstractEntityTest {
PropertyAccessTypeEntity ver1 = new PropertyAccessTypeEntity(id1, "data");
PropertyAccessTypeEntity ver2 = new PropertyAccessTypeEntity(id1, "data2");
PropertyAccessTypeEntity rev1 = getVersionsReader().find(PropertyAccessTypeEntity.class, id1, 1);
PropertyAccessTypeEntity rev2 = getVersionsReader().find(PropertyAccessTypeEntity.class, id1, 2);
PropertyAccessTypeEntity rev1 = getAuditReader().find(PropertyAccessTypeEntity.class, id1, 1);
PropertyAccessTypeEntity rev2 = getAuditReader().find(PropertyAccessTypeEntity.class, id1, 2);
assert rev1.isIdSet();
assert rev2.isIdSet();

View File

@ -97,11 +97,11 @@ public class Delete extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 4).equals(getVersionsReader().getRevisions(BasicTestEntity2.class, id1));
assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(BasicTestEntity2.class, id1));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(BasicTestEntity2.class, id2));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(BasicTestEntity2.class, id2));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BasicTestEntity2.class, id3));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BasicTestEntity2.class, id3));
}
@Test
@ -109,29 +109,29 @@ public class Delete extends AbstractEntityTest {
BasicTestEntity2 ver1 = new BasicTestEntity2(id1, "x", null);
BasicTestEntity2 ver2 = new BasicTestEntity2(id1, "x2", null);
assert getVersionsReader().find(BasicTestEntity2.class, id1, 1).equals(ver1);
assert getVersionsReader().find(BasicTestEntity2.class, id1, 2).equals(ver2);
assert getVersionsReader().find(BasicTestEntity2.class, id1, 3).equals(ver2);
assert getVersionsReader().find(BasicTestEntity2.class, id1, 4) == null;
assert getAuditReader().find(BasicTestEntity2.class, id1, 1).equals(ver1);
assert getAuditReader().find(BasicTestEntity2.class, id1, 2).equals(ver2);
assert getAuditReader().find(BasicTestEntity2.class, id1, 3).equals(ver2);
assert getAuditReader().find(BasicTestEntity2.class, id1, 4) == null;
}
@Test
public void testHistoryOfId2() {
BasicTestEntity2 ver1 = new BasicTestEntity2(id2, "y", null);
assert getVersionsReader().find(BasicTestEntity2.class, id2, 1).equals(ver1);
assert getVersionsReader().find(BasicTestEntity2.class, id2, 2).equals(ver1);
assert getVersionsReader().find(BasicTestEntity2.class, id2, 3) == null;
assert getVersionsReader().find(BasicTestEntity2.class, id2, 4) == null;
assert getAuditReader().find(BasicTestEntity2.class, id2, 1).equals(ver1);
assert getAuditReader().find(BasicTestEntity2.class, id2, 2).equals(ver1);
assert getAuditReader().find(BasicTestEntity2.class, id2, 3) == null;
assert getAuditReader().find(BasicTestEntity2.class, id2, 4) == null;
}
@Test
public void testHistoryOfId3() {
BasicTestEntity2 ver1 = new BasicTestEntity2(id3, "z", null);
assert getVersionsReader().find(BasicTestEntity2.class, id3, 1).equals(ver1);
assert getVersionsReader().find(BasicTestEntity2.class, id3, 2) == null;
assert getVersionsReader().find(BasicTestEntity2.class, id3, 3) == null;
assert getVersionsReader().find(BasicTestEntity2.class, id3, 4) == null;
assert getAuditReader().find(BasicTestEntity2.class, id3, 1).equals(ver1);
assert getAuditReader().find(BasicTestEntity2.class, id3, 2) == null;
assert getAuditReader().find(BasicTestEntity2.class, id3, 3) == null;
assert getAuditReader().find(BasicTestEntity2.class, id3, 4) == null;
}
}

View File

@ -60,7 +60,7 @@ public class GlobalVersioned extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BasicTestEntity4.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BasicTestEntity4.class, id1));
}
@Test
@ -68,7 +68,7 @@ public class GlobalVersioned extends AbstractEntityTest {
BasicTestEntity4 ver1 = new BasicTestEntity4(id1, "x", "y");
BasicTestEntity4 ver2 = new BasicTestEntity4(id1, "a", "b");
assert getVersionsReader().find(BasicTestEntity4.class, id1, 1).equals(ver1);
assert getVersionsReader().find(BasicTestEntity4.class, id1, 2).equals(ver2);
assert getAuditReader().find(BasicTestEntity4.class, id1, 1).equals(ver1);
assert getAuditReader().find(BasicTestEntity4.class, id1, 2).equals(ver2);
}
}

View File

@ -87,11 +87,11 @@ public class ManyOperationsInTransaction extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id1));
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id2));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id2));
assert Arrays.asList(2, 3).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id3));
assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id3));
}
@Test
@ -99,9 +99,9 @@ public class ManyOperationsInTransaction extends AbstractEntityTest {
BasicTestEntity1 ver1 = new BasicTestEntity1(id1, "x", 1);
BasicTestEntity1 ver2 = new BasicTestEntity1(id1, "x2", 1);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 2).equals(ver2);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 3).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id1, 2).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id1, 3).equals(ver2);
}
@Test
@ -110,9 +110,9 @@ public class ManyOperationsInTransaction extends AbstractEntityTest {
BasicTestEntity1 ver2 = new BasicTestEntity1(id2, "y", 21);
BasicTestEntity1 ver3 = new BasicTestEntity1(id2, "y3", 22);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 1).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 2).equals(ver2);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 3).equals(ver3);
assert getAuditReader().find(BasicTestEntity1.class, id2, 1).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id2, 2).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id2, 3).equals(ver3);
}
@Test
@ -120,8 +120,8 @@ public class ManyOperationsInTransaction extends AbstractEntityTest {
BasicTestEntity1 ver1 = new BasicTestEntity1(id3, "z", 300);
BasicTestEntity1 ver2 = new BasicTestEntity1(id3, "z3", 300);
assert getVersionsReader().find(BasicTestEntity1.class, id3, 1) == null;
assert getVersionsReader().find(BasicTestEntity1.class, id3, 2).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id3, 3).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id3, 1) == null;
assert getAuditReader().find(BasicTestEntity1.class, id3, 2).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id3, 3).equals(ver2);
}
}

View File

@ -60,11 +60,11 @@ public class NotVersioned extends AbstractEntityTest {
@Test(expectedExceptions = NotAuditedException.class)
public void testRevisionsCounts() {
getVersionsReader().getRevisions(BasicTestEntity3.class, id1);
getAuditReader().getRevisions(BasicTestEntity3.class, id1);
}
@Test(expectedExceptions = NotAuditedException.class)
public void testHistoryOfId1() {
getVersionsReader().find(BasicTestEntity3.class, id1, 1);
getAuditReader().find(BasicTestEntity3.class, id1, 1);
}
}

View File

@ -73,9 +73,9 @@ public class NullProperties extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id1));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id1));
assert Arrays.asList(2, 4).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id2));
assert Arrays.asList(2, 4).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id2));
}
@Test
@ -83,10 +83,10 @@ public class NullProperties extends AbstractEntityTest {
BasicTestEntity1 ver1 = new BasicTestEntity1(id1, "x", 1);
BasicTestEntity1 ver2 = new BasicTestEntity1(id1, null, 1);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 2).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 3).equals(ver2);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 4).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id1, 2).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id1, 3).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id1, 4).equals(ver2);
}
@Test
@ -94,9 +94,9 @@ public class NullProperties extends AbstractEntityTest {
BasicTestEntity1 ver1 = new BasicTestEntity1(id2, null, 20);
BasicTestEntity1 ver2 = new BasicTestEntity1(id2, "y2", 20);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 1) == null;
assert getVersionsReader().find(BasicTestEntity1.class, id2, 2).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 3).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 4).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id2, 1) == null;
assert getAuditReader().find(BasicTestEntity1.class, id2, 2).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id2, 3).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id2, 4).equals(ver2);
}
}

View File

@ -60,7 +60,7 @@ public class Simple extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(IntTestEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(IntTestEntity.class, id1));
}
@Test
@ -68,7 +68,7 @@ public class Simple extends AbstractEntityTest {
IntTestEntity ver1 = new IntTestEntity(10, id1);
IntTestEntity ver2 = new IntTestEntity(20, id1);
assert getVersionsReader().find(IntTestEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(IntTestEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(IntTestEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(IntTestEntity.class, id1, 2).equals(ver2);
}
}

View File

@ -79,29 +79,29 @@ public class SingleOperationInTransaction extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 4, 6).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id1));
assert Arrays.asList(1, 4, 6).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id1));
assert Arrays.asList(2, 5, 7).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id2));
assert Arrays.asList(2, 5, 7).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id2));
assert Arrays.asList(3).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id3));
assert Arrays.asList(3).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id3));
}
@Test
public void testRevisionsDates() {
for (int i=1; i<7; i++) {
assert getVersionsReader().getRevisionDate(i).getTime() <=
getVersionsReader().getRevisionDate(i+1).getTime();
assert getAuditReader().getRevisionDate(i).getTime() <=
getAuditReader().getRevisionDate(i+1).getTime();
}
}
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testNotExistingRevision() {
getVersionsReader().getRevisionDate(8);
getAuditReader().getRevisionDate(8);
}
@Test(expectedExceptions = IllegalArgumentException.class)
public void testIllegalRevision() {
getVersionsReader().getRevisionDate(0);
getAuditReader().getRevisionDate(0);
}
@Test
@ -110,13 +110,13 @@ public class SingleOperationInTransaction extends AbstractEntityTest {
BasicTestEntity1 ver2 = new BasicTestEntity1(id1, "x2", 2);
BasicTestEntity1 ver3 = new BasicTestEntity1(id1, "x3", 3);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 2).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 3).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 4).equals(ver2);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 5).equals(ver2);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 6).equals(ver3);
assert getVersionsReader().find(BasicTestEntity1.class, id1, 7).equals(ver3);
assert getAuditReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id1, 2).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id1, 3).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id1, 4).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id1, 5).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id1, 6).equals(ver3);
assert getAuditReader().find(BasicTestEntity1.class, id1, 7).equals(ver3);
}
@Test
@ -125,36 +125,36 @@ public class SingleOperationInTransaction extends AbstractEntityTest {
BasicTestEntity1 ver2 = new BasicTestEntity1(id2, "y2", 20);
BasicTestEntity1 ver3 = new BasicTestEntity1(id2, "y3", 21);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 1) == null;
assert getVersionsReader().find(BasicTestEntity1.class, id2, 2).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 3).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 4).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 5).equals(ver2);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 6).equals(ver2);
assert getVersionsReader().find(BasicTestEntity1.class, id2, 7).equals(ver3);
assert getAuditReader().find(BasicTestEntity1.class, id2, 1) == null;
assert getAuditReader().find(BasicTestEntity1.class, id2, 2).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id2, 3).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id2, 4).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id2, 5).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id2, 6).equals(ver2);
assert getAuditReader().find(BasicTestEntity1.class, id2, 7).equals(ver3);
}
@Test
public void testHistoryOfId3() {
BasicTestEntity1 ver1 = new BasicTestEntity1(id3, "z", 30);
assert getVersionsReader().find(BasicTestEntity1.class, id3, 1) == null;
assert getVersionsReader().find(BasicTestEntity1.class, id3, 2) == null;
assert getVersionsReader().find(BasicTestEntity1.class, id3, 3).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id3, 4).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id3, 5).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id3, 6).equals(ver1);
assert getVersionsReader().find(BasicTestEntity1.class, id3, 7).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id3, 1) == null;
assert getAuditReader().find(BasicTestEntity1.class, id3, 2) == null;
assert getAuditReader().find(BasicTestEntity1.class, id3, 3).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id3, 4).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id3, 5).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id3, 6).equals(ver1);
assert getAuditReader().find(BasicTestEntity1.class, id3, 7).equals(ver1);
}
@Test
public void testHistoryOfNotExistingEntity() {
assert getVersionsReader().find(BasicTestEntity1.class, id1+id2+id3, 1) == null;
assert getVersionsReader().find(BasicTestEntity1.class, id1+id2+id3, 7) == null;
assert getAuditReader().find(BasicTestEntity1.class, id1+id2+id3, 1) == null;
assert getAuditReader().find(BasicTestEntity1.class, id1+id2+id3, 7) == null;
}
@Test
public void testRevisionsOfNotExistingEntity() {
assert getVersionsReader().getRevisions(BasicTestEntity1.class, id1+id2+id3).size() == 0;
assert getAuditReader().getRevisions(BasicTestEntity1.class, id1+id2+id3).size() == 0;
}
}

View File

@ -71,7 +71,7 @@ public class UnversionedPropertiesChange extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BasicTestEntity2.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BasicTestEntity2.class, id1));
}
@Test
@ -79,7 +79,7 @@ public class UnversionedPropertiesChange extends AbstractEntityTest {
BasicTestEntity2 ver1 = new BasicTestEntity2(id1, "x", null);
BasicTestEntity2 ver2 = new BasicTestEntity2(id1, "y", null);
assert getVersionsReader().find(BasicTestEntity2.class, id1, 1).equals(ver1);
assert getVersionsReader().find(BasicTestEntity2.class, id1, 2).equals(ver2);
assert getAuditReader().find(BasicTestEntity2.class, id1, 1).equals(ver1);
assert getAuditReader().find(BasicTestEntity2.class, id1, 2).equals(ver2);
}
}

View File

@ -64,7 +64,7 @@ public class UnversionedProperty extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(UnversionedEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(UnversionedEntity.class, id1));
}
@Test
@ -72,7 +72,7 @@ public class UnversionedProperty extends AbstractEntityTest {
UnversionedEntity rev1 = new UnversionedEntity(id1, "a1", null);
UnversionedEntity rev2 = new UnversionedEntity(id1, "a2", null);
assert getVersionsReader().find(UnversionedEntity.class, id1, 1).equals(rev1);
assert getVersionsReader().find(UnversionedEntity.class, id1, 2).equals(rev2);
assert getAuditReader().find(UnversionedEntity.class, id1, 1).equals(rev1);
assert getAuditReader().find(UnversionedEntity.class, id1, 2).equals(rev2);
}
}

View File

@ -96,10 +96,10 @@ public class OneToManyCache extends AbstractEntityTest {
@Test
public void testCacheReferenceAccessAfterFind() {
SetRefEdEntity ed1_rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
SetRefEdEntity ed1_rev1 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 1);
SetRefIngEntity ing1_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 1);
SetRefIngEntity ing2_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 1);
SetRefIngEntity ing1_rev1 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 1);
SetRefIngEntity ing2_rev1 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 1);
// It should be exactly the same object
assert ing1_rev1.getReference() == ed1_rev1;
@ -108,7 +108,7 @@ public class OneToManyCache extends AbstractEntityTest {
@Test
public void testCacheReferenceAccessAfterCollectionAccessRev1() {
SetRefEdEntity ed1_rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
SetRefEdEntity ed1_rev1 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 1);
// It should be exactly the same object
assert ed1_rev1.getReffering().size() == 2;
@ -119,7 +119,7 @@ public class OneToManyCache extends AbstractEntityTest {
@Test
public void testCacheReferenceAccessAfterCollectionAccessRev2() {
SetRefEdEntity ed2_rev2 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 2);
SetRefEdEntity ed2_rev2 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 2);
assert ed2_rev2.getReffering().size() == 2;
for (SetRefIngEntity setRefIngEntity : ed2_rev2.getReffering()) {
@ -129,13 +129,13 @@ public class OneToManyCache extends AbstractEntityTest {
@Test
public void testCacheFindAfterCollectionAccessRev1() {
SetRefEdEntity ed1_rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
SetRefEdEntity ed1_rev1 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 1);
// Reading the collection
assert ed1_rev1.getReffering().size() == 2;
SetRefIngEntity ing1_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 1);
SetRefIngEntity ing2_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 1);
SetRefIngEntity ing1_rev1 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 1);
SetRefIngEntity ing2_rev1 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 1);
for (SetRefIngEntity setRefIngEntity : ed1_rev1.getReffering()) {
assert setRefIngEntity == ing1_rev1 || setRefIngEntity == ing2_rev1;

View File

@ -88,16 +88,16 @@ public class OneToOneCache extends AbstractEntityTest {
@Test
public void testCacheReferenceAccessAfterFindRev1() {
BiRefEdEntity ed1_rev1 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 1);
BiRefIngEntity ing1_rev1 = getVersionsReader().find(BiRefIngEntity.class, ing1_id, 1);
BiRefEdEntity ed1_rev1 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 1);
BiRefIngEntity ing1_rev1 = getAuditReader().find(BiRefIngEntity.class, ing1_id, 1);
assert ing1_rev1.getReference() == ed1_rev1;
}
@Test
public void testCacheReferenceAccessAfterFindRev2() {
BiRefEdEntity ed2_rev2 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 2);
BiRefIngEntity ing1_rev2 = getVersionsReader().find(BiRefIngEntity.class, ing1_id, 2);
BiRefEdEntity ed2_rev2 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 2);
BiRefIngEntity ing1_rev2 = getAuditReader().find(BiRefIngEntity.class, ing1_id, 2);
assert ing1_rev2.getReference() == ed2_rev2;
}

View File

@ -63,12 +63,12 @@ public class QueryCache extends AbstractEntityTest {
@Test
public void testCacheFindAfterRevisionsOfEntityQuery() {
List entsFromQuery = getVersionsReader().createQuery()
List entsFromQuery = getAuditReader().createQuery()
.forRevisionsOfEntity(IntTestEntity.class, true, false)
.getResultList();
IntTestEntity entFromFindRev1 = getVersionsReader().find(IntTestEntity.class, id1, 1);
IntTestEntity entFromFindRev2 = getVersionsReader().find(IntTestEntity.class, id1, 2);
IntTestEntity entFromFindRev1 = getAuditReader().find(IntTestEntity.class, id1, 1);
IntTestEntity entFromFindRev2 = getAuditReader().find(IntTestEntity.class, id1, 2);
assert entFromFindRev1 == entsFromQuery.get(0);
assert entFromFindRev2 == entsFromQuery.get(1);
@ -76,11 +76,11 @@ public class QueryCache extends AbstractEntityTest {
@Test
public void testCacheFindAfterEntitiesAtRevisionQuery() {
IntTestEntity entFromQuery = (IntTestEntity) getVersionsReader().createQuery()
IntTestEntity entFromQuery = (IntTestEntity) getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 1)
.getSingleResult();
IntTestEntity entFromFind = getVersionsReader().find(IntTestEntity.class, id1, 1);
IntTestEntity entFromFind = getAuditReader().find(IntTestEntity.class, id1, 1);
assert entFromFind == entFromQuery;
}

View File

@ -89,14 +89,14 @@ public class EnumSet extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(EnumSetEntity.class, sse1_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(EnumSetEntity.class, sse1_id));
}
@Test
public void testHistoryOfSse1() {
EnumSetEntity rev1 = getVersionsReader().find(EnumSetEntity.class, sse1_id, 1);
EnumSetEntity rev2 = getVersionsReader().find(EnumSetEntity.class, sse1_id, 2);
EnumSetEntity rev3 = getVersionsReader().find(EnumSetEntity.class, sse1_id, 3);
EnumSetEntity rev1 = getAuditReader().find(EnumSetEntity.class, sse1_id, 1);
EnumSetEntity rev2 = getAuditReader().find(EnumSetEntity.class, sse1_id, 2);
EnumSetEntity rev3 = getAuditReader().find(EnumSetEntity.class, sse1_id, 3);
assert rev1.getEnums1().equals(TestTools.makeSet(E1.X));
assert rev2.getEnums1().equals(TestTools.makeSet(E1.X, E1.Y));

View File

@ -97,15 +97,15 @@ public class StringList extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(StringListEntity.class, sle1_id));
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(StringListEntity.class, sle2_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(StringListEntity.class, sle1_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(StringListEntity.class, sle2_id));
}
@Test
public void testHistoryOfSle1() {
StringListEntity rev1 = getVersionsReader().find(StringListEntity.class, sle1_id, 1);
StringListEntity rev2 = getVersionsReader().find(StringListEntity.class, sle1_id, 2);
StringListEntity rev3 = getVersionsReader().find(StringListEntity.class, sle1_id, 3);
StringListEntity rev1 = getAuditReader().find(StringListEntity.class, sle1_id, 1);
StringListEntity rev2 = getAuditReader().find(StringListEntity.class, sle1_id, 2);
StringListEntity rev3 = getAuditReader().find(StringListEntity.class, sle1_id, 3);
assert rev1.getStrings().equals(Collections.EMPTY_LIST);
assert rev2.getStrings().equals(TestTools.makeList("sle1_string1", "sle1_string2"));
@ -114,9 +114,9 @@ public class StringList extends AbstractEntityTest {
@Test
public void testHistoryOfSse2() {
StringListEntity rev1 = getVersionsReader().find(StringListEntity.class, sle2_id, 1);
StringListEntity rev2 = getVersionsReader().find(StringListEntity.class, sle2_id, 2);
StringListEntity rev3 = getVersionsReader().find(StringListEntity.class, sle2_id, 3);
StringListEntity rev1 = getAuditReader().find(StringListEntity.class, sle2_id, 1);
StringListEntity rev2 = getAuditReader().find(StringListEntity.class, sle2_id, 2);
StringListEntity rev3 = getAuditReader().find(StringListEntity.class, sle2_id, 3);
assert rev1.getStrings().equals(TestTools.makeList("sle2_string1", "sle2_string2"));
assert rev2.getStrings().equals(TestTools.makeList("sle2_string1", "sle2_string2", "sle2_string1"));

View File

@ -104,16 +104,16 @@ public class StringMap extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(StringMapEntity.class, sme1_id));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(StringMapEntity.class, sme2_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(StringMapEntity.class, sme1_id));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(StringMapEntity.class, sme2_id));
}
@Test
public void testHistoryOfSse1() {
StringMapEntity rev1 = getVersionsReader().find(StringMapEntity.class, sme1_id, 1);
StringMapEntity rev2 = getVersionsReader().find(StringMapEntity.class, sme1_id, 2);
StringMapEntity rev3 = getVersionsReader().find(StringMapEntity.class, sme1_id, 3);
StringMapEntity rev4 = getVersionsReader().find(StringMapEntity.class, sme1_id, 4);
StringMapEntity rev1 = getAuditReader().find(StringMapEntity.class, sme1_id, 1);
StringMapEntity rev2 = getAuditReader().find(StringMapEntity.class, sme1_id, 2);
StringMapEntity rev3 = getAuditReader().find(StringMapEntity.class, sme1_id, 3);
StringMapEntity rev4 = getAuditReader().find(StringMapEntity.class, sme1_id, 4);
assert rev1.getStrings().equals(Collections.EMPTY_MAP);
assert rev2.getStrings().equals(TestTools.makeMap("1", "a", "2", "b"));
@ -123,10 +123,10 @@ public class StringMap extends AbstractEntityTest {
@Test
public void testHistoryOfSse2() {
StringMapEntity rev1 = getVersionsReader().find(StringMapEntity.class, sme2_id, 1);
StringMapEntity rev2 = getVersionsReader().find(StringMapEntity.class, sme2_id, 2);
StringMapEntity rev3 = getVersionsReader().find(StringMapEntity.class, sme2_id, 3);
StringMapEntity rev4 = getVersionsReader().find(StringMapEntity.class, sme2_id, 4);
StringMapEntity rev1 = getAuditReader().find(StringMapEntity.class, sme2_id, 1);
StringMapEntity rev2 = getAuditReader().find(StringMapEntity.class, sme2_id, 2);
StringMapEntity rev3 = getAuditReader().find(StringMapEntity.class, sme2_id, 3);
StringMapEntity rev4 = getAuditReader().find(StringMapEntity.class, sme2_id, 4);
assert rev1.getStrings().equals(TestTools.makeMap("1", "a"));
assert rev2.getStrings().equals(TestTools.makeMap("1", "a"));

View File

@ -96,15 +96,15 @@ public class StringSet extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StringSetEntity.class, sse1_id));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(StringSetEntity.class, sse2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StringSetEntity.class, sse1_id));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(StringSetEntity.class, sse2_id));
}
@Test
public void testHistoryOfSse1() {
StringSetEntity rev1 = getVersionsReader().find(StringSetEntity.class, sse1_id, 1);
StringSetEntity rev2 = getVersionsReader().find(StringSetEntity.class, sse1_id, 2);
StringSetEntity rev3 = getVersionsReader().find(StringSetEntity.class, sse1_id, 3);
StringSetEntity rev1 = getAuditReader().find(StringSetEntity.class, sse1_id, 1);
StringSetEntity rev2 = getAuditReader().find(StringSetEntity.class, sse1_id, 2);
StringSetEntity rev3 = getAuditReader().find(StringSetEntity.class, sse1_id, 3);
assert rev1.getStrings().equals(Collections.EMPTY_SET);
assert rev2.getStrings().equals(TestTools.makeSet("sse1_string1", "sse1_string2"));
@ -113,9 +113,9 @@ public class StringSet extends AbstractEntityTest {
@Test
public void testHistoryOfSse2() {
StringSetEntity rev1 = getVersionsReader().find(StringSetEntity.class, sse2_id, 1);
StringSetEntity rev2 = getVersionsReader().find(StringSetEntity.class, sse2_id, 2);
StringSetEntity rev3 = getVersionsReader().find(StringSetEntity.class, sse2_id, 3);
StringSetEntity rev1 = getAuditReader().find(StringSetEntity.class, sse2_id, 1);
StringSetEntity rev2 = getAuditReader().find(StringSetEntity.class, sse2_id, 2);
StringSetEntity rev3 = getAuditReader().find(StringSetEntity.class, sse2_id, 3);
assert rev1.getStrings().equals(TestTools.makeSet("sse2_string1", "sse2_string2"));
assert rev2.getStrings().equals(TestTools.makeSet("sse2_string1", "sse2_string2"));

View File

@ -91,7 +91,7 @@ public class ComponentMapKey extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ComponentMapKeyEntity.class, cmke_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ComponentMapKeyEntity.class, cmke_id));
}
@Test
@ -103,8 +103,8 @@ public class ComponentMapKey extends AbstractEntityTest {
cte1.setComp2(null);
cte2.setComp2(null);
ComponentMapKeyEntity rev1 = getVersionsReader().find(ComponentMapKeyEntity.class, cmke_id, 1);
ComponentMapKeyEntity rev2 = getVersionsReader().find(ComponentMapKeyEntity.class, cmke_id, 2);
ComponentMapKeyEntity rev1 = getAuditReader().find(ComponentMapKeyEntity.class, cmke_id, 1);
ComponentMapKeyEntity rev2 = getAuditReader().find(ComponentMapKeyEntity.class, cmke_id, 2);
assert rev1.getIdmap().equals(TestTools.makeMap(cte1.getComp1(), cte1));
assert rev2.getIdmap().equals(TestTools.makeMap(cte1.getComp1(), cte1, cte2.getComp1(), cte2));

View File

@ -89,7 +89,7 @@ public class IdMapKey extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(IdMapKeyEntity.class, imke_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(IdMapKeyEntity.class, imke_id));
}
@Test
@ -97,8 +97,8 @@ public class IdMapKey extends AbstractEntityTest {
StrTestEntity ste1 = getEntityManager().find(StrTestEntity.class, ste1_id);
StrTestEntity ste2 = getEntityManager().find(StrTestEntity.class, ste2_id);
IdMapKeyEntity rev1 = getVersionsReader().find(IdMapKeyEntity.class, imke_id, 1);
IdMapKeyEntity rev2 = getVersionsReader().find(IdMapKeyEntity.class, imke_id, 2);
IdMapKeyEntity rev1 = getAuditReader().find(IdMapKeyEntity.class, imke_id, 1);
IdMapKeyEntity rev2 = getAuditReader().find(IdMapKeyEntity.class, imke_id, 2);
assert rev1.getIdmap().equals(TestTools.makeMap(ste1.getId(), ste1));
assert rev2.getIdmap().equals(TestTools.makeMap(ste1.getId(), ste1, ste2.getId(), ste2));

View File

@ -107,11 +107,11 @@ public class Components extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ComponentTestEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ComponentTestEntity.class, id1));
assert Arrays.asList(1, 2, 4).equals(getVersionsReader().getRevisions(ComponentTestEntity.class, id2));
assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(ComponentTestEntity.class, id2));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(ComponentTestEntity.class, id3));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(ComponentTestEntity.class, id3));
}
@Test
@ -119,10 +119,10 @@ public class Components extends AbstractEntityTest {
ComponentTestEntity ver1 = new ComponentTestEntity(id1, new Component1("a", "b"), null);
ComponentTestEntity ver2 = new ComponentTestEntity(id1, new Component1("a'", "b'"), null);
assert getVersionsReader().find(ComponentTestEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(ComponentTestEntity.class, id1, 2).equals(ver2);
assert getVersionsReader().find(ComponentTestEntity.class, id1, 3).equals(ver2);
assert getVersionsReader().find(ComponentTestEntity.class, id1, 4).equals(ver2);
assert getAuditReader().find(ComponentTestEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(ComponentTestEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(ComponentTestEntity.class, id1, 3).equals(ver2);
assert getAuditReader().find(ComponentTestEntity.class, id1, 4).equals(ver2);
}
@Test
@ -130,10 +130,10 @@ public class Components extends AbstractEntityTest {
ComponentTestEntity ver1 = new ComponentTestEntity(id2, new Component1("a2", "b2"), null);
ComponentTestEntity ver2 = new ComponentTestEntity(id2, new Component1("a2'", "b2"), null);
assert getVersionsReader().find(ComponentTestEntity.class, id2, 1).equals(ver1);
assert getVersionsReader().find(ComponentTestEntity.class, id2, 2).equals(ver2);
assert getVersionsReader().find(ComponentTestEntity.class, id2, 3).equals(ver2);
assert getVersionsReader().find(ComponentTestEntity.class, id2, 4) == null;
assert getAuditReader().find(ComponentTestEntity.class, id2, 1).equals(ver1);
assert getAuditReader().find(ComponentTestEntity.class, id2, 2).equals(ver2);
assert getAuditReader().find(ComponentTestEntity.class, id2, 3).equals(ver2);
assert getAuditReader().find(ComponentTestEntity.class, id2, 4) == null;
}
@Test
@ -141,9 +141,9 @@ public class Components extends AbstractEntityTest {
ComponentTestEntity ver1 = new ComponentTestEntity(id3, new Component1("a3", "b3"), null);
ComponentTestEntity ver2 = new ComponentTestEntity(id3, new Component1("a3", "b3'"), null);
assert getVersionsReader().find(ComponentTestEntity.class, id3, 1).equals(ver1);
assert getVersionsReader().find(ComponentTestEntity.class, id3, 2).equals(ver1);
assert getVersionsReader().find(ComponentTestEntity.class, id3, 3).equals(ver2);
assert getVersionsReader().find(ComponentTestEntity.class, id3, 4).equals(ver2);
assert getAuditReader().find(ComponentTestEntity.class, id3, 1).equals(ver1);
assert getAuditReader().find(ComponentTestEntity.class, id3, 2).equals(ver1);
assert getAuditReader().find(ComponentTestEntity.class, id3, 3).equals(ver2);
assert getAuditReader().find(ComponentTestEntity.class, id3, 4).equals(ver2);
}
}

View File

@ -84,14 +84,14 @@ public class CompositeCustom extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(CompositeCustomTypeEntity.class, ccte_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(CompositeCustomTypeEntity.class, ccte_id));
}
@Test
public void testHistoryOfCcte() {
CompositeCustomTypeEntity rev1 = getVersionsReader().find(CompositeCustomTypeEntity.class, ccte_id, 1);
CompositeCustomTypeEntity rev2 = getVersionsReader().find(CompositeCustomTypeEntity.class, ccte_id, 2);
CompositeCustomTypeEntity rev3 = getVersionsReader().find(CompositeCustomTypeEntity.class, ccte_id, 3);
CompositeCustomTypeEntity rev1 = getAuditReader().find(CompositeCustomTypeEntity.class, ccte_id, 1);
CompositeCustomTypeEntity rev2 = getAuditReader().find(CompositeCustomTypeEntity.class, ccte_id, 2);
CompositeCustomTypeEntity rev3 = getAuditReader().find(CompositeCustomTypeEntity.class, ccte_id, 3);
assert rev1.getComponent().equals(new Component("a", 1));
assert rev2.getComponent().equals(new Component("b", 1));

View File

@ -74,13 +74,13 @@ public class ParametrizedCustom extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ParametrizedCustomTypeEntity.class, pcte_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ParametrizedCustomTypeEntity.class, pcte_id));
}
@Test
public void testHistoryOfCcte() {
ParametrizedCustomTypeEntity rev1 = getVersionsReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 1);
ParametrizedCustomTypeEntity rev2 = getVersionsReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 2);
ParametrizedCustomTypeEntity rev1 = getAuditReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 1);
ParametrizedCustomTypeEntity rev2 = getAuditReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 2);
assert "xUy".equals(rev1.getStr());
assert "xVy".equals(rev2.getStr());

View File

@ -60,7 +60,7 @@ public class Dates extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(DateTestEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(DateTestEntity.class, id1));
}
@Test
@ -68,7 +68,7 @@ public class Dates extends AbstractEntityTest {
DateTestEntity ver1 = new DateTestEntity(id1, new Date(12345000));
DateTestEntity ver2 = new DateTestEntity(id1, new Date(45678000));
assert getVersionsReader().find(DateTestEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(DateTestEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(DateTestEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(DateTestEntity.class, id1, 2).equals(ver2);
}
}

View File

@ -62,7 +62,7 @@ public class Enums extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(EnumTestEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(EnumTestEntity.class, id1));
}
@Test
@ -70,7 +70,7 @@ public class Enums extends AbstractEntityTest {
EnumTestEntity ver1 = new EnumTestEntity(id1, EnumTestEntity.E1.X, EnumTestEntity.E2.A);
EnumTestEntity ver2 = new EnumTestEntity(id1, EnumTestEntity.E1.Y, EnumTestEntity.E2.B);
assert getVersionsReader().find(EnumTestEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(EnumTestEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(EnumTestEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(EnumTestEntity.class, id1, 2).equals(ver2);
}
}

View File

@ -61,7 +61,7 @@ public class Lobs extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(LobTestEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(LobTestEntity.class, id1));
}
@Test
@ -69,7 +69,7 @@ public class Lobs extends AbstractEntityTest {
LobTestEntity ver1 = new LobTestEntity(id1, "abc", new byte[] { 0, 1, 2 }, new char[] { 'x', 'y', 'z' });
LobTestEntity ver2 = new LobTestEntity(id1, "def", new byte[] { 3, 4, 5 }, new char[] { 'h', 'i', 'j' });
assert getVersionsReader().find(LobTestEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(LobTestEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(LobTestEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(LobTestEntity.class, id1, 2).equals(ver2);
}
}

View File

@ -59,7 +59,7 @@ public class Serializables extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SerializableTestEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SerializableTestEntity.class, id1));
}
@Test
@ -67,7 +67,7 @@ public class Serializables extends AbstractEntityTest {
SerializableTestEntity ver1 = new SerializableTestEntity(id1, new SerObject("d1"));
SerializableTestEntity ver2 = new SerializableTestEntity(id1, new SerObject("d2"));
assert getVersionsReader().find(SerializableTestEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(SerializableTestEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(SerializableTestEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(SerializableTestEntity.class, id1, 2).equals(ver2);
}
}

View File

@ -66,11 +66,11 @@ public class DoubleFlushAddDel extends AbstractFlushTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList().equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList().equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
public void testHistoryOfId() {
assert getVersionsReader().find(StrTestEntity.class, id, 1) == null;
assert getAuditReader().find(StrTestEntity.class, id, 1) == null;
}
}

View File

@ -76,7 +76,7 @@ public class DoubleFlushAddMod extends AbstractFlushTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@ -84,7 +84,7 @@ public class DoubleFlushAddMod extends AbstractFlushTest {
StrTestEntity ver1 = new StrTestEntity("y", id);
StrTestEntity ver2 = new StrTestEntity("z", id);
assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}

View File

@ -73,14 +73,14 @@ public class DoubleFlushModDel extends AbstractFlushTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
public void testHistoryOfId() {
StrTestEntity ver1 = new StrTestEntity("x", id);
assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(StrTestEntity.class, id, 2) == null;
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2) == null;
}
}

View File

@ -73,7 +73,7 @@ public class DoubleFlushModMod extends AbstractFlushTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@ -81,7 +81,7 @@ public class DoubleFlushModMod extends AbstractFlushTest {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("z", id);
assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}

View File

@ -80,7 +80,7 @@ public class ManualFlush extends AbstractFlushTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@ -88,8 +88,8 @@ public class ManualFlush extends AbstractFlushTest {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("z", id);
assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
@Test

View File

@ -119,13 +119,13 @@ public class CompositeIds extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 3, 4).equals(getVersionsReader().getRevisions(EmbIdTestEntity.class, id1));
assert Arrays.asList(1, 3, 4).equals(getAuditReader().getRevisions(EmbIdTestEntity.class, id1));
assert Arrays.asList(2, 3, 4, 5).equals(getVersionsReader().getRevisions(EmbIdTestEntity.class, id2));
assert Arrays.asList(2, 3, 4, 5).equals(getAuditReader().getRevisions(EmbIdTestEntity.class, id2));
assert Arrays.asList(1, 3, 4).equals(getVersionsReader().getRevisions(MulIdTestEntity.class, id3));
assert Arrays.asList(1, 3, 4).equals(getAuditReader().getRevisions(MulIdTestEntity.class, id3));
assert Arrays.asList(2, 3).equals(getVersionsReader().getRevisions(MulIdTestEntity.class, id4));
assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(MulIdTestEntity.class, id4));
}
@Test
@ -133,11 +133,11 @@ public class CompositeIds extends AbstractEntityTest {
EmbIdTestEntity ver1 = new EmbIdTestEntity(id1, "x");
EmbIdTestEntity ver2 = new EmbIdTestEntity(id1, "x2");
assert getVersionsReader().find(EmbIdTestEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(EmbIdTestEntity.class, id1, 2).equals(ver1);
assert getVersionsReader().find(EmbIdTestEntity.class, id1, 3).equals(ver2);
assert getVersionsReader().find(EmbIdTestEntity.class, id1, 4) == null;
assert getVersionsReader().find(EmbIdTestEntity.class, id1, 5) == null;
assert getAuditReader().find(EmbIdTestEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(EmbIdTestEntity.class, id1, 2).equals(ver1);
assert getAuditReader().find(EmbIdTestEntity.class, id1, 3).equals(ver2);
assert getAuditReader().find(EmbIdTestEntity.class, id1, 4) == null;
assert getAuditReader().find(EmbIdTestEntity.class, id1, 5) == null;
}
@Test
@ -146,11 +146,11 @@ public class CompositeIds extends AbstractEntityTest {
EmbIdTestEntity ver2 = new EmbIdTestEntity(id2, "y2");
EmbIdTestEntity ver3 = new EmbIdTestEntity(id2, "y3");
assert getVersionsReader().find(EmbIdTestEntity.class, id2, 1) == null;
assert getVersionsReader().find(EmbIdTestEntity.class, id2, 2).equals(ver1);
assert getVersionsReader().find(EmbIdTestEntity.class, id2, 3).equals(ver2);
assert getVersionsReader().find(EmbIdTestEntity.class, id2, 4).equals(ver3);
assert getVersionsReader().find(EmbIdTestEntity.class, id2, 5) == null;
assert getAuditReader().find(EmbIdTestEntity.class, id2, 1) == null;
assert getAuditReader().find(EmbIdTestEntity.class, id2, 2).equals(ver1);
assert getAuditReader().find(EmbIdTestEntity.class, id2, 3).equals(ver2);
assert getAuditReader().find(EmbIdTestEntity.class, id2, 4).equals(ver3);
assert getAuditReader().find(EmbIdTestEntity.class, id2, 5) == null;
}
@Test
@ -158,11 +158,11 @@ public class CompositeIds extends AbstractEntityTest {
MulIdTestEntity ver1 = new MulIdTestEntity(id3.getId1(), id3.getId2(), "a");
MulIdTestEntity ver2 = new MulIdTestEntity(id3.getId1(), id3.getId2(), "a2");
assert getVersionsReader().find(MulIdTestEntity.class, id3, 1).equals(ver1);
assert getVersionsReader().find(MulIdTestEntity.class, id3, 2).equals(ver1);
assert getVersionsReader().find(MulIdTestEntity.class, id3, 3).equals(ver2);
assert getVersionsReader().find(MulIdTestEntity.class, id3, 4) == null;
assert getVersionsReader().find(MulIdTestEntity.class, id3, 5) == null;
assert getAuditReader().find(MulIdTestEntity.class, id3, 1).equals(ver1);
assert getAuditReader().find(MulIdTestEntity.class, id3, 2).equals(ver1);
assert getAuditReader().find(MulIdTestEntity.class, id3, 3).equals(ver2);
assert getAuditReader().find(MulIdTestEntity.class, id3, 4) == null;
assert getAuditReader().find(MulIdTestEntity.class, id3, 5) == null;
}
@Test
@ -170,10 +170,10 @@ public class CompositeIds extends AbstractEntityTest {
MulIdTestEntity ver1 = new MulIdTestEntity(id4.getId1(), id4.getId2(), "b");
MulIdTestEntity ver2 = new MulIdTestEntity(id4.getId1(), id4.getId2(), "b2");
assert getVersionsReader().find(MulIdTestEntity.class, id4, 1) == null;
assert getVersionsReader().find(MulIdTestEntity.class, id4, 2).equals(ver1);
assert getVersionsReader().find(MulIdTestEntity.class, id4, 3).equals(ver2);
assert getVersionsReader().find(MulIdTestEntity.class, id4, 4).equals(ver2);
assert getVersionsReader().find(MulIdTestEntity.class, id4, 5).equals(ver2);
assert getAuditReader().find(MulIdTestEntity.class, id4, 1) == null;
assert getAuditReader().find(MulIdTestEntity.class, id4, 2).equals(ver1);
assert getAuditReader().find(MulIdTestEntity.class, id4, 3).equals(ver2);
assert getAuditReader().find(MulIdTestEntity.class, id4, 4).equals(ver2);
assert getAuditReader().find(MulIdTestEntity.class, id4, 5).equals(ver2);
}
}

View File

@ -64,7 +64,7 @@ public class ChildVersioning extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ChildEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ChildEntity.class, id1));
}
@Test
@ -72,21 +72,21 @@ public class ChildVersioning extends AbstractEntityTest {
ChildEntity ver1 = new ChildEntity(id1, "x", 1l);
ChildEntity ver2 = new ChildEntity(id1, "y", 2l);
assert getVersionsReader().find(ChildEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(ChildEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(ChildEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(ChildEntity.class, id1, 2).equals(ver2);
assert getVersionsReader().find(ParentEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(ParentEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(ParentEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(ParentEntity.class, id1, 2).equals(ver2);
}
@Test
public void testPolymorphicQuery() {
ChildEntity childVer1 = new ChildEntity(id1, "x", 1l);
assert getVersionsReader().createQuery().forEntitiesAtRevision(ChildEntity.class, 1).getSingleResult()
assert getAuditReader().createQuery().forEntitiesAtRevision(ChildEntity.class, 1).getSingleResult()
.equals(childVer1);
assert getVersionsReader().createQuery().forEntitiesAtRevision(ParentEntity.class, 1).getSingleResult()
assert getAuditReader().createQuery().forEntitiesAtRevision(ParentEntity.class, 1).getSingleResult()
.equals(childVer1);
}
}

View File

@ -63,13 +63,13 @@ public class ParentVersioning extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ParentEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ParentEntity.class, id1));
}
@Test
public void testHistoryOfChildId1() {
assert getVersionsReader().find(ChildEntity.class, id1, 1) == null;
assert getVersionsReader().find(ChildEntity.class, id1, 2) == null;
assert getAuditReader().find(ChildEntity.class, id1, 1) == null;
assert getAuditReader().find(ChildEntity.class, id1, 2) == null;
}
@Test
@ -77,17 +77,17 @@ public class ParentVersioning extends AbstractEntityTest {
ParentEntity ver1 = new ParentEntity(id1, "x");
ParentEntity ver2 = new ParentEntity(id1, "y");
assert getVersionsReader().find(ParentEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(ParentEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(ParentEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(ParentEntity.class, id1, 2).equals(ver2);
}
@Test
public void testPolymorphicQuery() {
ParentEntity parentVer1 = new ParentEntity(id1, "x");
assert getVersionsReader().createQuery().forEntitiesAtRevision(ParentEntity.class, 1).getSingleResult()
assert getAuditReader().createQuery().forEntitiesAtRevision(ParentEntity.class, 1).getSingleResult()
.equals(parentVer1);
assert getVersionsReader().createQuery().forEntitiesAtRevision(ChildEntity.class, 1)
assert getAuditReader().createQuery().forEntitiesAtRevision(ChildEntity.class, 1)
.getResultList().size() == 0;
}
}

View File

@ -89,33 +89,33 @@ public class ChildReferencing extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(ReferencedEntity.class, re_id1));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(ReferencedEntity.class, re_id2));
assert Arrays.asList(2, 3).equals(getVersionsReader().getRevisions(ChildIngEntity.class, c_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(ReferencedEntity.class, re_id1));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(ReferencedEntity.class, re_id2));
assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(ChildIngEntity.class, c_id));
}
@Test
public void testHistoryOfReferencedCollection1() {
assert getVersionsReader().find(ReferencedEntity.class, re_id1, 1).getReferencing().size() == 0;
assert getVersionsReader().find(ReferencedEntity.class, re_id1, 2).getReferencing().equals(
assert getAuditReader().find(ReferencedEntity.class, re_id1, 1).getReferencing().size() == 0;
assert getAuditReader().find(ReferencedEntity.class, re_id1, 2).getReferencing().equals(
TestTools.makeSet(new ChildIngEntity(c_id, "y", 1l)));
assert getVersionsReader().find(ReferencedEntity.class, re_id1, 3).getReferencing().size() == 0;
assert getAuditReader().find(ReferencedEntity.class, re_id1, 3).getReferencing().size() == 0;
}
@Test
public void testHistoryOfReferencedCollection2() {
assert getVersionsReader().find(ReferencedEntity.class, re_id2, 1).getReferencing().size() == 0;
assert getVersionsReader().find(ReferencedEntity.class, re_id2, 2).getReferencing().size() == 0;
assert getVersionsReader().find(ReferencedEntity.class, re_id2, 3).getReferencing().equals(
assert getAuditReader().find(ReferencedEntity.class, re_id2, 1).getReferencing().size() == 0;
assert getAuditReader().find(ReferencedEntity.class, re_id2, 2).getReferencing().size() == 0;
assert getAuditReader().find(ReferencedEntity.class, re_id2, 3).getReferencing().equals(
TestTools.makeSet(new ChildIngEntity(c_id, "y", 1l)));
}
@Test
public void testChildHistory() {
assert getVersionsReader().find(ChildIngEntity.class, c_id, 1) == null;
assert getVersionsReader().find(ChildIngEntity.class, c_id, 2).getReferenced().equals(
assert getAuditReader().find(ChildIngEntity.class, c_id, 1) == null;
assert getAuditReader().find(ChildIngEntity.class, c_id, 2).getReferenced().equals(
new ReferencedEntity(re_id1));
assert getVersionsReader().find(ChildIngEntity.class, c_id, 3).getReferenced().equals(
assert getAuditReader().find(ChildIngEntity.class, c_id, 3).getReferenced().equals(
new ReferencedEntity(re_id2));
}
}

View File

@ -87,17 +87,17 @@ public class PolymorphicCollection extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(ReferencedEntity.class, ed_id1));
assert Arrays.asList(2).equals(getVersionsReader().getRevisions(ParentIngEntity.class, p_id));
assert Arrays.asList(3).equals(getVersionsReader().getRevisions(ChildIngEntity.class, c_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(ReferencedEntity.class, ed_id1));
assert Arrays.asList(2).equals(getAuditReader().getRevisions(ParentIngEntity.class, p_id));
assert Arrays.asList(3).equals(getAuditReader().getRevisions(ChildIngEntity.class, c_id));
}
@Test
public void testHistoryOfReferencedCollection() {
assert getVersionsReader().find(ReferencedEntity.class, ed_id1, 1).getReferencing().size() == 0;
assert getVersionsReader().find(ReferencedEntity.class, ed_id1, 2).getReferencing().equals(
assert getAuditReader().find(ReferencedEntity.class, ed_id1, 1).getReferencing().size() == 0;
assert getAuditReader().find(ReferencedEntity.class, ed_id1, 2).getReferencing().equals(
TestTools.makeSet(new ParentIngEntity(p_id, "x")));
assert getVersionsReader().find(ReferencedEntity.class, ed_id1, 3).getReferencing().equals(
assert getAuditReader().find(ReferencedEntity.class, ed_id1, 3).getReferencing().equals(
TestTools.makeSet(new ParentIngEntity(p_id, "x"), new ChildIngEntity(c_id, "y", 1l)));
}
}

View File

@ -132,11 +132,11 @@ public class BasicList extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 4).equals(getVersionsReader().getRevisions(ListOwnedEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3, 5).equals(getVersionsReader().getRevisions(ListOwnedEntity.class, ed2_id));
assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(ListOwnedEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3, 5).equals(getAuditReader().getRevisions(ListOwnedEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3, 4, 5).equals(getVersionsReader().getRevisions(ListOwningEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ListOwningEntity.class, ing2_id));
assert Arrays.asList(1, 2, 3, 4, 5).equals(getAuditReader().getRevisions(ListOwningEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ListOwningEntity.class, ing2_id));
}
@Test
@ -144,11 +144,11 @@ public class BasicList extends AbstractEntityTest {
ListOwningEntity ing1 = getEntityManager().find(ListOwningEntity.class, ing1_id);
ListOwningEntity ing2 = getEntityManager().find(ListOwningEntity.class, ing2_id);
ListOwnedEntity rev1 = getVersionsReader().find(ListOwnedEntity.class, ed1_id, 1);
ListOwnedEntity rev2 = getVersionsReader().find(ListOwnedEntity.class, ed1_id, 2);
ListOwnedEntity rev3 = getVersionsReader().find(ListOwnedEntity.class, ed1_id, 3);
ListOwnedEntity rev4 = getVersionsReader().find(ListOwnedEntity.class, ed1_id, 4);
ListOwnedEntity rev5 = getVersionsReader().find(ListOwnedEntity.class, ed1_id, 5);
ListOwnedEntity rev1 = getAuditReader().find(ListOwnedEntity.class, ed1_id, 1);
ListOwnedEntity rev2 = getAuditReader().find(ListOwnedEntity.class, ed1_id, 2);
ListOwnedEntity rev3 = getAuditReader().find(ListOwnedEntity.class, ed1_id, 3);
ListOwnedEntity rev4 = getAuditReader().find(ListOwnedEntity.class, ed1_id, 4);
ListOwnedEntity rev5 = getAuditReader().find(ListOwnedEntity.class, ed1_id, 5);
assert rev1.getReferencing().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferencing(), ing1, ing2);
@ -162,11 +162,11 @@ public class BasicList extends AbstractEntityTest {
ListOwningEntity ing1 = getEntityManager().find(ListOwningEntity.class, ing1_id);
ListOwningEntity ing2 = getEntityManager().find(ListOwningEntity.class, ing2_id);
ListOwnedEntity rev1 = getVersionsReader().find(ListOwnedEntity.class, ed2_id, 1);
ListOwnedEntity rev2 = getVersionsReader().find(ListOwnedEntity.class, ed2_id, 2);
ListOwnedEntity rev3 = getVersionsReader().find(ListOwnedEntity.class, ed2_id, 3);
ListOwnedEntity rev4 = getVersionsReader().find(ListOwnedEntity.class, ed2_id, 4);
ListOwnedEntity rev5 = getVersionsReader().find(ListOwnedEntity.class, ed2_id, 5);
ListOwnedEntity rev1 = getAuditReader().find(ListOwnedEntity.class, ed2_id, 1);
ListOwnedEntity rev2 = getAuditReader().find(ListOwnedEntity.class, ed2_id, 2);
ListOwnedEntity rev3 = getAuditReader().find(ListOwnedEntity.class, ed2_id, 3);
ListOwnedEntity rev4 = getAuditReader().find(ListOwnedEntity.class, ed2_id, 4);
ListOwnedEntity rev5 = getAuditReader().find(ListOwnedEntity.class, ed2_id, 5);
assert rev1.getReferencing().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferencing(), ing2);
@ -180,11 +180,11 @@ public class BasicList extends AbstractEntityTest {
ListOwnedEntity ed1 = getEntityManager().find(ListOwnedEntity.class, ed1_id);
ListOwnedEntity ed2 = getEntityManager().find(ListOwnedEntity.class, ed2_id);
ListOwningEntity rev1 = getVersionsReader().find(ListOwningEntity.class, ing1_id, 1);
ListOwningEntity rev2 = getVersionsReader().find(ListOwningEntity.class, ing1_id, 2);
ListOwningEntity rev3 = getVersionsReader().find(ListOwningEntity.class, ing1_id, 3);
ListOwningEntity rev4 = getVersionsReader().find(ListOwningEntity.class, ing1_id, 4);
ListOwningEntity rev5 = getVersionsReader().find(ListOwningEntity.class, ing1_id, 5);
ListOwningEntity rev1 = getAuditReader().find(ListOwningEntity.class, ing1_id, 1);
ListOwningEntity rev2 = getAuditReader().find(ListOwningEntity.class, ing1_id, 2);
ListOwningEntity rev3 = getAuditReader().find(ListOwningEntity.class, ing1_id, 3);
ListOwningEntity rev4 = getAuditReader().find(ListOwningEntity.class, ing1_id, 4);
ListOwningEntity rev5 = getAuditReader().find(ListOwningEntity.class, ing1_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferences(), ed1);
@ -198,11 +198,11 @@ public class BasicList extends AbstractEntityTest {
ListOwnedEntity ed1 = getEntityManager().find(ListOwnedEntity.class, ed1_id);
ListOwnedEntity ed2 = getEntityManager().find(ListOwnedEntity.class, ed2_id);
ListOwningEntity rev1 = getVersionsReader().find(ListOwningEntity.class, ing2_id, 1);
ListOwningEntity rev2 = getVersionsReader().find(ListOwningEntity.class, ing2_id, 2);
ListOwningEntity rev3 = getVersionsReader().find(ListOwningEntity.class, ing2_id, 3);
ListOwningEntity rev4 = getVersionsReader().find(ListOwningEntity.class, ing2_id, 4);
ListOwningEntity rev5 = getVersionsReader().find(ListOwningEntity.class, ing2_id, 5);
ListOwningEntity rev1 = getAuditReader().find(ListOwningEntity.class, ing2_id, 1);
ListOwningEntity rev2 = getAuditReader().find(ListOwningEntity.class, ing2_id, 2);
ListOwningEntity rev3 = getAuditReader().find(ListOwningEntity.class, ing2_id, 3);
ListOwningEntity rev4 = getAuditReader().find(ListOwningEntity.class, ing2_id, 4);
ListOwningEntity rev5 = getAuditReader().find(ListOwningEntity.class, ing2_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferences(), ed1, ed2);

View File

@ -124,11 +124,11 @@ public class BasicMap extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(MapOwnedEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(MapOwnedEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(MapOwnedEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(MapOwnedEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(MapOwningEntity.class, ing1_id));
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(MapOwningEntity.class, ing2_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(MapOwningEntity.class, ing1_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(MapOwningEntity.class, ing2_id));
}
@Test
@ -136,9 +136,9 @@ public class BasicMap extends AbstractEntityTest {
MapOwningEntity ing1 = getEntityManager().find(MapOwningEntity.class, ing1_id);
MapOwningEntity ing2 = getEntityManager().find(MapOwningEntity.class, ing2_id);
MapOwnedEntity rev1 = getVersionsReader().find(MapOwnedEntity.class, ed1_id, 1);
MapOwnedEntity rev2 = getVersionsReader().find(MapOwnedEntity.class, ed1_id, 2);
MapOwnedEntity rev3 = getVersionsReader().find(MapOwnedEntity.class, ed1_id, 3);
MapOwnedEntity rev1 = getAuditReader().find(MapOwnedEntity.class, ed1_id, 1);
MapOwnedEntity rev2 = getAuditReader().find(MapOwnedEntity.class, ed1_id, 2);
MapOwnedEntity rev3 = getAuditReader().find(MapOwnedEntity.class, ed1_id, 3);
assert rev1.getReferencing().equals(Collections.EMPTY_SET);
assert rev2.getReferencing().equals(TestTools.makeSet(ing1, ing2));
@ -149,9 +149,9 @@ public class BasicMap extends AbstractEntityTest {
public void testHistoryOfEdId2() {
MapOwningEntity ing2 = getEntityManager().find(MapOwningEntity.class, ing2_id);
MapOwnedEntity rev1 = getVersionsReader().find(MapOwnedEntity.class, ed2_id, 1);
MapOwnedEntity rev2 = getVersionsReader().find(MapOwnedEntity.class, ed2_id, 2);
MapOwnedEntity rev3 = getVersionsReader().find(MapOwnedEntity.class, ed2_id, 3);
MapOwnedEntity rev1 = getAuditReader().find(MapOwnedEntity.class, ed2_id, 1);
MapOwnedEntity rev2 = getAuditReader().find(MapOwnedEntity.class, ed2_id, 2);
MapOwnedEntity rev3 = getAuditReader().find(MapOwnedEntity.class, ed2_id, 3);
assert rev1.getReferencing().equals(TestTools.makeSet(ing2));
assert rev2.getReferencing().equals(Collections.EMPTY_SET);
@ -162,9 +162,9 @@ public class BasicMap extends AbstractEntityTest {
public void testHistoryOfEdIng1() {
MapOwnedEntity ed1 = getEntityManager().find(MapOwnedEntity.class, ed1_id);
MapOwningEntity rev1 = getVersionsReader().find(MapOwningEntity.class, ing1_id, 1);
MapOwningEntity rev2 = getVersionsReader().find(MapOwningEntity.class, ing1_id, 2);
MapOwningEntity rev3 = getVersionsReader().find(MapOwningEntity.class, ing1_id, 3);
MapOwningEntity rev1 = getAuditReader().find(MapOwningEntity.class, ing1_id, 1);
MapOwningEntity rev2 = getAuditReader().find(MapOwningEntity.class, ing1_id, 2);
MapOwningEntity rev3 = getAuditReader().find(MapOwningEntity.class, ing1_id, 3);
assert rev1.getReferences().equals(Collections.EMPTY_MAP);
assert rev2.getReferences().equals(TestTools.makeMap("1", ed1, "2", ed1));
@ -176,9 +176,9 @@ public class BasicMap extends AbstractEntityTest {
MapOwnedEntity ed1 = getEntityManager().find(MapOwnedEntity.class, ed1_id);
MapOwnedEntity ed2 = getEntityManager().find(MapOwnedEntity.class, ed2_id);
MapOwningEntity rev1 = getVersionsReader().find(MapOwningEntity.class, ing2_id, 1);
MapOwningEntity rev2 = getVersionsReader().find(MapOwningEntity.class, ing2_id, 2);
MapOwningEntity rev3 = getVersionsReader().find(MapOwningEntity.class, ing2_id, 3);
MapOwningEntity rev1 = getAuditReader().find(MapOwningEntity.class, ing2_id, 1);
MapOwningEntity rev2 = getAuditReader().find(MapOwningEntity.class, ing2_id, 2);
MapOwningEntity rev3 = getAuditReader().find(MapOwningEntity.class, ing2_id, 3);
assert rev1.getReferences().equals(TestTools.makeMap("2", ed2));
assert rev2.getReferences().equals(TestTools.makeMap("2", ed1));

View File

@ -132,11 +132,11 @@ public class BasicSet extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 4).equals(getVersionsReader().getRevisions(SetOwnedEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3, 5).equals(getVersionsReader().getRevisions(SetOwnedEntity.class, ed2_id));
assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(SetOwnedEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3, 5).equals(getAuditReader().getRevisions(SetOwnedEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3, 4, 5).equals(getVersionsReader().getRevisions(SetOwningEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetOwningEntity.class, ing2_id));
assert Arrays.asList(1, 2, 3, 4, 5).equals(getAuditReader().getRevisions(SetOwningEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetOwningEntity.class, ing2_id));
}
@Test
@ -144,11 +144,11 @@ public class BasicSet extends AbstractEntityTest {
SetOwningEntity ing1 = getEntityManager().find(SetOwningEntity.class, ing1_id);
SetOwningEntity ing2 = getEntityManager().find(SetOwningEntity.class, ing2_id);
SetOwnedEntity rev1 = getVersionsReader().find(SetOwnedEntity.class, ed1_id, 1);
SetOwnedEntity rev2 = getVersionsReader().find(SetOwnedEntity.class, ed1_id, 2);
SetOwnedEntity rev3 = getVersionsReader().find(SetOwnedEntity.class, ed1_id, 3);
SetOwnedEntity rev4 = getVersionsReader().find(SetOwnedEntity.class, ed1_id, 4);
SetOwnedEntity rev5 = getVersionsReader().find(SetOwnedEntity.class, ed1_id, 5);
SetOwnedEntity rev1 = getAuditReader().find(SetOwnedEntity.class, ed1_id, 1);
SetOwnedEntity rev2 = getAuditReader().find(SetOwnedEntity.class, ed1_id, 2);
SetOwnedEntity rev3 = getAuditReader().find(SetOwnedEntity.class, ed1_id, 3);
SetOwnedEntity rev4 = getAuditReader().find(SetOwnedEntity.class, ed1_id, 4);
SetOwnedEntity rev5 = getAuditReader().find(SetOwnedEntity.class, ed1_id, 5);
assert rev1.getReferencing().equals(Collections.EMPTY_SET);
assert rev2.getReferencing().equals(TestTools.makeSet(ing1, ing2));
@ -162,11 +162,11 @@ public class BasicSet extends AbstractEntityTest {
SetOwningEntity ing1 = getEntityManager().find(SetOwningEntity.class, ing1_id);
SetOwningEntity ing2 = getEntityManager().find(SetOwningEntity.class, ing2_id);
SetOwnedEntity rev1 = getVersionsReader().find(SetOwnedEntity.class, ed2_id, 1);
SetOwnedEntity rev2 = getVersionsReader().find(SetOwnedEntity.class, ed2_id, 2);
SetOwnedEntity rev3 = getVersionsReader().find(SetOwnedEntity.class, ed2_id, 3);
SetOwnedEntity rev4 = getVersionsReader().find(SetOwnedEntity.class, ed2_id, 4);
SetOwnedEntity rev5 = getVersionsReader().find(SetOwnedEntity.class, ed2_id, 5);
SetOwnedEntity rev1 = getAuditReader().find(SetOwnedEntity.class, ed2_id, 1);
SetOwnedEntity rev2 = getAuditReader().find(SetOwnedEntity.class, ed2_id, 2);
SetOwnedEntity rev3 = getAuditReader().find(SetOwnedEntity.class, ed2_id, 3);
SetOwnedEntity rev4 = getAuditReader().find(SetOwnedEntity.class, ed2_id, 4);
SetOwnedEntity rev5 = getAuditReader().find(SetOwnedEntity.class, ed2_id, 5);
assert rev1.getReferencing().equals(Collections.EMPTY_SET);
assert rev2.getReferencing().equals(TestTools.makeSet(ing2));
@ -180,11 +180,11 @@ public class BasicSet extends AbstractEntityTest {
SetOwnedEntity ed1 = getEntityManager().find(SetOwnedEntity.class, ed1_id);
SetOwnedEntity ed2 = getEntityManager().find(SetOwnedEntity.class, ed2_id);
SetOwningEntity rev1 = getVersionsReader().find(SetOwningEntity.class, ing1_id, 1);
SetOwningEntity rev2 = getVersionsReader().find(SetOwningEntity.class, ing1_id, 2);
SetOwningEntity rev3 = getVersionsReader().find(SetOwningEntity.class, ing1_id, 3);
SetOwningEntity rev4 = getVersionsReader().find(SetOwningEntity.class, ing1_id, 4);
SetOwningEntity rev5 = getVersionsReader().find(SetOwningEntity.class, ing1_id, 5);
SetOwningEntity rev1 = getAuditReader().find(SetOwningEntity.class, ing1_id, 1);
SetOwningEntity rev2 = getAuditReader().find(SetOwningEntity.class, ing1_id, 2);
SetOwningEntity rev3 = getAuditReader().find(SetOwningEntity.class, ing1_id, 3);
SetOwningEntity rev4 = getAuditReader().find(SetOwningEntity.class, ing1_id, 4);
SetOwningEntity rev5 = getAuditReader().find(SetOwningEntity.class, ing1_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_SET);
assert rev2.getReferences().equals(TestTools.makeSet(ed1));
@ -198,11 +198,11 @@ public class BasicSet extends AbstractEntityTest {
SetOwnedEntity ed1 = getEntityManager().find(SetOwnedEntity.class, ed1_id);
SetOwnedEntity ed2 = getEntityManager().find(SetOwnedEntity.class, ed2_id);
SetOwningEntity rev1 = getVersionsReader().find(SetOwningEntity.class, ing2_id, 1);
SetOwningEntity rev2 = getVersionsReader().find(SetOwningEntity.class, ing2_id, 2);
SetOwningEntity rev3 = getVersionsReader().find(SetOwningEntity.class, ing2_id, 3);
SetOwningEntity rev4 = getVersionsReader().find(SetOwningEntity.class, ing2_id, 4);
SetOwningEntity rev5 = getVersionsReader().find(SetOwningEntity.class, ing2_id, 5);
SetOwningEntity rev1 = getAuditReader().find(SetOwningEntity.class, ing2_id, 1);
SetOwningEntity rev2 = getAuditReader().find(SetOwningEntity.class, ing2_id, 2);
SetOwningEntity rev3 = getAuditReader().find(SetOwningEntity.class, ing2_id, 3);
SetOwningEntity rev4 = getAuditReader().find(SetOwningEntity.class, ing2_id, 4);
SetOwningEntity rev5 = getAuditReader().find(SetOwningEntity.class, ing2_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_SET);
assert rev2.getReferences().equals(TestTools.makeSet(ed1, ed2));

View File

@ -150,14 +150,14 @@ public class TernaryMap extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 4).equals(getVersionsReader().getRevisions(TernaryMapEntity.class, map1_id));
assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(TernaryMapEntity.class, map2_id));
assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(TernaryMapEntity.class, map1_id));
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(TernaryMapEntity.class, map2_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(IntTestEntity.class, int1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(IntTestEntity.class, int2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(IntTestEntity.class, int1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(IntTestEntity.class, int2_id));
}
@Test
@ -168,10 +168,10 @@ public class TernaryMap extends AbstractEntityTest {
IntTestEntity int1 = getEntityManager().find(IntTestEntity.class, int1_id);
IntTestEntity int2 = getEntityManager().find(IntTestEntity.class, int2_id);
TernaryMapEntity rev1 = getVersionsReader().find(TernaryMapEntity.class, map1_id, 1);
TernaryMapEntity rev2 = getVersionsReader().find(TernaryMapEntity.class, map1_id, 2);
TernaryMapEntity rev3 = getVersionsReader().find(TernaryMapEntity.class, map1_id, 3);
TernaryMapEntity rev4 = getVersionsReader().find(TernaryMapEntity.class, map1_id, 4);
TernaryMapEntity rev1 = getAuditReader().find(TernaryMapEntity.class, map1_id, 1);
TernaryMapEntity rev2 = getAuditReader().find(TernaryMapEntity.class, map1_id, 2);
TernaryMapEntity rev3 = getAuditReader().find(TernaryMapEntity.class, map1_id, 3);
TernaryMapEntity rev4 = getAuditReader().find(TernaryMapEntity.class, map1_id, 4);
assert rev1.getMap().equals(TestTools.makeMap(int1, str1));
assert rev2.getMap().equals(TestTools.makeMap(int1, str2));
@ -187,10 +187,10 @@ public class TernaryMap extends AbstractEntityTest {
IntTestEntity int1 = getEntityManager().find(IntTestEntity.class, int1_id);
IntTestEntity int2 = getEntityManager().find(IntTestEntity.class, int2_id);
TernaryMapEntity rev1 = getVersionsReader().find(TernaryMapEntity.class, map2_id, 1);
TernaryMapEntity rev2 = getVersionsReader().find(TernaryMapEntity.class, map2_id, 2);
TernaryMapEntity rev3 = getVersionsReader().find(TernaryMapEntity.class, map2_id, 3);
TernaryMapEntity rev4 = getVersionsReader().find(TernaryMapEntity.class, map2_id, 4);
TernaryMapEntity rev1 = getAuditReader().find(TernaryMapEntity.class, map2_id, 1);
TernaryMapEntity rev2 = getAuditReader().find(TernaryMapEntity.class, map2_id, 2);
TernaryMapEntity rev3 = getAuditReader().find(TernaryMapEntity.class, map2_id, 3);
TernaryMapEntity rev4 = getAuditReader().find(TernaryMapEntity.class, map2_id, 4);
assert rev1.getMap().equals(TestTools.makeMap());
assert rev2.getMap().equals(TestTools.makeMap(int1, str1, int2, str1));

View File

@ -132,11 +132,11 @@ public class BasicUniList extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, ed1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, ed2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, ed1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3, 4, 5).equals(getVersionsReader().getRevisions(ListUniEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ListUniEntity.class, ing2_id));
assert Arrays.asList(1, 2, 3, 4, 5).equals(getAuditReader().getRevisions(ListUniEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ListUniEntity.class, ing2_id));
}
@Test
@ -144,11 +144,11 @@ public class BasicUniList extends AbstractEntityTest {
StrTestEntity ed1 = getEntityManager().find(StrTestEntity.class, ed1_id);
StrTestEntity ed2 = getEntityManager().find(StrTestEntity.class, ed2_id);
ListUniEntity rev1 = getVersionsReader().find(ListUniEntity.class, ing1_id, 1);
ListUniEntity rev2 = getVersionsReader().find(ListUniEntity.class, ing1_id, 2);
ListUniEntity rev3 = getVersionsReader().find(ListUniEntity.class, ing1_id, 3);
ListUniEntity rev4 = getVersionsReader().find(ListUniEntity.class, ing1_id, 4);
ListUniEntity rev5 = getVersionsReader().find(ListUniEntity.class, ing1_id, 5);
ListUniEntity rev1 = getAuditReader().find(ListUniEntity.class, ing1_id, 1);
ListUniEntity rev2 = getAuditReader().find(ListUniEntity.class, ing1_id, 2);
ListUniEntity rev3 = getAuditReader().find(ListUniEntity.class, ing1_id, 3);
ListUniEntity rev4 = getAuditReader().find(ListUniEntity.class, ing1_id, 4);
ListUniEntity rev5 = getAuditReader().find(ListUniEntity.class, ing1_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferences(), ed1);
@ -162,11 +162,11 @@ public class BasicUniList extends AbstractEntityTest {
StrTestEntity ed1 = getEntityManager().find(StrTestEntity.class, ed1_id);
StrTestEntity ed2 = getEntityManager().find(StrTestEntity.class, ed2_id);
ListUniEntity rev1 = getVersionsReader().find(ListUniEntity.class, ing2_id, 1);
ListUniEntity rev2 = getVersionsReader().find(ListUniEntity.class, ing2_id, 2);
ListUniEntity rev3 = getVersionsReader().find(ListUniEntity.class, ing2_id, 3);
ListUniEntity rev4 = getVersionsReader().find(ListUniEntity.class, ing2_id, 4);
ListUniEntity rev5 = getVersionsReader().find(ListUniEntity.class, ing2_id, 5);
ListUniEntity rev1 = getAuditReader().find(ListUniEntity.class, ing2_id, 1);
ListUniEntity rev2 = getAuditReader().find(ListUniEntity.class, ing2_id, 2);
ListUniEntity rev3 = getAuditReader().find(ListUniEntity.class, ing2_id, 3);
ListUniEntity rev4 = getAuditReader().find(ListUniEntity.class, ing2_id, 4);
ListUniEntity rev5 = getAuditReader().find(ListUniEntity.class, ing2_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferences(), ed1, ed2);

View File

@ -110,10 +110,10 @@ public class BasicUniMap extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(MapUniEntity.class, coll1_id));
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(MapUniEntity.class, coll1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
}
@Test
@ -121,10 +121,10 @@ public class BasicUniMap extends AbstractEntityTest {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
MapUniEntity rev1 = getVersionsReader().find(MapUniEntity.class, coll1_id, 1);
MapUniEntity rev2 = getVersionsReader().find(MapUniEntity.class, coll1_id, 2);
MapUniEntity rev3 = getVersionsReader().find(MapUniEntity.class, coll1_id, 3);
MapUniEntity rev4 = getVersionsReader().find(MapUniEntity.class, coll1_id, 4);
MapUniEntity rev1 = getAuditReader().find(MapUniEntity.class, coll1_id, 1);
MapUniEntity rev2 = getAuditReader().find(MapUniEntity.class, coll1_id, 2);
MapUniEntity rev3 = getAuditReader().find(MapUniEntity.class, coll1_id, 3);
MapUniEntity rev4 = getAuditReader().find(MapUniEntity.class, coll1_id, 4);
assert rev1.getMap().equals(TestTools.makeMap("1", str1));
assert rev2.getMap().equals(TestTools.makeMap("1", str1, "2", str2));

View File

@ -132,11 +132,11 @@ public class BasicUniSet extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, ed1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, ed2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, ed1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3, 4, 5).equals(getVersionsReader().getRevisions(SetUniEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetUniEntity.class, ing2_id));
assert Arrays.asList(1, 2, 3, 4, 5).equals(getAuditReader().getRevisions(SetUniEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetUniEntity.class, ing2_id));
}
@Test
@ -144,11 +144,11 @@ public class BasicUniSet extends AbstractEntityTest {
StrTestEntity ed1 = getEntityManager().find(StrTestEntity.class, ed1_id);
StrTestEntity ed2 = getEntityManager().find(StrTestEntity.class, ed2_id);
SetUniEntity rev1 = getVersionsReader().find(SetUniEntity.class, ing1_id, 1);
SetUniEntity rev2 = getVersionsReader().find(SetUniEntity.class, ing1_id, 2);
SetUniEntity rev3 = getVersionsReader().find(SetUniEntity.class, ing1_id, 3);
SetUniEntity rev4 = getVersionsReader().find(SetUniEntity.class, ing1_id, 4);
SetUniEntity rev5 = getVersionsReader().find(SetUniEntity.class, ing1_id, 5);
SetUniEntity rev1 = getAuditReader().find(SetUniEntity.class, ing1_id, 1);
SetUniEntity rev2 = getAuditReader().find(SetUniEntity.class, ing1_id, 2);
SetUniEntity rev3 = getAuditReader().find(SetUniEntity.class, ing1_id, 3);
SetUniEntity rev4 = getAuditReader().find(SetUniEntity.class, ing1_id, 4);
SetUniEntity rev5 = getAuditReader().find(SetUniEntity.class, ing1_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_SET);
assert rev2.getReferences().equals(TestTools.makeSet(ed1));
@ -162,11 +162,11 @@ public class BasicUniSet extends AbstractEntityTest {
StrTestEntity ed1 = getEntityManager().find(StrTestEntity.class, ed1_id);
StrTestEntity ed2 = getEntityManager().find(StrTestEntity.class, ed2_id);
SetUniEntity rev1 = getVersionsReader().find(SetUniEntity.class, ing2_id, 1);
SetUniEntity rev2 = getVersionsReader().find(SetUniEntity.class, ing2_id, 2);
SetUniEntity rev3 = getVersionsReader().find(SetUniEntity.class, ing2_id, 3);
SetUniEntity rev4 = getVersionsReader().find(SetUniEntity.class, ing2_id, 4);
SetUniEntity rev5 = getVersionsReader().find(SetUniEntity.class, ing2_id, 5);
SetUniEntity rev1 = getAuditReader().find(SetUniEntity.class, ing2_id, 1);
SetUniEntity rev2 = getAuditReader().find(SetUniEntity.class, ing2_id, 2);
SetUniEntity rev3 = getAuditReader().find(SetUniEntity.class, ing2_id, 3);
SetUniEntity rev4 = getAuditReader().find(SetUniEntity.class, ing2_id, 4);
SetUniEntity rev5 = getAuditReader().find(SetUniEntity.class, ing2_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_SET);
assert rev2.getReferences().equals(TestTools.makeSet(ed1, ed2));

View File

@ -81,9 +81,9 @@ public class BasicNaming extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(NamingTestEntity1.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(NamingTestEntity1.class, id1));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(NamingTestEntity1.class, id2));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(NamingTestEntity1.class, id2));
}
@Test
@ -91,9 +91,9 @@ public class BasicNaming extends AbstractEntityTest {
NamingTestEntity1 ver1 = new NamingTestEntity1(id1, "data1");
NamingTestEntity1 ver2 = new NamingTestEntity1(id1, "data1'");
assert getVersionsReader().find(NamingTestEntity1.class, id1, 1).equals(ver1);
assert getVersionsReader().find(NamingTestEntity1.class, id1, 2).equals(ver2);
assert getVersionsReader().find(NamingTestEntity1.class, id1, 3).equals(ver2);
assert getAuditReader().find(NamingTestEntity1.class, id1, 1).equals(ver1);
assert getAuditReader().find(NamingTestEntity1.class, id1, 2).equals(ver2);
assert getAuditReader().find(NamingTestEntity1.class, id1, 3).equals(ver2);
}
@Test
@ -101,9 +101,9 @@ public class BasicNaming extends AbstractEntityTest {
NamingTestEntity1 ver1 = new NamingTestEntity1(id2, "data2");
NamingTestEntity1 ver2 = new NamingTestEntity1(id2, "data2'");
assert getVersionsReader().find(NamingTestEntity1.class, id2, 1).equals(ver1);
assert getVersionsReader().find(NamingTestEntity1.class, id2, 2).equals(ver1);
assert getVersionsReader().find(NamingTestEntity1.class, id2, 3).equals(ver2);
assert getAuditReader().find(NamingTestEntity1.class, id2, 1).equals(ver1);
assert getAuditReader().find(NamingTestEntity1.class, id2, 2).equals(ver1);
assert getAuditReader().find(NamingTestEntity1.class, id2, 3).equals(ver2);
}
@Test

View File

@ -84,25 +84,25 @@ public class JoinNaming extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinNamingRefEdEntity.class, ed_id1));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinNamingRefEdEntity.class, ed_id2));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinNamingRefIngEntity.class, ing_id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinNamingRefEdEntity.class, ed_id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinNamingRefEdEntity.class, ed_id2));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinNamingRefIngEntity.class, ing_id1));
}
@Test
public void testHistoryOfEdId1() {
JoinNamingRefEdEntity ver1 = new JoinNamingRefEdEntity(ed_id1, "data1");
assert getVersionsReader().find(JoinNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
assert getVersionsReader().find(JoinNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
assert getAuditReader().find(JoinNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
assert getAuditReader().find(JoinNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
}
@Test
public void testHistoryOfEdId2() {
JoinNamingRefEdEntity ver1 = new JoinNamingRefEdEntity(ed_id2, "data2");
assert getVersionsReader().find(JoinNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
assert getVersionsReader().find(JoinNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
assert getAuditReader().find(JoinNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
assert getAuditReader().find(JoinNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
}
@Test
@ -110,12 +110,12 @@ public class JoinNaming extends AbstractEntityTest {
JoinNamingRefIngEntity ver1 = new JoinNamingRefIngEntity(ing_id1, "x", null);
JoinNamingRefIngEntity ver2 = new JoinNamingRefIngEntity(ing_id1, "y", null);
assert getVersionsReader().find(JoinNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
assert getVersionsReader().find(JoinNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
assert getAuditReader().find(JoinNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
assert getAuditReader().find(JoinNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
assert getVersionsReader().find(JoinNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
assert getAuditReader().find(JoinNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
new JoinNamingRefEdEntity(ed_id1, "data1"));
assert getVersionsReader().find(JoinNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
assert getAuditReader().find(JoinNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
new JoinNamingRefEdEntity(ed_id2, "data2"));
}

View File

@ -81,16 +81,16 @@ public class OneToManyUnidirectionalNaming extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(DetachedNamingTestEntity.class, uni1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(DetachedNamingTestEntity.class, uni1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
}
@Test
public void testHistoryOfUniId1() {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
DetachedNamingTestEntity rev1 = getVersionsReader().find(DetachedNamingTestEntity.class, uni1_id, 1);
DetachedNamingTestEntity rev2 = getVersionsReader().find(DetachedNamingTestEntity.class, uni1_id, 2);
DetachedNamingTestEntity rev1 = getAuditReader().find(DetachedNamingTestEntity.class, uni1_id, 1);
DetachedNamingTestEntity rev2 = getAuditReader().find(DetachedNamingTestEntity.class, uni1_id, 2);
assert rev1.getCollection().equals(TestTools.makeSet());
assert rev2.getCollection().equals(TestTools.makeSet(str1));

View File

@ -81,16 +81,16 @@ public class VersionsJoinTableNaming extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(VersionsJoinTableTestEntity.class, uni1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(VersionsJoinTableTestEntity.class, uni1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
}
@Test
public void testHistoryOfUniId1() {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
VersionsJoinTableTestEntity rev1 = getVersionsReader().find(VersionsJoinTableTestEntity.class, uni1_id, 1);
VersionsJoinTableTestEntity rev2 = getVersionsReader().find(VersionsJoinTableTestEntity.class, uni1_id, 2);
VersionsJoinTableTestEntity rev1 = getAuditReader().find(VersionsJoinTableTestEntity.class, uni1_id, 1);
VersionsJoinTableTestEntity rev2 = getAuditReader().find(VersionsJoinTableTestEntity.class, uni1_id, 2);
assert rev1.getCollection().equals(TestTools.makeSet());
assert rev2.getCollection().equals(TestTools.makeSet(str1));

View File

@ -82,25 +82,25 @@ public class JoinEmbIdNaming extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinEmbIdNamingRefEdEntity.class, ed_id1));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinEmbIdNamingRefEdEntity.class, ed_id2));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinEmbIdNamingRefIngEntity.class, ing_id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinEmbIdNamingRefEdEntity.class, ed_id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinEmbIdNamingRefEdEntity.class, ed_id2));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinEmbIdNamingRefIngEntity.class, ing_id1));
}
@Test
public void testHistoryOfEdId1() {
JoinEmbIdNamingRefEdEntity ver1 = new JoinEmbIdNamingRefEdEntity(ed_id1, "data1");
assert getVersionsReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
assert getVersionsReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
assert getAuditReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
assert getAuditReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
}
@Test
public void testHistoryOfEdId2() {
JoinEmbIdNamingRefEdEntity ver1 = new JoinEmbIdNamingRefEdEntity(ed_id2, "data2");
assert getVersionsReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
assert getVersionsReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
assert getAuditReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
assert getAuditReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
}
@Test
@ -108,12 +108,12 @@ public class JoinEmbIdNaming extends AbstractEntityTest {
JoinEmbIdNamingRefIngEntity ver1 = new JoinEmbIdNamingRefIngEntity(ing_id1, "x", null);
JoinEmbIdNamingRefIngEntity ver2 = new JoinEmbIdNamingRefIngEntity(ing_id1, "y", null);
assert getVersionsReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
assert getVersionsReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
assert getAuditReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
assert getAuditReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
assert getVersionsReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
assert getAuditReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
new JoinEmbIdNamingRefEdEntity(ed_id1, "data1"));
assert getVersionsReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
assert getAuditReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
new JoinEmbIdNamingRefEdEntity(ed_id2, "data2"));
}

View File

@ -82,25 +82,25 @@ public class JoinMulIdNaming extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinMulIdNamingRefEdEntity.class, ed_id1));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinMulIdNamingRefEdEntity.class, ed_id2));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinMulIdNamingRefIngEntity.class, ing_id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinMulIdNamingRefEdEntity.class, ed_id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinMulIdNamingRefEdEntity.class, ed_id2));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinMulIdNamingRefIngEntity.class, ing_id1));
}
@Test
public void testHistoryOfEdId1() {
JoinMulIdNamingRefEdEntity ver1 = new JoinMulIdNamingRefEdEntity(ed_id1, "data1");
assert getVersionsReader().find(JoinMulIdNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
assert getVersionsReader().find(JoinMulIdNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
assert getAuditReader().find(JoinMulIdNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
assert getAuditReader().find(JoinMulIdNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
}
@Test
public void testHistoryOfEdId2() {
JoinMulIdNamingRefEdEntity ver1 = new JoinMulIdNamingRefEdEntity(ed_id2, "data2");
assert getVersionsReader().find(JoinMulIdNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
assert getVersionsReader().find(JoinMulIdNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
assert getAuditReader().find(JoinMulIdNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
assert getAuditReader().find(JoinMulIdNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
}
@Test
@ -108,12 +108,12 @@ public class JoinMulIdNaming extends AbstractEntityTest {
JoinMulIdNamingRefIngEntity ver1 = new JoinMulIdNamingRefIngEntity(ing_id1, "x", null);
JoinMulIdNamingRefIngEntity ver2 = new JoinMulIdNamingRefIngEntity(ing_id1, "y", null);
assert getVersionsReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
assert getVersionsReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
assert getAuditReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
assert getAuditReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
assert getVersionsReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
assert getAuditReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
new JoinMulIdNamingRefEdEntity(ed_id1, "data1"));
assert getVersionsReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
assert getAuditReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
new JoinMulIdNamingRefEdEntity(ed_id2, "data2"));
}

View File

@ -59,7 +59,7 @@ public class NotInsertable extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(NotInsertableTestEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(NotInsertableTestEntity.class, id1));
}
@Test
@ -67,7 +67,7 @@ public class NotInsertable extends AbstractEntityTest {
NotInsertableTestEntity ver1 = new NotInsertableTestEntity(id1, "data1", "data1");
NotInsertableTestEntity ver2 = new NotInsertableTestEntity(id1, "data2", "data2");
assert getVersionsReader().find(NotInsertableTestEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(NotInsertableTestEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(NotInsertableTestEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(NotInsertableTestEntity.class, id1, 2).equals(ver2);
}
}

View File

@ -104,11 +104,11 @@ public class BasicCollection extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(CollectionRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(CollectionRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(CollectionRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(CollectionRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(CollectionRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(CollectionRefIngEntity.class, ing2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(CollectionRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(CollectionRefIngEntity.class, ing2_id));
}
private <T> Set<T> makeSet(T... objects) {
@ -123,9 +123,9 @@ public class BasicCollection extends AbstractEntityTest {
CollectionRefIngEntity ing1 = getEntityManager().find(CollectionRefIngEntity.class, ing1_id);
CollectionRefIngEntity ing2 = getEntityManager().find(CollectionRefIngEntity.class, ing2_id);
CollectionRefEdEntity rev1 = getVersionsReader().find(CollectionRefEdEntity.class, ed1_id, 1);
CollectionRefEdEntity rev2 = getVersionsReader().find(CollectionRefEdEntity.class, ed1_id, 2);
CollectionRefEdEntity rev3 = getVersionsReader().find(CollectionRefEdEntity.class, ed1_id, 3);
CollectionRefEdEntity rev1 = getAuditReader().find(CollectionRefEdEntity.class, ed1_id, 1);
CollectionRefEdEntity rev2 = getAuditReader().find(CollectionRefEdEntity.class, ed1_id, 2);
CollectionRefEdEntity rev3 = getAuditReader().find(CollectionRefEdEntity.class, ed1_id, 3);
assert rev1.getReffering().containsAll(makeSet(ing1, ing2));
assert rev1.getReffering().size() == 2;
@ -142,9 +142,9 @@ public class BasicCollection extends AbstractEntityTest {
CollectionRefIngEntity ing1 = getEntityManager().find(CollectionRefIngEntity.class, ing1_id);
CollectionRefIngEntity ing2 = getEntityManager().find(CollectionRefIngEntity.class, ing2_id);
CollectionRefEdEntity rev1 = getVersionsReader().find(CollectionRefEdEntity.class, ed2_id, 1);
CollectionRefEdEntity rev2 = getVersionsReader().find(CollectionRefEdEntity.class, ed2_id, 2);
CollectionRefEdEntity rev3 = getVersionsReader().find(CollectionRefEdEntity.class, ed2_id, 3);
CollectionRefEdEntity rev1 = getAuditReader().find(CollectionRefEdEntity.class, ed2_id, 1);
CollectionRefEdEntity rev2 = getAuditReader().find(CollectionRefEdEntity.class, ed2_id, 2);
CollectionRefEdEntity rev3 = getAuditReader().find(CollectionRefEdEntity.class, ed2_id, 3);
assert rev1.getReffering().containsAll(Collections.EMPTY_SET);
assert rev1.getReffering().size() == 0;
@ -162,9 +162,9 @@ public class BasicCollection extends AbstractEntityTest {
CollectionRefEdEntity ed1 = getEntityManager().find(CollectionRefEdEntity.class, ed1_id);
CollectionRefEdEntity ed2 = getEntityManager().find(CollectionRefEdEntity.class, ed2_id);
CollectionRefIngEntity rev1 = getVersionsReader().find(CollectionRefIngEntity.class, ing1_id, 1);
CollectionRefIngEntity rev2 = getVersionsReader().find(CollectionRefIngEntity.class, ing1_id, 2);
CollectionRefIngEntity rev3 = getVersionsReader().find(CollectionRefIngEntity.class, ing1_id, 3);
CollectionRefIngEntity rev1 = getAuditReader().find(CollectionRefIngEntity.class, ing1_id, 1);
CollectionRefIngEntity rev2 = getAuditReader().find(CollectionRefIngEntity.class, ing1_id, 2);
CollectionRefIngEntity rev3 = getAuditReader().find(CollectionRefIngEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
@ -176,9 +176,9 @@ public class BasicCollection extends AbstractEntityTest {
CollectionRefEdEntity ed1 = getEntityManager().find(CollectionRefEdEntity.class, ed1_id);
CollectionRefEdEntity ed2 = getEntityManager().find(CollectionRefEdEntity.class, ed2_id);
CollectionRefIngEntity rev1 = getVersionsReader().find(CollectionRefIngEntity.class, ing2_id, 1);
CollectionRefIngEntity rev2 = getVersionsReader().find(CollectionRefIngEntity.class, ing2_id, 2);
CollectionRefIngEntity rev3 = getVersionsReader().find(CollectionRefIngEntity.class, ing2_id, 3);
CollectionRefIngEntity rev1 = getAuditReader().find(CollectionRefIngEntity.class, ing2_id, 1);
CollectionRefIngEntity rev2 = getAuditReader().find(CollectionRefIngEntity.class, ing2_id, 2);
CollectionRefIngEntity rev3 = getAuditReader().find(CollectionRefIngEntity.class, ing2_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);

View File

@ -102,20 +102,20 @@ public class BasicList extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(ListRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(ListRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(ListRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(ListRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ListRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(ListRefIngEntity.class, ing2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ListRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(ListRefIngEntity.class, ing2_id));
}
@Test
public void testHistoryOfEdId1() {
ListRefIngEntity ing1 = getEntityManager().find(ListRefIngEntity.class, ing1_id);
ListRefIngEntity ing2 = getEntityManager().find(ListRefIngEntity.class, ing2_id);
ListRefEdEntity rev1 = getVersionsReader().find(ListRefEdEntity.class, ed1_id, 1);
ListRefEdEntity rev2 = getVersionsReader().find(ListRefEdEntity.class, ed1_id, 2);
ListRefEdEntity rev3 = getVersionsReader().find(ListRefEdEntity.class, ed1_id, 3);
ListRefEdEntity rev1 = getAuditReader().find(ListRefEdEntity.class, ed1_id, 1);
ListRefEdEntity rev2 = getAuditReader().find(ListRefEdEntity.class, ed1_id, 2);
ListRefEdEntity rev3 = getAuditReader().find(ListRefEdEntity.class, ed1_id, 3);
assert TestTools.checkList(rev1.getReffering(), ing1, ing2);
assert TestTools.checkList(rev2.getReffering(), ing2);
@ -127,9 +127,9 @@ public class BasicList extends AbstractEntityTest {
ListRefIngEntity ing1 = getEntityManager().find(ListRefIngEntity.class, ing1_id);
ListRefIngEntity ing2 = getEntityManager().find(ListRefIngEntity.class, ing2_id);
ListRefEdEntity rev1 = getVersionsReader().find(ListRefEdEntity.class, ed2_id, 1);
ListRefEdEntity rev2 = getVersionsReader().find(ListRefEdEntity.class, ed2_id, 2);
ListRefEdEntity rev3 = getVersionsReader().find(ListRefEdEntity.class, ed2_id, 3);
ListRefEdEntity rev1 = getAuditReader().find(ListRefEdEntity.class, ed2_id, 1);
ListRefEdEntity rev2 = getAuditReader().find(ListRefEdEntity.class, ed2_id, 2);
ListRefEdEntity rev3 = getAuditReader().find(ListRefEdEntity.class, ed2_id, 3);
assert TestTools.checkList(rev1.getReffering());
assert TestTools.checkList(rev2.getReffering(), ing1);
@ -141,9 +141,9 @@ public class BasicList extends AbstractEntityTest {
ListRefEdEntity ed1 = getEntityManager().find(ListRefEdEntity.class, ed1_id);
ListRefEdEntity ed2 = getEntityManager().find(ListRefEdEntity.class, ed2_id);
ListRefIngEntity rev1 = getVersionsReader().find(ListRefIngEntity.class, ing1_id, 1);
ListRefIngEntity rev2 = getVersionsReader().find(ListRefIngEntity.class, ing1_id, 2);
ListRefIngEntity rev3 = getVersionsReader().find(ListRefIngEntity.class, ing1_id, 3);
ListRefIngEntity rev1 = getAuditReader().find(ListRefIngEntity.class, ing1_id, 1);
ListRefIngEntity rev2 = getAuditReader().find(ListRefIngEntity.class, ing1_id, 2);
ListRefIngEntity rev3 = getAuditReader().find(ListRefIngEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
@ -155,9 +155,9 @@ public class BasicList extends AbstractEntityTest {
ListRefEdEntity ed1 = getEntityManager().find(ListRefEdEntity.class, ed1_id);
ListRefEdEntity ed2 = getEntityManager().find(ListRefEdEntity.class, ed2_id);
ListRefIngEntity rev1 = getVersionsReader().find(ListRefIngEntity.class, ing2_id, 1);
ListRefIngEntity rev2 = getVersionsReader().find(ListRefIngEntity.class, ing2_id, 2);
ListRefIngEntity rev3 = getVersionsReader().find(ListRefIngEntity.class, ing2_id, 3);
ListRefIngEntity rev1 = getAuditReader().find(ListRefIngEntity.class, ing2_id, 1);
ListRefIngEntity rev2 = getAuditReader().find(ListRefIngEntity.class, ing2_id, 2);
ListRefIngEntity rev3 = getAuditReader().find(ListRefIngEntity.class, ing2_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);

View File

@ -114,11 +114,11 @@ public class BasicSet extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(SetRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 3, 4).equals(getVersionsReader().getRevisions(SetRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(SetRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 3, 4).equals(getAuditReader().getRevisions(SetRefEdEntity.class, ed2_id));
assert Arrays.asList(2, 3).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing1_id));
assert Arrays.asList(2, 4).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing2_id));
assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing1_id));
assert Arrays.asList(2, 4).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing2_id));
}
@Test
@ -126,10 +126,10 @@ public class BasicSet extends AbstractEntityTest {
SetRefIngEntity ing1 = getEntityManager().find(SetRefIngEntity.class, ing1_id);
SetRefIngEntity ing2 = getEntityManager().find(SetRefIngEntity.class, ing2_id);
SetRefEdEntity rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
SetRefEdEntity rev2 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 2);
SetRefEdEntity rev3 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 3);
SetRefEdEntity rev4 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 4);
SetRefEdEntity rev1 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 1);
SetRefEdEntity rev2 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 2);
SetRefEdEntity rev3 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 3);
SetRefEdEntity rev4 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 4);
assert rev1.getReffering().equals(Collections.EMPTY_SET);
assert rev2.getReffering().equals(TestTools.makeSet(ing1, ing2));
@ -142,10 +142,10 @@ public class BasicSet extends AbstractEntityTest {
SetRefIngEntity ing1 = getEntityManager().find(SetRefIngEntity.class, ing1_id);
SetRefIngEntity ing2 = getEntityManager().find(SetRefIngEntity.class, ing2_id);
SetRefEdEntity rev1 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 1);
SetRefEdEntity rev2 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 2);
SetRefEdEntity rev3 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 3);
SetRefEdEntity rev4 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 4);
SetRefEdEntity rev1 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 1);
SetRefEdEntity rev2 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 2);
SetRefEdEntity rev3 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 3);
SetRefEdEntity rev4 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 4);
assert rev1.getReffering().equals(Collections.EMPTY_SET);
assert rev2.getReffering().equals(Collections.EMPTY_SET);
@ -158,10 +158,10 @@ public class BasicSet extends AbstractEntityTest {
SetRefEdEntity ed1 = getEntityManager().find(SetRefEdEntity.class, ed1_id);
SetRefEdEntity ed2 = getEntityManager().find(SetRefEdEntity.class, ed2_id);
SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 1);
SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 2);
SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 3);
SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 4);
SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 1);
SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 2);
SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 3);
SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 4);
assert rev1 == null;
assert rev2.getReference().equals(ed1);
@ -174,10 +174,10 @@ public class BasicSet extends AbstractEntityTest {
SetRefEdEntity ed1 = getEntityManager().find(SetRefEdEntity.class, ed1_id);
SetRefEdEntity ed2 = getEntityManager().find(SetRefEdEntity.class, ed2_id);
SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 1);
SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 2);
SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 3);
SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 4);
SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 1);
SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 2);
SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 3);
SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 4);
assert rev1 == null;
assert rev2.getReference().equals(ed1);

View File

@ -103,11 +103,11 @@ public class BasicSetWithEmbId extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(SetRefEdEmbIdEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(SetRefEdEmbIdEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(SetRefEdEmbIdEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(SetRefEdEmbIdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetRefIngEmbIdEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(SetRefIngEmbIdEntity.class, ing2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetRefIngEmbIdEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(SetRefIngEmbIdEntity.class, ing2_id));
}
private <T> Set<T> makeSet(T... objects) {
@ -122,9 +122,9 @@ public class BasicSetWithEmbId extends AbstractEntityTest {
SetRefIngEmbIdEntity ing1 = getEntityManager().find(SetRefIngEmbIdEntity.class, ing1_id);
SetRefIngEmbIdEntity ing2 = getEntityManager().find(SetRefIngEmbIdEntity.class, ing2_id);
SetRefEdEmbIdEntity rev1 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed1_id, 1);
SetRefEdEmbIdEntity rev2 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed1_id, 2);
SetRefEdEmbIdEntity rev3 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed1_id, 3);
SetRefEdEmbIdEntity rev1 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed1_id, 1);
SetRefEdEmbIdEntity rev2 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed1_id, 2);
SetRefEdEmbIdEntity rev3 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed1_id, 3);
assert rev1.getReffering().equals(makeSet(ing1, ing2));
assert rev2.getReffering().equals(makeSet(ing2));
@ -136,9 +136,9 @@ public class BasicSetWithEmbId extends AbstractEntityTest {
SetRefIngEmbIdEntity ing1 = getEntityManager().find(SetRefIngEmbIdEntity.class, ing1_id);
SetRefIngEmbIdEntity ing2 = getEntityManager().find(SetRefIngEmbIdEntity.class, ing2_id);
SetRefEdEmbIdEntity rev1 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed2_id, 1);
SetRefEdEmbIdEntity rev2 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed2_id, 2);
SetRefEdEmbIdEntity rev3 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed2_id, 3);
SetRefEdEmbIdEntity rev1 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed2_id, 1);
SetRefEdEmbIdEntity rev2 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed2_id, 2);
SetRefEdEmbIdEntity rev3 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed2_id, 3);
assert rev1.getReffering().equals(Collections.EMPTY_SET);
assert rev2.getReffering().equals(makeSet(ing1));
@ -150,9 +150,9 @@ public class BasicSetWithEmbId extends AbstractEntityTest {
SetRefEdEmbIdEntity ed1 = getEntityManager().find(SetRefEdEmbIdEntity.class, ed1_id);
SetRefEdEmbIdEntity ed2 = getEntityManager().find(SetRefEdEmbIdEntity.class, ed2_id);
SetRefIngEmbIdEntity rev1 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing1_id, 1);
SetRefIngEmbIdEntity rev2 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing1_id, 2);
SetRefIngEmbIdEntity rev3 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing1_id, 3);
SetRefIngEmbIdEntity rev1 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing1_id, 1);
SetRefIngEmbIdEntity rev2 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing1_id, 2);
SetRefIngEmbIdEntity rev3 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
@ -164,9 +164,9 @@ public class BasicSetWithEmbId extends AbstractEntityTest {
SetRefEdEmbIdEntity ed1 = getEntityManager().find(SetRefEdEmbIdEntity.class, ed1_id);
SetRefEdEmbIdEntity ed2 = getEntityManager().find(SetRefEdEmbIdEntity.class, ed2_id);
SetRefIngEmbIdEntity rev1 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing2_id, 1);
SetRefIngEmbIdEntity rev2 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing2_id, 2);
SetRefIngEmbIdEntity rev3 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing2_id, 3);
SetRefIngEmbIdEntity rev1 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing2_id, 1);
SetRefIngEmbIdEntity rev2 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing2_id, 2);
SetRefIngEmbIdEntity rev3 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing2_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);

View File

@ -103,11 +103,11 @@ public class BasicSetWithMulId extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(SetRefEdMulIdEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(SetRefEdMulIdEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(SetRefEdMulIdEntity.class, ed1_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(SetRefEdMulIdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetRefIngMulIdEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(SetRefIngMulIdEntity.class, ing2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetRefIngMulIdEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(SetRefIngMulIdEntity.class, ing2_id));
}
private <T> Set<T> makeSet(T... objects) {
@ -122,9 +122,9 @@ public class BasicSetWithMulId extends AbstractEntityTest {
SetRefIngMulIdEntity ing1 = getEntityManager().find(SetRefIngMulIdEntity.class, ing1_id);
SetRefIngMulIdEntity ing2 = getEntityManager().find(SetRefIngMulIdEntity.class, ing2_id);
SetRefEdMulIdEntity rev1 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed1_id, 1);
SetRefEdMulIdEntity rev2 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed1_id, 2);
SetRefEdMulIdEntity rev3 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed1_id, 3);
SetRefEdMulIdEntity rev1 = getAuditReader().find(SetRefEdMulIdEntity.class, ed1_id, 1);
SetRefEdMulIdEntity rev2 = getAuditReader().find(SetRefEdMulIdEntity.class, ed1_id, 2);
SetRefEdMulIdEntity rev3 = getAuditReader().find(SetRefEdMulIdEntity.class, ed1_id, 3);
assert rev1.getReffering().equals(makeSet(ing1, ing2));
assert rev2.getReffering().equals(makeSet(ing2));
@ -136,9 +136,9 @@ public class BasicSetWithMulId extends AbstractEntityTest {
SetRefIngMulIdEntity ing1 = getEntityManager().find(SetRefIngMulIdEntity.class, ing1_id);
SetRefIngMulIdEntity ing2 = getEntityManager().find(SetRefIngMulIdEntity.class, ing2_id);
SetRefEdMulIdEntity rev1 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed2_id, 1);
SetRefEdMulIdEntity rev2 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed2_id, 2);
SetRefEdMulIdEntity rev3 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed2_id, 3);
SetRefEdMulIdEntity rev1 = getAuditReader().find(SetRefEdMulIdEntity.class, ed2_id, 1);
SetRefEdMulIdEntity rev2 = getAuditReader().find(SetRefEdMulIdEntity.class, ed2_id, 2);
SetRefEdMulIdEntity rev3 = getAuditReader().find(SetRefEdMulIdEntity.class, ed2_id, 3);
assert rev1.getReffering().equals(Collections.EMPTY_SET);
assert rev2.getReffering().equals(makeSet(ing1));
@ -150,9 +150,9 @@ public class BasicSetWithMulId extends AbstractEntityTest {
SetRefEdMulIdEntity ed1 = getEntityManager().find(SetRefEdMulIdEntity.class, ed1_id);
SetRefEdMulIdEntity ed2 = getEntityManager().find(SetRefEdMulIdEntity.class, ed2_id);
SetRefIngMulIdEntity rev1 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing1_id, 1);
SetRefIngMulIdEntity rev2 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing1_id, 2);
SetRefIngMulIdEntity rev3 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing1_id, 3);
SetRefIngMulIdEntity rev1 = getAuditReader().find(SetRefIngMulIdEntity.class, ing1_id, 1);
SetRefIngMulIdEntity rev2 = getAuditReader().find(SetRefIngMulIdEntity.class, ing1_id, 2);
SetRefIngMulIdEntity rev3 = getAuditReader().find(SetRefIngMulIdEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
@ -164,9 +164,9 @@ public class BasicSetWithMulId extends AbstractEntityTest {
SetRefEdMulIdEntity ed1 = getEntityManager().find(SetRefEdMulIdEntity.class, ed1_id);
SetRefEdMulIdEntity ed2 = getEntityManager().find(SetRefEdMulIdEntity.class, ed2_id);
SetRefIngMulIdEntity rev1 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing2_id, 1);
SetRefIngMulIdEntity rev2 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing2_id, 2);
SetRefIngMulIdEntity rev3 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing2_id, 3);
SetRefIngMulIdEntity rev1 = getAuditReader().find(SetRefIngMulIdEntity.class, ing2_id, 1);
SetRefIngMulIdEntity rev2 = getAuditReader().find(SetRefIngMulIdEntity.class, ing2_id, 2);
SetRefIngMulIdEntity rev3 = getAuditReader().find(SetRefIngMulIdEntity.class, ing2_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);

View File

@ -127,13 +127,13 @@ public class BasicSetWithNullsDelete extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3, 4, 5).equals(getVersionsReader().getRevisions(SetRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 4).equals(getVersionsReader().getRevisions(SetRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3, 4, 5).equals(getAuditReader().getRevisions(SetRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 4).equals(getAuditReader().getRevisions(SetRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing2_id));
assert Arrays.asList(1, 4).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing3_id));
assert Arrays.asList(1, 5).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing4_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing2_id));
assert Arrays.asList(1, 4).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing3_id));
assert Arrays.asList(1, 5).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing4_id));
}
private <T> Set<T> makeSet(T... objects) {
@ -150,11 +150,11 @@ public class BasicSetWithNullsDelete extends AbstractEntityTest {
SetRefIngEntity ing3 = getEntityManager().find(SetRefIngEntity.class, ing3_id);
SetRefIngEntity ing4 = getEntityManager().find(SetRefIngEntity.class, ing4_id);
SetRefEdEntity rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
SetRefEdEntity rev2 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 2);
SetRefEdEntity rev3 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 3);
SetRefEdEntity rev4 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 4);
SetRefEdEntity rev5 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 5);
SetRefEdEntity rev1 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 1);
SetRefEdEntity rev2 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 2);
SetRefEdEntity rev3 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 3);
SetRefEdEntity rev4 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 4);
SetRefEdEntity rev5 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 5);
assert rev1.getReffering().equals(makeSet(ing1, ing2, ing3, ing4));
assert rev2.getReffering().equals(makeSet(ing2, ing3, ing4));
@ -167,11 +167,11 @@ public class BasicSetWithNullsDelete extends AbstractEntityTest {
public void testHistoryOfEdId2() {
SetRefIngEntity ing3 = getEntityManager().find(SetRefIngEntity.class, ing3_id);
SetRefEdEntity rev1 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 1);
SetRefEdEntity rev2 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 2);
SetRefEdEntity rev3 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 3);
SetRefEdEntity rev4 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 4);
SetRefEdEntity rev5 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 5);
SetRefEdEntity rev1 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 1);
SetRefEdEntity rev2 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 2);
SetRefEdEntity rev3 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 3);
SetRefEdEntity rev4 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 4);
SetRefEdEntity rev5 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 5);
assert rev1.getReffering().equals(Collections.EMPTY_SET);
assert rev2.getReffering().equals(Collections.EMPTY_SET);
@ -184,11 +184,11 @@ public class BasicSetWithNullsDelete extends AbstractEntityTest {
public void testHistoryOfEdIng1() {
SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 1);
SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 2);
SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 3);
SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 4);
SetRefIngEntity rev5 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 5);
SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 1);
SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 2);
SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 3);
SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 4);
SetRefIngEntity rev5 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 5);
assert rev1.getReference().equals(ed1);
assert rev2.getReference() == null;
@ -201,11 +201,11 @@ public class BasicSetWithNullsDelete extends AbstractEntityTest {
public void testHistoryOfEdIng2() {
SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 1);
SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 2);
SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 3);
SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 4);
SetRefIngEntity rev5 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 5);
SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 1);
SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 2);
SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 3);
SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 4);
SetRefIngEntity rev5 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 5);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);
@ -219,11 +219,11 @@ public class BasicSetWithNullsDelete extends AbstractEntityTest {
SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
SetRefEdEntity ed2 = new SetRefEdEntity(2, "data_ed_2");
SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing3_id, 1);
SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing3_id, 2);
SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing3_id, 3);
SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing3_id, 4);
SetRefIngEntity rev5 = getVersionsReader().find(SetRefIngEntity.class, ing3_id, 5);
SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 1);
SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 2);
SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 3);
SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 4);
SetRefIngEntity rev5 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 5);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);
@ -236,11 +236,11 @@ public class BasicSetWithNullsDelete extends AbstractEntityTest {
public void testHistoryOfEdIng4() {
SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing4_id, 1);
SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing4_id, 2);
SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing4_id, 3);
SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing4_id, 4);
SetRefIngEntity rev5 = getVersionsReader().find(SetRefIngEntity.class, ing4_id, 5);
SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing4_id, 1);
SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing4_id, 2);
SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing4_id, 3);
SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing4_id, 4);
SetRefIngEntity rev5 = getAuditReader().find(SetRefIngEntity.class, ing4_id, 5);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);

View File

@ -90,10 +90,10 @@ public class BidirectionalMapKey extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(RefEdMapKeyEntity.class, ed_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(RefEdMapKeyEntity.class, ed_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(RefIngMapKeyEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(RefIngMapKeyEntity.class, ing2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(RefIngMapKeyEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(RefIngMapKeyEntity.class, ing2_id));
}
@Test
@ -101,8 +101,8 @@ public class BidirectionalMapKey extends AbstractEntityTest {
RefIngMapKeyEntity ing1 = getEntityManager().find(RefIngMapKeyEntity.class, ing1_id);
RefIngMapKeyEntity ing2 = getEntityManager().find(RefIngMapKeyEntity.class, ing2_id);
RefEdMapKeyEntity rev1 = getVersionsReader().find(RefEdMapKeyEntity.class, ed_id, 1);
RefEdMapKeyEntity rev2 = getVersionsReader().find(RefEdMapKeyEntity.class, ed_id, 2);
RefEdMapKeyEntity rev1 = getAuditReader().find(RefEdMapKeyEntity.class, ed_id, 1);
RefEdMapKeyEntity rev2 = getAuditReader().find(RefEdMapKeyEntity.class, ed_id, 2);
assert rev1.getIdmap().equals(TestTools.makeMap("a", ing1));
assert rev2.getIdmap().equals(TestTools.makeMap("a", ing1, "b", ing2));

View File

@ -110,10 +110,10 @@ public class BasicDetachedList extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(ListRefCollEntity.class, coll1_id));
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(ListRefCollEntity.class, coll1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
}
@Test
@ -121,10 +121,10 @@ public class BasicDetachedList extends AbstractEntityTest {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
ListRefCollEntity rev1 = getVersionsReader().find(ListRefCollEntity.class, coll1_id, 1);
ListRefCollEntity rev2 = getVersionsReader().find(ListRefCollEntity.class, coll1_id, 2);
ListRefCollEntity rev3 = getVersionsReader().find(ListRefCollEntity.class, coll1_id, 3);
ListRefCollEntity rev4 = getVersionsReader().find(ListRefCollEntity.class, coll1_id, 4);
ListRefCollEntity rev1 = getAuditReader().find(ListRefCollEntity.class, coll1_id, 1);
ListRefCollEntity rev2 = getAuditReader().find(ListRefCollEntity.class, coll1_id, 2);
ListRefCollEntity rev3 = getAuditReader().find(ListRefCollEntity.class, coll1_id, 3);
ListRefCollEntity rev4 = getAuditReader().find(ListRefCollEntity.class, coll1_id, 4);
assert TestTools.checkList(rev1.getCollection(), str1);
assert TestTools.checkList(rev2.getCollection(), str1, str2);

View File

@ -110,10 +110,10 @@ public class BasicDetachedSet extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(SetRefCollEntity.class, coll1_id));
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(SetRefCollEntity.class, coll1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
}
@Test
@ -121,10 +121,10 @@ public class BasicDetachedSet extends AbstractEntityTest {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
SetRefCollEntity rev1 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 1);
SetRefCollEntity rev2 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 2);
SetRefCollEntity rev3 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 3);
SetRefCollEntity rev4 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 4);
SetRefCollEntity rev1 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 1);
SetRefCollEntity rev2 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 2);
SetRefCollEntity rev3 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 3);
SetRefCollEntity rev4 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 4);
assert rev1.getCollection().equals(TestTools.makeSet(str1));
assert rev2.getCollection().equals(TestTools.makeSet(str1, str2));

View File

@ -109,10 +109,10 @@ public class BasicDetachedSetWithEmbId extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(SetRefCollEntityEmbId.class, coll1_id));
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(SetRefCollEntityEmbId.class, coll1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(EmbIdTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(EmbIdTestEntity.class, str2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(EmbIdTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(EmbIdTestEntity.class, str2_id));
}
@Test
@ -120,10 +120,10 @@ public class BasicDetachedSetWithEmbId extends AbstractEntityTest {
EmbIdTestEntity str1 = getEntityManager().find(EmbIdTestEntity.class, str1_id);
EmbIdTestEntity str2 = getEntityManager().find(EmbIdTestEntity.class, str2_id);
SetRefCollEntityEmbId rev1 = getVersionsReader().find(SetRefCollEntityEmbId.class, coll1_id, 1);
SetRefCollEntityEmbId rev2 = getVersionsReader().find(SetRefCollEntityEmbId.class, coll1_id, 2);
SetRefCollEntityEmbId rev3 = getVersionsReader().find(SetRefCollEntityEmbId.class, coll1_id, 3);
SetRefCollEntityEmbId rev4 = getVersionsReader().find(SetRefCollEntityEmbId.class, coll1_id, 4);
SetRefCollEntityEmbId rev1 = getAuditReader().find(SetRefCollEntityEmbId.class, coll1_id, 1);
SetRefCollEntityEmbId rev2 = getAuditReader().find(SetRefCollEntityEmbId.class, coll1_id, 2);
SetRefCollEntityEmbId rev3 = getAuditReader().find(SetRefCollEntityEmbId.class, coll1_id, 3);
SetRefCollEntityEmbId rev4 = getAuditReader().find(SetRefCollEntityEmbId.class, coll1_id, 4);
assert rev1.getCollection().equals(TestTools.makeSet(str1));
assert rev2.getCollection().equals(TestTools.makeSet(str1, str2));

View File

@ -109,10 +109,10 @@ public class BasicDetachedSetWithMulId extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(SetRefCollEntityMulId.class, coll1_id));
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(SetRefCollEntityMulId.class, coll1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(MulIdTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(MulIdTestEntity.class, str2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(MulIdTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(MulIdTestEntity.class, str2_id));
}
@Test
@ -120,10 +120,10 @@ public class BasicDetachedSetWithMulId extends AbstractEntityTest {
MulIdTestEntity str1 = getEntityManager().find(MulIdTestEntity.class, str1_id);
MulIdTestEntity str2 = getEntityManager().find(MulIdTestEntity.class, str2_id);
SetRefCollEntityMulId rev1 = getVersionsReader().find(SetRefCollEntityMulId.class, coll1_id, 1);
SetRefCollEntityMulId rev2 = getVersionsReader().find(SetRefCollEntityMulId.class, coll1_id, 2);
SetRefCollEntityMulId rev3 = getVersionsReader().find(SetRefCollEntityMulId.class, coll1_id, 3);
SetRefCollEntityMulId rev4 = getVersionsReader().find(SetRefCollEntityMulId.class, coll1_id, 4);
SetRefCollEntityMulId rev1 = getAuditReader().find(SetRefCollEntityMulId.class, coll1_id, 1);
SetRefCollEntityMulId rev2 = getAuditReader().find(SetRefCollEntityMulId.class, coll1_id, 2);
SetRefCollEntityMulId rev3 = getAuditReader().find(SetRefCollEntityMulId.class, coll1_id, 3);
SetRefCollEntityMulId rev4 = getAuditReader().find(SetRefCollEntityMulId.class, coll1_id, 4);
assert rev1.getCollection().equals(TestTools.makeSet(str1));
assert rev2.getCollection().equals(TestTools.makeSet(str1, str2));

View File

@ -110,10 +110,10 @@ public class BasicJoinColumnSet extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(SetJoinColumnRefCollEntity.class, coll1_id));
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(SetJoinColumnRefCollEntity.class, coll1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
}
@Test
@ -121,10 +121,10 @@ public class BasicJoinColumnSet extends AbstractEntityTest {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
SetJoinColumnRefCollEntity rev1 = getVersionsReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 1);
SetJoinColumnRefCollEntity rev2 = getVersionsReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 2);
SetJoinColumnRefCollEntity rev3 = getVersionsReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 3);
SetJoinColumnRefCollEntity rev4 = getVersionsReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 4);
SetJoinColumnRefCollEntity rev1 = getAuditReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 1);
SetJoinColumnRefCollEntity rev2 = getAuditReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 2);
SetJoinColumnRefCollEntity rev3 = getAuditReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 3);
SetJoinColumnRefCollEntity rev4 = getAuditReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 4);
assert rev1.getCollection().equals(TestTools.makeSet(str1));
assert rev2.getCollection().equals(TestTools.makeSet(str1, str2));

View File

@ -87,17 +87,17 @@ public class DataChangesDetachedSet extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetRefCollEntity.class, coll1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetRefCollEntity.class, coll1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
}
@Test
public void testHistoryOfColl1() {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
SetRefCollEntity rev1 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 1);
SetRefCollEntity rev2 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 2);
SetRefCollEntity rev1 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 1);
SetRefCollEntity rev2 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 2);
assert rev1.getCollection().equals(TestTools.makeSet());
assert rev2.getCollection().equals(TestTools.makeSet(str1));

View File

@ -106,10 +106,10 @@ public class DoubleDetachedSet extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(DoubleSetRefCollEntity.class, coll1_id));
assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(DoubleSetRefCollEntity.class, coll1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
}
@Test
@ -117,9 +117,9 @@ public class DoubleDetachedSet extends AbstractEntityTest {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
DoubleSetRefCollEntity rev1 = getVersionsReader().find(DoubleSetRefCollEntity.class, coll1_id, 1);
DoubleSetRefCollEntity rev2 = getVersionsReader().find(DoubleSetRefCollEntity.class, coll1_id, 2);
DoubleSetRefCollEntity rev3 = getVersionsReader().find(DoubleSetRefCollEntity.class, coll1_id, 3);
DoubleSetRefCollEntity rev1 = getAuditReader().find(DoubleSetRefCollEntity.class, coll1_id, 1);
DoubleSetRefCollEntity rev2 = getAuditReader().find(DoubleSetRefCollEntity.class, coll1_id, 2);
DoubleSetRefCollEntity rev3 = getAuditReader().find(DoubleSetRefCollEntity.class, coll1_id, 3);
assert rev1.getCollection().equals(TestTools.makeSet(str1));
assert rev2.getCollection().equals(TestTools.makeSet(str1, str2));

View File

@ -86,18 +86,18 @@ public class Bidirectional extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefIngEntity.class, ing1_id));
}
@Test
public void testHistoryOfEdId1() {
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 1);
BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 2);
BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 1);
BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 2);
assert rev1.getReferencing().equals(ing1);
assert rev2.getReferencing() == null;
@ -107,8 +107,8 @@ public class Bidirectional extends AbstractEntityTest {
public void testHistoryOfEdId2() {
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 1);
BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 2);
BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 1);
BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 2);
assert rev1.getReferencing() == null;
assert rev2.getReferencing().equals(ing1);

View File

@ -111,11 +111,11 @@ public class Bidirectional2 extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 4).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 4).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed2_id));
assert Arrays.asList(2, 3, 4).equals(getVersionsReader().getRevisions(BiRefIngEntity.class, ing1_id));
assert Arrays.asList(2, 3, 4).equals(getVersionsReader().getRevisions(BiRefIngEntity.class, ing2_id));
assert Arrays.asList(2, 3, 4).equals(getAuditReader().getRevisions(BiRefIngEntity.class, ing1_id));
assert Arrays.asList(2, 3, 4).equals(getAuditReader().getRevisions(BiRefIngEntity.class, ing2_id));
}
@Test
@ -123,10 +123,10 @@ public class Bidirectional2 extends AbstractEntityTest {
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
BiRefIngEntity ing2 = getEntityManager().find(BiRefIngEntity.class, ing2_id);
BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 1);
BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 2);
BiRefEdEntity rev3 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 3);
BiRefEdEntity rev4 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 4);
BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 1);
BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 2);
BiRefEdEntity rev3 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 3);
BiRefEdEntity rev4 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 4);
assert rev1.getReferencing() == null;
assert rev2.getReferencing().equals(ing1);
@ -138,10 +138,10 @@ public class Bidirectional2 extends AbstractEntityTest {
public void testHistoryOfEdId2() {
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 1);
BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 2);
BiRefEdEntity rev3 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 3);
BiRefEdEntity rev4 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 4);
BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 1);
BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 2);
BiRefEdEntity rev3 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 3);
BiRefEdEntity rev4 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 4);
assert rev1.getReferencing() == null;
assert rev2.getReferencing() == null;

View File

@ -96,11 +96,11 @@ public class BidirectionalNoNulls extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefIngEntity.class, ing2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefIngEntity.class, ing2_id));
}
@Test
@ -108,8 +108,8 @@ public class BidirectionalNoNulls extends AbstractEntityTest {
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
BiRefIngEntity ing2 = getEntityManager().find(BiRefIngEntity.class, ing2_id);
BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 1);
BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 2);
BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 1);
BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 2);
assert rev1.getReferencing().equals(ing1);
assert rev2.getReferencing().equals(ing2);
@ -120,8 +120,8 @@ public class BidirectionalNoNulls extends AbstractEntityTest {
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
BiRefIngEntity ing2 = getEntityManager().find(BiRefIngEntity.class, ing2_id);
BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 1);
BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 2);
BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 1);
BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 2);
assert rev1.getReferencing().equals(ing2);
assert rev2.getReferencing().equals(ing1);

View File

@ -85,18 +85,18 @@ public class EmbIdBidirectional extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiEmbIdRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiEmbIdRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiEmbIdRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiEmbIdRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiEmbIdRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiEmbIdRefIngEntity.class, ing1_id));
}
@Test
public void testHistoryOfEdId1() {
BiEmbIdRefIngEntity ing1 = getEntityManager().find(BiEmbIdRefIngEntity.class, ing1_id);
BiEmbIdRefEdEntity rev1 = getVersionsReader().find(BiEmbIdRefEdEntity.class, ed1_id, 1);
BiEmbIdRefEdEntity rev2 = getVersionsReader().find(BiEmbIdRefEdEntity.class, ed1_id, 2);
BiEmbIdRefEdEntity rev1 = getAuditReader().find(BiEmbIdRefEdEntity.class, ed1_id, 1);
BiEmbIdRefEdEntity rev2 = getAuditReader().find(BiEmbIdRefEdEntity.class, ed1_id, 2);
assert rev1.getReferencing().equals(ing1);
assert rev2.getReferencing() == null;
@ -106,8 +106,8 @@ public class EmbIdBidirectional extends AbstractEntityTest {
public void testHistoryOfEdId2() {
BiEmbIdRefIngEntity ing1 = getEntityManager().find(BiEmbIdRefIngEntity.class, ing1_id);
BiEmbIdRefEdEntity rev1 = getVersionsReader().find(BiEmbIdRefEdEntity.class, ed2_id, 1);
BiEmbIdRefEdEntity rev2 = getVersionsReader().find(BiEmbIdRefEdEntity.class, ed2_id, 2);
BiEmbIdRefEdEntity rev1 = getAuditReader().find(BiEmbIdRefEdEntity.class, ed2_id, 1);
BiEmbIdRefEdEntity rev2 = getAuditReader().find(BiEmbIdRefEdEntity.class, ed2_id, 2);
assert rev1.getReferencing() == null;
assert rev2.getReferencing().equals(ing1);
@ -118,8 +118,8 @@ public class EmbIdBidirectional extends AbstractEntityTest {
BiEmbIdRefEdEntity ed1 = getEntityManager().find(BiEmbIdRefEdEntity.class, ed1_id);
BiEmbIdRefEdEntity ed2 = getEntityManager().find(BiEmbIdRefEdEntity.class, ed2_id);
BiEmbIdRefIngEntity rev1 = getVersionsReader().find(BiEmbIdRefIngEntity.class, ing1_id, 1);
BiEmbIdRefIngEntity rev2 = getVersionsReader().find(BiEmbIdRefIngEntity.class, ing1_id, 2);
BiEmbIdRefIngEntity rev1 = getAuditReader().find(BiEmbIdRefIngEntity.class, ing1_id, 1);
BiEmbIdRefIngEntity rev2 = getAuditReader().find(BiEmbIdRefIngEntity.class, ing1_id, 2);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);

View File

@ -85,18 +85,18 @@ public class MulIdBidirectional extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiMulIdRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiMulIdRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiMulIdRefEdEntity.class, ed1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiMulIdRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiMulIdRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiMulIdRefIngEntity.class, ing1_id));
}
@Test
public void testHistoryOfEdId1() {
BiMulIdRefIngEntity ing1 = getEntityManager().find(BiMulIdRefIngEntity.class, ing1_id);
BiMulIdRefEdEntity rev1 = getVersionsReader().find(BiMulIdRefEdEntity.class, ed1_id, 1);
BiMulIdRefEdEntity rev2 = getVersionsReader().find(BiMulIdRefEdEntity.class, ed1_id, 2);
BiMulIdRefEdEntity rev1 = getAuditReader().find(BiMulIdRefEdEntity.class, ed1_id, 1);
BiMulIdRefEdEntity rev2 = getAuditReader().find(BiMulIdRefEdEntity.class, ed1_id, 2);
assert rev1.getReferencing().equals(ing1);
assert rev2.getReferencing() == null;
@ -106,8 +106,8 @@ public class MulIdBidirectional extends AbstractEntityTest {
public void testHistoryOfEdId2() {
BiMulIdRefIngEntity ing1 = getEntityManager().find(BiMulIdRefIngEntity.class, ing1_id);
BiMulIdRefEdEntity rev1 = getVersionsReader().find(BiMulIdRefEdEntity.class, ed2_id, 1);
BiMulIdRefEdEntity rev2 = getVersionsReader().find(BiMulIdRefEdEntity.class, ed2_id, 2);
BiMulIdRefEdEntity rev1 = getAuditReader().find(BiMulIdRefEdEntity.class, ed2_id, 1);
BiMulIdRefEdEntity rev2 = getAuditReader().find(BiMulIdRefEdEntity.class, ed2_id, 2);
assert rev1.getReferencing() == null;
assert rev2.getReferencing().equals(ing1);
@ -118,8 +118,8 @@ public class MulIdBidirectional extends AbstractEntityTest {
BiMulIdRefEdEntity ed1 = getEntityManager().find(BiMulIdRefEdEntity.class, ed1_id);
BiMulIdRefEdEntity ed2 = getEntityManager().find(BiMulIdRefEdEntity.class, ed2_id);
BiMulIdRefIngEntity rev1 = getVersionsReader().find(BiMulIdRefIngEntity.class, ing1_id, 1);
BiMulIdRefIngEntity rev2 = getVersionsReader().find(BiMulIdRefIngEntity.class, ing1_id, 2);
BiMulIdRefIngEntity rev1 = getAuditReader().find(BiMulIdRefIngEntity.class, ing1_id, 1);
BiMulIdRefIngEntity rev2 = getAuditReader().find(BiMulIdRefIngEntity.class, ing1_id, 2);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);

View File

@ -110,13 +110,13 @@ public class Unidirectional extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed2_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed3_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed4_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed3_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed4_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(UniRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(UniRefIngEntity.class, ing2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(UniRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(UniRefIngEntity.class, ing2_id));
}
@Test
@ -124,9 +124,9 @@ public class Unidirectional extends AbstractEntityTest {
UniRefEdEntity ed1 = getEntityManager().find(UniRefEdEntity.class, ed1_id);
UniRefEdEntity ed2 = getEntityManager().find(UniRefEdEntity.class, ed2_id);
UniRefIngEntity rev1 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 1);
UniRefIngEntity rev2 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 2);
UniRefIngEntity rev3 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 3);
UniRefIngEntity rev1 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 1);
UniRefIngEntity rev2 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 2);
UniRefIngEntity rev3 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
@ -138,9 +138,9 @@ public class Unidirectional extends AbstractEntityTest {
UniRefEdEntity ed3 = getEntityManager().find(UniRefEdEntity.class, ed3_id);
UniRefEdEntity ed4 = getEntityManager().find(UniRefEdEntity.class, ed4_id);
UniRefIngEntity rev1 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 1);
UniRefIngEntity rev2 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 2);
UniRefIngEntity rev3 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 3);
UniRefIngEntity rev1 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 1);
UniRefIngEntity rev2 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 2);
UniRefIngEntity rev3 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 3);
assert rev1.getReference().equals(ed3);
assert rev2.getReference().equals(ed3);

View File

@ -101,20 +101,20 @@ public class UnidirectionalWithNulls extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed1_id));
assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed2_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed1_id));
assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed2_id));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(UniRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(UniRefIngEntity.class, ing2_id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(UniRefIngEntity.class, ing1_id));
assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(UniRefIngEntity.class, ing2_id));
}
@Test
public void testHistoryOfIngId1() {
UniRefEdEntity ed1 = getEntityManager().find(UniRefEdEntity.class, ed1_id);
UniRefIngEntity rev1 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 1);
UniRefIngEntity rev2 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 2);
UniRefIngEntity rev3 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 3);
UniRefIngEntity rev1 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 1);
UniRefIngEntity rev2 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 2);
UniRefIngEntity rev3 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference() == null;
@ -125,9 +125,9 @@ public class UnidirectionalWithNulls extends AbstractEntityTest {
public void testHistoryOfIngId2() {
UniRefEdEntity ed2 = getEntityManager().find(UniRefEdEntity.class, ed2_id);
UniRefIngEntity rev1 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 1);
UniRefIngEntity rev2 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 2);
UniRefIngEntity rev3 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 3);
UniRefIngEntity rev1 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 1);
UniRefIngEntity rev2 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 2);
UniRefIngEntity rev3 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 3);
assert rev1.getReference() == null;
assert rev2.getReference() == null;

View File

@ -65,7 +65,7 @@ public class UnversionedOptimisticLockingField extends AbstractEntityTest {
@Test
public void testRevisionCounts() {
assert Arrays.asList(1, 2).equals(
getVersionsReader().getRevisions(UnversionedOptimisticLockingFieldEntity.class,
getAuditReader().getRevisions(UnversionedOptimisticLockingFieldEntity.class,
id1));
}
@ -74,9 +74,9 @@ public class UnversionedOptimisticLockingField extends AbstractEntityTest {
UnversionedOptimisticLockingFieldEntity ver1 = new UnversionedOptimisticLockingFieldEntity(id1, "x");
UnversionedOptimisticLockingFieldEntity ver2 = new UnversionedOptimisticLockingFieldEntity(id1, "y");
assert getVersionsReader().find(UnversionedOptimisticLockingFieldEntity.class, id1, 1)
assert getAuditReader().find(UnversionedOptimisticLockingFieldEntity.class, id1, 1)
.equals(ver1);
assert getVersionsReader().find(UnversionedOptimisticLockingFieldEntity.class, id1, 2)
assert getAuditReader().find(UnversionedOptimisticLockingFieldEntity.class, id1, 2)
.equals(ver2);
}

View File

@ -64,7 +64,7 @@ public class VersionsProperties extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(PropertiesTestEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(PropertiesTestEntity.class, id1));
}
@Test
@ -72,7 +72,7 @@ public class VersionsProperties extends AbstractEntityTest {
PropertiesTestEntity ver1 = new PropertiesTestEntity(id1, "x");
PropertiesTestEntity ver2 = new PropertiesTestEntity(id1, "y");
assert getVersionsReader().find(PropertiesTestEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(PropertiesTestEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(PropertiesTestEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(PropertiesTestEntity.class, id1, 2).equals(ver2);
}
}

View File

@ -81,19 +81,19 @@ public class AggregateQuery extends AbstractEntityTest {
@Test
public void testEntitiesAvgMaxQuery() {
Object[] ver1 = (Object[]) getVersionsReader().createQuery()
Object[] ver1 = (Object[]) getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 1)
.addProjection("max", "number")
.addProjection("avg", "number")
.getSingleResult();
Object[] ver2 = (Object[]) getVersionsReader().createQuery()
Object[] ver2 = (Object[]) getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 2)
.addProjection("max", "number")
.addProjection("avg", "number")
.getSingleResult();
Object[] ver3 = (Object[]) getVersionsReader().createQuery()
Object[] ver3 = (Object[]) getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 3)
.addProjection("max", "number")
.addProjection("avg", "number")

View File

@ -77,7 +77,7 @@ public class CustomRevEntityQuery extends AbstractEntityTest {
@Test
public void testRevisionsOfId1Query() {
List<Object[]> result = getVersionsReader().createQuery()
List<Object[]> result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.add(AuditRestrictions.idEq(id1))
.getResultList();
@ -93,7 +93,7 @@ public class CustomRevEntityQuery extends AbstractEntityTest {
@Test
public void testRevisionsOfId2Query() {
List<Object[]> result = getVersionsReader().createQuery()
List<Object[]> result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.add(AuditRestrictions.idEq(id2))
.getResultList();

View File

@ -73,20 +73,20 @@ public class DeletedEntities extends AbstractEntityTest {
@Test
public void testProjectionsInEntitiesAtRevision() {
assert getVersionsReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 1)
assert getAuditReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 1)
.getResultList().size() == 2;
assert getVersionsReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 2)
assert getAuditReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 2)
.getResultList().size() == 1;
assert (Long) getVersionsReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 1)
assert (Long) getAuditReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 1)
.addProjection("count", "originalId.id").getResultList().get(0) == 2;
assert (Long) getVersionsReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 2)
assert (Long) getAuditReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 2)
.addProjection("count", "originalId.id").getResultList().get(0) == 1;
}
@Test
public void testRevisionsOfEntityWithoutDelete() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, false)
.add(AuditRestrictions.idEq(id2))
.getResultList();

View File

@ -101,7 +101,7 @@ public class MaximalizePropertyQuery extends AbstractEntityTest {
@Test
public void testMaximizeWithIdEq() {
List revs_id1 = getVersionsReader().createQuery()
List revs_id1 = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.maximizeProperty("number")
@ -113,7 +113,7 @@ public class MaximalizePropertyQuery extends AbstractEntityTest {
@Test
public void testMinimizeWithPropertyEq() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.minimizeProperty("number")

View File

@ -90,21 +90,21 @@ public class OrderByLimitQuery extends AbstractEntityTest {
@Test
public void testEntitiesOrderLimitByQueryRev1() {
List res_0_to_1 = getVersionsReader().createQuery()
List res_0_to_1 = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 1)
.addOrder("number", false)
.setFirstResult(0)
.setMaxResults(2)
.getResultList();
List res_2_to_3 = getVersionsReader().createQuery()
List res_2_to_3 = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 1)
.addOrder("number", false)
.setFirstResult(2)
.setMaxResults(2)
.getResultList();
List res_empty = getVersionsReader().createQuery()
List res_empty = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 1)
.addOrder("number", false)
.setFirstResult(4)
@ -118,21 +118,21 @@ public class OrderByLimitQuery extends AbstractEntityTest {
@Test
public void testEntitiesOrderLimitByQueryRev2() {
List res_0_to_1 = getVersionsReader().createQuery()
List res_0_to_1 = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 2)
.addOrder("number", false)
.setFirstResult(0)
.setMaxResults(2)
.getResultList();
List res_2_to_3 = getVersionsReader().createQuery()
List res_2_to_3 = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 2)
.addOrder("number", false)
.setFirstResult(2)
.setMaxResults(2)
.getResultList();
List res_4 = getVersionsReader().createQuery()
List res_4 = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 2)
.addOrder("number", false)
.setFirstResult(4)

View File

@ -100,7 +100,7 @@ public class RevisionConstraintQuery extends AbstractEntityTest {
@Test
public void testRevisionsLtQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.distinct())
.add(RevisionProperty.lt(3))
@ -111,7 +111,7 @@ public class RevisionConstraintQuery extends AbstractEntityTest {
@Test
public void testRevisionsGeQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.distinct())
.add(RevisionProperty.ge(2))
@ -122,7 +122,7 @@ public class RevisionConstraintQuery extends AbstractEntityTest {
@Test
public void testRevisionsLeWithPropertyQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(RevisionProperty.le(3))
@ -134,7 +134,7 @@ public class RevisionConstraintQuery extends AbstractEntityTest {
@Test
public void testRevisionsGtWithPropertyQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(RevisionProperty.gt(1))
@ -146,7 +146,7 @@ public class RevisionConstraintQuery extends AbstractEntityTest {
@Test
public void testRevisionProjectionQuery() {
Object[] result = (Object[]) getVersionsReader().createQuery()
Object[] result = (Object[]) getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.max())
.addProjection(RevisionProperty.count())
@ -163,7 +163,7 @@ public class RevisionConstraintQuery extends AbstractEntityTest {
@Test
public void testRevisionOrderQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.idEq(id1))
@ -176,7 +176,7 @@ public class RevisionConstraintQuery extends AbstractEntityTest {
@Test
public void testRevisionCountQuery() {
// The query shouldn't be ordered as always, otherwise - we get an exception.
Object result = getVersionsReader().createQuery()
Object result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.count())
.add(AuditRestrictions.idEq(id1))

View File

@ -106,7 +106,7 @@ public class SimpleQuery extends AbstractEntityTest {
@Test
public void testEntitiesIdQuery() {
StrIntTestEntity ver2 = (StrIntTestEntity) getVersionsReader().createQuery()
StrIntTestEntity ver2 = (StrIntTestEntity) getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 2)
.add(AuditRestrictions.idEq(id2))
.getSingleResult();
@ -116,17 +116,17 @@ public class SimpleQuery extends AbstractEntityTest {
@Test
public void testEntitiesPropertyEqualsQuery() {
List ver1 = getVersionsReader().createQuery()
List ver1 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 1)
.add(AuditRestrictions.eq("str1", "a"))
.getResultList();
List ver2 = getVersionsReader().createQuery()
List ver2 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 2)
.add(AuditRestrictions.eq("str1", "a"))
.getResultList();
List ver3 = getVersionsReader().createQuery()
List ver3 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 3)
.add(AuditRestrictions.eq("str1", "a"))
.getResultList();
@ -140,17 +140,17 @@ public class SimpleQuery extends AbstractEntityTest {
@Test
public void testEntitiesPropertyLeQuery() {
List ver1 = getVersionsReader().createQuery()
List ver1 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 1)
.add(AuditRestrictions.le("number", 10))
.getResultList();
List ver2 = getVersionsReader().createQuery()
List ver2 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 2)
.add(AuditRestrictions.le("number", 10))
.getResultList();
List ver3 = getVersionsReader().createQuery()
List ver3 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 3)
.add(AuditRestrictions.le("number", 10))
.getResultList();
@ -165,21 +165,21 @@ public class SimpleQuery extends AbstractEntityTest {
@Test
public void testRevisionsPropertyEqQuery() {
List revs_id1 = getVersionsReader().createQuery()
List revs_id1 = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.le("str1", "a"))
.add(AuditRestrictions.idEq(id1))
.getResultList();
List revs_id2 = getVersionsReader().createQuery()
List revs_id2 = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.le("str1", "a"))
.add(AuditRestrictions.idEq(id2))
.getResultList();
List revs_id3 = getVersionsReader().createQuery()
List revs_id3 = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.le("str1", "a"))
@ -193,7 +193,7 @@ public class SimpleQuery extends AbstractEntityTest {
@Test
public void testSelectEntitiesQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, true, false)
.add(AuditRestrictions.idEq(id1))
.getResultList();
@ -206,7 +206,7 @@ public class SimpleQuery extends AbstractEntityTest {
@Test
public void testSelectEntitiesAndRevisionsQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.add(AuditRestrictions.idEq(id1))
.getResultList();
@ -228,7 +228,7 @@ public class SimpleQuery extends AbstractEntityTest {
@Test
public void testSelectRevisionTypeQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionTypeProperty.revisionType())
.add(AuditRestrictions.idEq(id1))
@ -243,7 +243,7 @@ public class SimpleQuery extends AbstractEntityTest {
@Test
public void testEmptyRevisionOfEntityQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.getResultList();
@ -252,7 +252,7 @@ public class SimpleQuery extends AbstractEntityTest {
@Test
public void testEmptyConjunctionRevisionOfEntityQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.add(AuditRestrictions.conjunction())
.getResultList();
@ -262,7 +262,7 @@ public class SimpleQuery extends AbstractEntityTest {
@Test
public void testEmptyDisjunctionRevisionOfEntityQuery() {
List result = getVersionsReader().createQuery()
List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.add(AuditRestrictions.disjunction())
.getResultList();

View File

@ -103,32 +103,32 @@ public class EmbIdOneToManyQuery extends AbstractEntityTest {
@Test
public void testEntitiesReferencedToId3() {
Set rev1_related = new HashSet(getVersionsReader().createQuery()
Set rev1_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
Set rev1 = new HashSet(getVersionsReader().createQuery()
Set rev1 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 1)
.add(AuditRestrictions.eq("reference", new SetRefEdEmbIdEntity(id3, null)))
.getResultList());
Set rev2_related = new HashSet(getVersionsReader().createQuery()
Set rev2_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
Set rev2 = new HashSet(getVersionsReader().createQuery()
Set rev2 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 2)
.add(AuditRestrictions.eq("reference", new SetRefEdEmbIdEntity(id3, null)))
.getResultList());
Set rev3_related = new HashSet(getVersionsReader().createQuery()
Set rev3_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
Set rev3 = new HashSet(getVersionsReader().createQuery()
Set rev3 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 3)
.add(AuditRestrictions.eq("reference", new SetRefEdEmbIdEntity(id3, null)))
.getResultList());
@ -145,17 +145,17 @@ public class EmbIdOneToManyQuery extends AbstractEntityTest {
@Test
public void testEntitiesReferencedToId4() {
Set rev1_related = new HashSet(getVersionsReader().createQuery()
Set rev1_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
Set rev2_related = new HashSet(getVersionsReader().createQuery()
Set rev2_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
Set rev3_related = new HashSet(getVersionsReader().createQuery()
Set rev3_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
@ -167,19 +167,19 @@ public class EmbIdOneToManyQuery extends AbstractEntityTest {
@Test
public void testEntitiesReferencedByIng1ToId3() {
List rev1_related = getVersionsReader().createQuery()
List rev1_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
.getResultList();
Object rev2_related = getVersionsReader().createQuery()
Object rev2_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
.getSingleResult();
Object rev3_related = getVersionsReader().createQuery()
Object rev3_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
@ -192,19 +192,19 @@ public class EmbIdOneToManyQuery extends AbstractEntityTest {
@Test
public void testEntitiesReferencedByIng2ToId3() {
List rev1_related = getVersionsReader().createQuery()
List rev1_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))
.getResultList();
List rev2_related = getVersionsReader().createQuery()
List rev2_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))
.getResultList();
Object rev3_related = getVersionsReader().createQuery()
Object rev3_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))

View File

@ -103,32 +103,32 @@ public class MulIdOneToManyQuery extends AbstractEntityTest {
@Test
public void testEntitiesReferencedToId3() {
Set rev1_related = new HashSet(getVersionsReader().createQuery()
Set rev1_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
Set rev1 = new HashSet(getVersionsReader().createQuery()
Set rev1 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 1)
.add(AuditRestrictions.eq("reference", new SetRefEdMulIdEntity(id3, null)))
.getResultList());
Set rev2_related = new HashSet(getVersionsReader().createQuery()
Set rev2_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
Set rev2 = new HashSet(getVersionsReader().createQuery()
Set rev2 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 2)
.add(AuditRestrictions.eq("reference", new SetRefEdMulIdEntity(id3, null)))
.getResultList());
Set rev3_related = new HashSet(getVersionsReader().createQuery()
Set rev3_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
Set rev3 = new HashSet(getVersionsReader().createQuery()
Set rev3 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
.add(AuditRestrictions.eq("reference", new SetRefEdMulIdEntity(id3, null)))
.getResultList());
@ -145,17 +145,17 @@ public class MulIdOneToManyQuery extends AbstractEntityTest {
@Test
public void testEntitiesReferencedToId4() {
Set rev1_related = new HashSet(getVersionsReader().createQuery()
Set rev1_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
Set rev2_related = new HashSet(getVersionsReader().createQuery()
Set rev2_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
Set rev3_related = new HashSet(getVersionsReader().createQuery()
Set rev3_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
@ -167,19 +167,19 @@ public class MulIdOneToManyQuery extends AbstractEntityTest {
@Test
public void testEntitiesReferencedByIng1ToId3() {
List rev1_related = getVersionsReader().createQuery()
List rev1_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
.getResultList();
Object rev2_related = getVersionsReader().createQuery()
Object rev2_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
.getSingleResult();
Object rev3_related = getVersionsReader().createQuery()
Object rev3_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
@ -192,19 +192,19 @@ public class MulIdOneToManyQuery extends AbstractEntityTest {
@Test
public void testEntitiesReferencedByIng2ToId3() {
List rev1_related = getVersionsReader().createQuery()
List rev1_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))
.getResultList();
List rev2_related = getVersionsReader().createQuery()
List rev2_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))
.getResultList();
Object rev3_related = getVersionsReader().createQuery()
Object rev3_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))

View File

@ -80,25 +80,25 @@ public class Custom extends AbstractEntityTest {
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
}
@Test
public void testDatesForRevisions() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@ -108,7 +108,7 @@ public class Custom extends AbstractEntityTest {
@Test
public void testFindRevision() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(CustomRevEntity.class, 1).getCustomTimestamp();
assert rev1Timestamp > timestamp1;
@ -121,7 +121,7 @@ public class Custom extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@ -129,7 +129,7 @@ public class Custom extends AbstractEntityTest {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}

View File

@ -79,25 +79,25 @@ public class CustomBoxed extends AbstractEntityTest {
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
}
@Test
public void testDatesForRevisions() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@ -107,7 +107,7 @@ public class CustomBoxed extends AbstractEntityTest {
@Test
public void testFindRevision() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(CustomBoxedRevEntity.class, 1).getCustomTimestamp();
assert rev1Timestamp > timestamp1;
@ -120,7 +120,7 @@ public class CustomBoxed extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@ -128,7 +128,7 @@ public class CustomBoxed extends AbstractEntityTest {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}

View File

@ -80,25 +80,25 @@ public class CustomPropertyAccess extends AbstractEntityTest {
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
}
@Test
public void testDatesForRevisions() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@ -108,7 +108,7 @@ public class CustomPropertyAccess extends AbstractEntityTest {
@Test
public void testFindRevision() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(CustomPropertyAccessRevEntity.class, 1).getCustomTimestamp();
assert rev1Timestamp > timestamp1;
@ -121,7 +121,7 @@ public class CustomPropertyAccess extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@ -129,7 +129,7 @@ public class CustomPropertyAccess extends AbstractEntityTest {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}

View File

@ -79,25 +79,25 @@ public class Inherited extends AbstractEntityTest {
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
}
@Test
public void testDatesForRevisions() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@ -107,7 +107,7 @@ public class Inherited extends AbstractEntityTest {
@Test
public void testFindRevision() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(InheritedRevEntity.class, 1).getTimestamp();
assert rev1Timestamp > timestamp1;
@ -120,7 +120,7 @@ public class Inherited extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@ -128,7 +128,7 @@ public class Inherited extends AbstractEntityTest {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}

View File

@ -85,25 +85,25 @@ public class Listener extends AbstractEntityTest {
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
}
@Test
public void testDatesForRevisions() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@ -113,7 +113,7 @@ public class Listener extends AbstractEntityTest {
@Test
public void testFindRevision() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
ListenerRevEntity rev1Data = vr.findRevision(ListenerRevEntity.class, 1);
ListenerRevEntity rev2Data = vr.findRevision(ListenerRevEntity.class, 2);
@ -133,7 +133,7 @@ public class Listener extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@ -141,7 +141,7 @@ public class Listener extends AbstractEntityTest {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}

View File

@ -64,7 +64,7 @@ public class LongRevNumber extends AbstractEntityTest {
@Test
public void testFindRevision() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.findRevision(LongRevNumberRevEntity.class, 1l).getCustomId() == 1l;
assert vr.findRevision(LongRevNumberRevEntity.class, 2l).getCustomId() == 2l;
@ -72,7 +72,7 @@ public class LongRevNumber extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1l, 2l).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
assert Arrays.asList(1l, 2l).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@ -80,7 +80,7 @@ public class LongRevNumber extends AbstractEntityTest {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
assert getVersionsReader().find(StrTestEntity.class, id, 1l).equals(ver1);
assert getVersionsReader().find(StrTestEntity.class, id, 2l).equals(ver2);
assert getAuditReader().find(StrTestEntity.class, id, 1l).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2l).equals(ver2);
}
}

View File

@ -87,19 +87,19 @@ public class RevisionForDate extends AbstractEntityTest {
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp4)).intValue() == 3;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
assert getAuditReader().getRevisionNumberForDate(new Date(timestamp4)).intValue() == 3;
}
@Test
public void testDatesForRevisions() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(3)).intValue() == 3;
@ -107,7 +107,7 @@ public class RevisionForDate extends AbstractEntityTest {
@Test
public void testRevisionsForDates() {
AuditReader vr = getVersionsReader();
AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;

View File

@ -64,8 +64,8 @@ public class SameIds extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SameIdTestEntity1.class, 1));
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SameIdTestEntity2.class, 1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SameIdTestEntity1.class, 1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SameIdTestEntity2.class, 1));
}
@Test
@ -73,8 +73,8 @@ public class SameIds extends AbstractEntityTest {
SameIdTestEntity1 ver1 = new SameIdTestEntity1(1, "str1");
SameIdTestEntity1 ver2 = new SameIdTestEntity1(1, "str2");
assert getVersionsReader().find(SameIdTestEntity1.class, 1, 1).equals(ver1);
assert getVersionsReader().find(SameIdTestEntity1.class, 1, 2).equals(ver2);
assert getAuditReader().find(SameIdTestEntity1.class, 1, 1).equals(ver1);
assert getAuditReader().find(SameIdTestEntity1.class, 1, 2).equals(ver2);
}
@Test
@ -82,7 +82,7 @@ public class SameIds extends AbstractEntityTest {
SameIdTestEntity2 ver1 = new SameIdTestEntity2(1, "str1");
SameIdTestEntity2 ver2 = new SameIdTestEntity2(1, "str2");
assert getVersionsReader().find(SameIdTestEntity2.class, 1, 1).equals(ver1);
assert getVersionsReader().find(SameIdTestEntity2.class, 1, 2).equals(ver2);
assert getAuditReader().find(SameIdTestEntity2.class, 1, 1).equals(ver1);
assert getAuditReader().find(SameIdTestEntity2.class, 1, 2).equals(ver2);
}
}

View File

@ -72,7 +72,7 @@ public class BasicSecondary extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SecondaryTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SecondaryTestEntity.class, id));
}
@Test
@ -80,8 +80,8 @@ public class BasicSecondary extends AbstractEntityTest {
SecondaryTestEntity ver1 = new SecondaryTestEntity(id, "a", "1");
SecondaryTestEntity ver2 = new SecondaryTestEntity(id, "b", "2");
assert getVersionsReader().find(SecondaryTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(SecondaryTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(SecondaryTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(SecondaryTestEntity.class, id, 2).equals(ver2);
}
@SuppressWarnings({"unchecked"})

View File

@ -72,7 +72,7 @@ public class NamingSecondary extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SecondaryNamingTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SecondaryNamingTestEntity.class, id));
}
@Test
@ -80,8 +80,8 @@ public class NamingSecondary extends AbstractEntityTest {
SecondaryNamingTestEntity ver1 = new SecondaryNamingTestEntity(id, "a", "1");
SecondaryNamingTestEntity ver2 = new SecondaryNamingTestEntity(id, "b", "2");
assert getVersionsReader().find(SecondaryNamingTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(SecondaryNamingTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(SecondaryNamingTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(SecondaryNamingTestEntity.class, id, 2).equals(ver2);
}
@SuppressWarnings({"unchecked"})

View File

@ -71,7 +71,7 @@ public class EmbIdSecondary extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SecondaryEmbIdTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SecondaryEmbIdTestEntity.class, id));
}
@Test
@ -79,8 +79,8 @@ public class EmbIdSecondary extends AbstractEntityTest {
SecondaryEmbIdTestEntity ver1 = new SecondaryEmbIdTestEntity(id, "a", "1");
SecondaryEmbIdTestEntity ver2 = new SecondaryEmbIdTestEntity(id, "b", "2");
assert getVersionsReader().find(SecondaryEmbIdTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(SecondaryEmbIdTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(SecondaryEmbIdTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(SecondaryEmbIdTestEntity.class, id, 2).equals(ver2);
}
@SuppressWarnings({"unchecked"})

View File

@ -71,7 +71,7 @@ public class MulIdSecondary extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SecondaryMulIdTestEntity.class, id));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SecondaryMulIdTestEntity.class, id));
}
@Test
@ -79,8 +79,8 @@ public class MulIdSecondary extends AbstractEntityTest {
SecondaryMulIdTestEntity ver1 = new SecondaryMulIdTestEntity(id, "a", "1");
SecondaryMulIdTestEntity ver2 = new SecondaryMulIdTestEntity(id, "b", "2");
assert getVersionsReader().find(SecondaryMulIdTestEntity.class, id, 1).equals(ver1);
assert getVersionsReader().find(SecondaryMulIdTestEntity.class, id, 2).equals(ver2);
assert getAuditReader().find(SecondaryMulIdTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(SecondaryMulIdTestEntity.class, id, 2).equals(ver2);
}
@SuppressWarnings({"unchecked"})

View File

@ -61,7 +61,7 @@ public class MappedSubclassing extends AbstractEntityTest {
@Test
public void testRevisionsCounts() {
assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SubclassEntity.class, id1));
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SubclassEntity.class, id1));
}
@Test
@ -69,7 +69,7 @@ public class MappedSubclassing extends AbstractEntityTest {
SubclassEntity ver1 = new SubclassEntity(id1, "x");
SubclassEntity ver2 = new SubclassEntity(id1, "y");
assert getVersionsReader().find(SubclassEntity.class, id1, 1).equals(ver1);
assert getVersionsReader().find(SubclassEntity.class, id1, 2).equals(ver2);
assert getAuditReader().find(SubclassEntity.class, id1, 1).equals(ver1);
assert getAuditReader().find(SubclassEntity.class, id1, 2).equals(ver2);
}
}