HHH-8505: Test that counts the revisions
This commit is contained in:
parent
4e93c91050
commit
e971a8e14a
|
@ -1,6 +1,7 @@
|
||||||
package org.hibernate.envers.test.integration.components.dynamic;
|
package org.hibernate.envers.test.integration.components.dynamic;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -176,6 +177,11 @@ public class AuditedDynamicComponentsAdvancedCasesTest extends BaseEnversFunctio
|
||||||
session.save( advancedEntity );
|
session.save( advancedEntity );
|
||||||
session.getTransaction().commit();
|
session.getTransaction().commit();
|
||||||
|
|
||||||
|
//rev this, should not create revision
|
||||||
|
session.getTransaction().begin();
|
||||||
|
session.getTransaction().commit();
|
||||||
|
|
||||||
|
//sanity check. Loaded entity should be equal to one that we created.
|
||||||
AdvancedEntity advancedEntityActual = (AdvancedEntity) session.load( AdvancedEntity.class, 1L );
|
AdvancedEntity advancedEntityActual = (AdvancedEntity) session.load( AdvancedEntity.class, 1L );
|
||||||
|
|
||||||
Assert.assertEquals( advancedEntity, advancedEntityActual );
|
Assert.assertEquals( advancedEntity, advancedEntityActual );
|
||||||
|
@ -353,4 +359,12 @@ public class AuditedDynamicComponentsAdvancedCasesTest extends BaseEnversFunctio
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRevisionsCounts() {
|
||||||
|
Assert.assertEquals(
|
||||||
|
Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9 ),
|
||||||
|
getAuditReader().getRevisions( AdvancedEntity.class, 1L )
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue