HHH-7669: JtaTransaction test fails on Oracle RAC

https://hibernate.onjira.com/browse/HHH-7669
This commit is contained in:
brmeyer 2012-10-23 17:44:36 -04:00
parent 5e158e8861
commit 1a00abc3a6
1 changed files with 22 additions and 17 deletions

View File

@ -1,18 +1,17 @@
package org.hibernate.envers.test.integration.jta;
import javax.persistence.EntityManager;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;
import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase;
import org.hibernate.envers.test.Priority;
import org.hibernate.envers.test.entities.IntTestEntity;
import org.junit.Assert;
import org.junit.Test;
import org.hibernate.testing.jta.TestingJtaBootstrap;
import org.hibernate.testing.jta.TestingJtaPlatformImpl;
import org.junit.Assert;
import org.junit.Test;
/**
* Same as {@link org.hibernate.envers.test.integration.basic.Simple}, but in a JTA environment.
@ -60,17 +59,23 @@ public class JtaTransaction extends BaseEnversJPAFunctionalTestCase {
em.close();
}
@Test
public void testRevisionsCounts() throws Exception {
Assert.assertEquals(Arrays.asList(1, 2), getAuditReader().getRevisions(IntTestEntity.class, id1));
}
@Test
public void testRevisionsCounts() throws Exception {
Assert.assertEquals( 2, getAuditReader().getRevisions(
IntTestEntity.class, id1 ).size() );
}
@Test
public void testHistoryOfId1() {
IntTestEntity ver1 = new IntTestEntity(10, id1);
IntTestEntity ver2 = new IntTestEntity(20, id1);
@Test
public void testHistoryOfId1() {
IntTestEntity ver1 = new IntTestEntity( 10, id1 );
IntTestEntity ver2 = new IntTestEntity( 20, id1 );
Assert.assertEquals(ver1, getAuditReader().find(IntTestEntity.class, id1, 1));
Assert.assertEquals(ver2, getAuditReader().find(IntTestEntity.class, id1, 2));
}
List<Number> revisions = getAuditReader().getRevisions(
IntTestEntity.class, id1 );
Assert.assertEquals( ver1, getAuditReader().find(
IntTestEntity.class, id1, revisions.get( 0 ) ) );
Assert.assertEquals( ver2, getAuditReader().find(
IntTestEntity.class, id1, revisions.get( 1 ) ) );
}
}