HHH-7187 - tests fail on sybase
This commit is contained in:
parent
37aecde965
commit
96e23180d7
|
@ -27,6 +27,7 @@ package org.hibernate.envers.test.integration.accesstype;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.hibernate.ejb.Ejb3Configuration;
|
import org.hibernate.ejb.Ejb3Configuration;
|
||||||
|
@ -61,15 +62,14 @@ public class FieldAccessType extends AbstractEntityTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRevisionsCounts() {
|
public void testRevisionsCounts() {
|
||||||
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(FieldAccessTypeEntity.class, id1));
|
Assert.assertEquals( Arrays.asList( 1, 2 ), getAuditReader().getRevisions(FieldAccessTypeEntity.class, id1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHistoryOfId1() {
|
public void testHistoryOfId1() {
|
||||||
FieldAccessTypeEntity ver1 = new FieldAccessTypeEntity(id1, "data");
|
FieldAccessTypeEntity ver1 = new FieldAccessTypeEntity(id1, "data");
|
||||||
FieldAccessTypeEntity ver2 = new FieldAccessTypeEntity(id1, "data2");
|
FieldAccessTypeEntity ver2 = new FieldAccessTypeEntity(id1, "data2");
|
||||||
|
Assert.assertEquals(getAuditReader().find(FieldAccessTypeEntity.class, id1, 1), ver1);
|
||||||
assert getAuditReader().find(FieldAccessTypeEntity.class, id1, 1).equals(ver1);
|
Assert.assertEquals(getAuditReader().find(FieldAccessTypeEntity.class, id1, 2), ver2);
|
||||||
assert getAuditReader().find(FieldAccessTypeEntity.class, id1, 2).equals(ver2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -28,6 +28,7 @@ import javax.persistence.EntityManager;
|
||||||
import javax.transaction.RollbackException;
|
import javax.transaction.RollbackException;
|
||||||
import javax.transaction.TransactionManager;
|
import javax.transaction.TransactionManager;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.hibernate.ejb.Ejb3Configuration;
|
import org.hibernate.ejb.Ejb3Configuration;
|
||||||
|
@ -83,7 +84,7 @@ public class JtaExceptionListener extends AbstractEntityTest {
|
||||||
newEntityManager();
|
newEntityManager();
|
||||||
EntityManager em = getEntityManager();
|
EntityManager em = getEntityManager();
|
||||||
Long count = (Long) em.createQuery("select count(s) from StrTestEntity s where s.str = 'x'").getSingleResult();
|
Long count = (Long) em.createQuery("select count(s) from StrTestEntity s where s.str = 'x'").getSingleResult();
|
||||||
assert count == 0l;
|
Assert.assertEquals( Long.valueOf( 0 ), count );
|
||||||
} finally {
|
} finally {
|
||||||
tryCommit(tm);
|
tryCommit(tm);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.util.Set;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import static org.junit.Assert.*;
|
||||||
import org.hibernate.ejb.Ejb3Configuration;
|
import org.hibernate.ejb.Ejb3Configuration;
|
||||||
import org.hibernate.envers.query.AuditEntity;
|
import org.hibernate.envers.query.AuditEntity;
|
||||||
import org.hibernate.envers.test.AbstractEntityTest;
|
import org.hibernate.envers.test.AbstractEntityTest;
|
||||||
|
@ -133,15 +133,13 @@ public class MulIdOneToManyQuery extends AbstractEntityTest {
|
||||||
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
|
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
|
||||||
.add(AuditEntity.property("reference").eq(new SetRefEdMulIdEntity(id3, null)))
|
.add(AuditEntity.property("reference").eq(new SetRefEdMulIdEntity(id3, null)))
|
||||||
.getResultList());
|
.getResultList());
|
||||||
|
assertEquals( rev1, rev1_related );
|
||||||
assert rev1.equals(rev1_related);
|
assertEquals( rev2, rev2_related );
|
||||||
assert rev2.equals(rev2_related);
|
assertEquals( rev3, rev3_related );
|
||||||
assert rev3.equals(rev3_related);
|
assertEquals( rev1, TestTools.makeSet() );
|
||||||
|
assertEquals( rev2, TestTools.makeSet(new SetRefIngMulIdEntity(id1, "x", null)) );
|
||||||
assert rev1.equals(TestTools.makeSet());
|
assertEquals( rev3, TestTools.makeSet(new SetRefIngMulIdEntity(id1, "x", null),
|
||||||
assert rev2.equals(TestTools.makeSet(new SetRefIngMulIdEntity(id1, "x", null)));
|
new SetRefIngMulIdEntity(id2, "y", null)) );
|
||||||
assert rev3.equals(TestTools.makeSet(new SetRefIngMulIdEntity(id1, "x", null),
|
|
||||||
new SetRefIngMulIdEntity(id2, "y", null)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -160,10 +158,9 @@ public class MulIdOneToManyQuery extends AbstractEntityTest {
|
||||||
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
|
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
|
||||||
.add(AuditEntity.relatedId("reference").eq(id4))
|
.add(AuditEntity.relatedId("reference").eq(id4))
|
||||||
.getResultList());
|
.getResultList());
|
||||||
|
assertEquals( rev1_related, TestTools.makeSet( ));
|
||||||
assert rev1_related.equals(TestTools.makeSet());
|
assertEquals( rev2_related, TestTools.makeSet(new SetRefIngMulIdEntity(id2, "y", null)));
|
||||||
assert rev2_related.equals(TestTools.makeSet(new SetRefIngMulIdEntity(id2, "y", null)));
|
assertEquals( rev3_related, TestTools.makeSet( ));
|
||||||
assert rev3_related.equals(TestTools.makeSet());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -185,10 +182,9 @@ public class MulIdOneToManyQuery extends AbstractEntityTest {
|
||||||
.add(AuditEntity.relatedId("reference").eq(id3))
|
.add(AuditEntity.relatedId("reference").eq(id3))
|
||||||
.add(AuditEntity.id().eq(id1))
|
.add(AuditEntity.id().eq(id1))
|
||||||
.getSingleResult();
|
.getSingleResult();
|
||||||
|
assertEquals( 0, rev1_related.size() );
|
||||||
assert rev1_related.size() == 0;
|
assertEquals( rev2_related,new SetRefIngMulIdEntity(id1, "x", null) );
|
||||||
assert rev2_related.equals(new SetRefIngMulIdEntity(id1, "x", null));
|
assertEquals( rev3_related, new SetRefIngMulIdEntity(id1, "x", null) );
|
||||||
assert rev3_related.equals(new SetRefIngMulIdEntity(id1, "x", null));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -210,9 +206,8 @@ public class MulIdOneToManyQuery extends AbstractEntityTest {
|
||||||
.add(AuditEntity.relatedId("reference").eq(id3))
|
.add(AuditEntity.relatedId("reference").eq(id3))
|
||||||
.add(AuditEntity.id().eq(id2))
|
.add(AuditEntity.id().eq(id2))
|
||||||
.getSingleResult();
|
.getSingleResult();
|
||||||
|
assertEquals( 0, rev1_related );
|
||||||
assert rev1_related.size() == 0;
|
assertEquals( 0, rev2_related );
|
||||||
assert rev2_related.size() == 0;
|
assertEquals( new SetRefIngMulIdEntity(id2, "y", null), rev3_related );
|
||||||
assert rev3_related.equals(new SetRefIngMulIdEntity(id2, "y", null));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue