HHH-6014: Migrating the tests from testng to junit
This commit is contained in:
parent
26b5e1afa8
commit
fb512cdc25
|
@ -23,12 +23,13 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.accesstype;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -40,7 +41,7 @@ public class FieldAccessType extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(FieldAccessTypeEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package org.hibernate.envers.test.integration.accesstype;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class ImmutableClassAccessType extends AbstractEntityTest {
|
||||
private Country country;
|
||||
|
@ -14,7 +16,7 @@ public class ImmutableClassAccessType extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(Country.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.accesstype;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -39,7 +40,7 @@ public class MixedAccessType extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(MixedAccessTypeEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.accesstype;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -39,7 +40,7 @@ public class PropertyAccessType extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(PropertyAccessTypeEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.auditReader;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.exception.NotAuditedException;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* A test which checks the correct behavior of AuditReader.isEntityClassAudited(Class entityClass).
|
||||
|
@ -41,7 +42,7 @@ public class AuditReaderAPITest extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(NotAuditedTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.basic;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class Delete extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(BasicTestEntity2.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.basic;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -39,7 +40,7 @@ public class GlobalVersioned extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(BasicTestEntity4.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.basic;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class ManyOperationsInTransaction extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(BasicTestEntity1.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.basic;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.exception.NotAuditedException;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -36,10 +37,11 @@ public class NotVersioned extends AbstractEntityTest {
|
|||
private Integer id1;
|
||||
|
||||
public void configure(Ejb3Configuration cfg) {
|
||||
cfg.addAnnotatedClass(BasicTestEntity1.class);
|
||||
cfg.addAnnotatedClass(BasicTestEntity3.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
@ -55,12 +57,12 @@ public class NotVersioned extends AbstractEntityTest {
|
|||
em.getTransaction().commit();
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = NotAuditedException.class)
|
||||
@Test(expected = NotAuditedException.class)
|
||||
public void testRevisionsCounts() {
|
||||
getAuditReader().getRevisions(BasicTestEntity3.class, id1);
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = NotAuditedException.class)
|
||||
@Test(expected = NotAuditedException.class)
|
||||
public void testHistoryOfId1() {
|
||||
getAuditReader().find(BasicTestEntity3.class, id1, 1);
|
||||
}
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.basic;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -59,7 +60,7 @@ public class NullProperties extends AbstractEntityTest {
|
|||
em.getTransaction().commit();
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
id1 = addNewEntity("x", 1); // rev 1
|
||||
id2 = addNewEntity(null, 20); // rev 2
|
||||
|
|
|
@ -22,12 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.basic;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.IntTestEntity;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -54,12 +56,12 @@ public class Simple extends AbstractEntityTest {
|
|||
em.getTransaction().commit();
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "initData")
|
||||
@Test
|
||||
public void testRevisionsCounts() {
|
||||
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(IntTestEntity.class, id1));
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "initData")
|
||||
@Test
|
||||
public void testHistoryOfId1() {
|
||||
IntTestEntity ver1 = new IntTestEntity(10, id1);
|
||||
IntTestEntity ver2 = new IntTestEntity(20, id1);
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.basic;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.exception.RevisionDoesNotExistException;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -61,7 +62,7 @@ public class SingleOperationInTransaction extends AbstractEntityTest {
|
|||
em.getTransaction().commit();
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
id1 = addNewEntity("x", 1); // rev 1
|
||||
id2 = addNewEntity("y", 20); // rev 2
|
||||
|
@ -91,12 +92,12 @@ public class SingleOperationInTransaction extends AbstractEntityTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = RevisionDoesNotExistException.class)
|
||||
@Test(expected = RevisionDoesNotExistException.class)
|
||||
public void testNotExistingRevision() {
|
||||
getAuditReader().getRevisionDate(8);
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testIllegalRevision() {
|
||||
getAuditReader().getRevisionDate(0);
|
||||
}
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.basic;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -58,7 +59,7 @@ public class UnversionedPropertiesChange extends AbstractEntityTest {
|
|||
em.getTransaction().commit();
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
id1 = addNewEntity("x", "a"); // rev 1
|
||||
modifyEntity(id1, "x", "a"); // no rev
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.basic;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.UnversionedEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -40,7 +41,7 @@ public class UnversionedProperty extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(UnversionedEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.cache;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.onetomany.SetRefEdEntity;
|
||||
import org.hibernate.envers.test.entities.onetomany.SetRefIngEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -46,7 +47,7 @@ public class OneToManyCache extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(SetRefIngEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.cache;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.integration.onetoone.bidirectional.BiRefEdEntity;
|
||||
import org.hibernate.envers.test.integration.onetoone.bidirectional.BiRefIngEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class OneToOneCache extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(BiRefIngEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
BiRefEdEntity ed1 = new BiRefEdEntity(1, "data_ed_1");
|
||||
BiRefEdEntity ed2 = new BiRefEdEntity(2, "data_ed_2");
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.cache;
|
||||
import java.util.List;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.IntTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class QueryCache extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(IntTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,16 +22,17 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.collection;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.collection.EnumSetEntity;
|
||||
import org.hibernate.envers.test.entities.collection.EnumSetEntity.E1;
|
||||
import org.hibernate.envers.test.entities.collection.EnumSetEntity.E2;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -43,7 +44,7 @@ public class EnumSet extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(EnumSetEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.collection;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.collection.StringListEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -43,7 +44,7 @@ public class StringList extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(StringListEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.collection;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.collection.StringMapEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -43,7 +44,7 @@ public class StringMap extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(StringMapEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.collection;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.collection.StringSetEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -43,7 +44,7 @@ public class StringSet extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(StringSetEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,16 +22,17 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.collection.mapkey;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.components.Component1;
|
||||
import org.hibernate.envers.test.entities.components.Component2;
|
||||
import org.hibernate.envers.test.entities.components.ComponentTestEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -47,7 +48,7 @@ public class ComponentMapKey extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ComponentTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,14 +22,15 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.collection.mapkey;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class IdMapKey extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(StrTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package org.hibernate.envers.test.integration.collection.norevision;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractSessionTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractCollectionChangeTest extends AbstractSessionTest {
|
||||
protected Integer personId;
|
||||
|
@ -20,7 +21,7 @@ public abstract class AbstractCollectionChangeTest extends AbstractSessionTest {
|
|||
|
||||
protected abstract List<Integer> getExpectedPersonRevisions();
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
newSessionFactory();
|
||||
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.components;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.components.Component1;
|
||||
import org.hibernate.envers.test.entities.components.Component2;
|
||||
import org.hibernate.envers.test.entities.components.ComponentTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class Components extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ComponentTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,17 +22,19 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.components;
|
||||
import static org.hibernate.testing.TestLogger.LOG;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.components.DefaultValueComponent1;
|
||||
import org.hibernate.envers.test.entities.components.DefaultValueComponent2;
|
||||
import org.hibernate.envers.test.entities.components.DefaultValueComponentTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.hibernate.testing.TestLogger.*;
|
||||
|
||||
/**
|
||||
* Test class for components with default values.
|
||||
|
@ -58,7 +60,7 @@ public class DefaultValueComponents extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(DefaultValueComponentTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,20 +22,23 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.components.collections;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.components.Component1;
|
||||
import org.hibernate.envers.test.entities.components.ComponentSetTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* TODO: enable and implement
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
*/
|
||||
@Ignore
|
||||
public class CollectionOfComponents extends AbstractEntityTest {
|
||||
private Integer id1;
|
||||
|
||||
|
@ -43,7 +46,7 @@ public class CollectionOfComponents extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ComponentSetTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
@ -68,12 +71,12 @@ public class CollectionOfComponents extends AbstractEntityTest {
|
|||
id1 = cte1.getId();
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void testRevisionsCounts() {
|
||||
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ComponentSetTestEntity.class, id1));
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void testHistoryOfId1() {
|
||||
assert getAuditReader().find(ComponentSetTestEntity.class, id1, 1).getComps().size() == 0;
|
||||
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.components.relations;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.hibernate.envers.test.entities.components.relations.ManyToOneComponent;
|
||||
import org.hibernate.envers.test.entities.components.relations.ManyToOneComponentTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class ManyToOneInComponent extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(StrTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.components.relations;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.UnversionedStrTestEntity;
|
||||
import org.hibernate.envers.test.entities.components.relations.NotAuditedManyToOneComponent;
|
||||
import org.hibernate.envers.test.entities.components.relations.NotAuditedManyToOneComponentTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -43,7 +44,7 @@ public class NotAuditedManyToOneInComponent extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(UnversionedStrTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// No revision
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.components.relations;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.hibernate.envers.test.entities.components.relations.OneToManyComponent;
|
||||
import org.hibernate.envers.test.entities.components.relations.OneToManyComponentTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class OneToManyInComponent extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(StrTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,14 +22,15 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.customtype;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.customtype.Component;
|
||||
import org.hibernate.envers.test.entities.customtype.CompositeCustomTypeEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class CompositeCustom extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(CompositeCustomTypeEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.customtype;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.customtype.ParametrizedCustomTypeEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -40,7 +41,7 @@ public class ParametrizedCustom extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ParametrizedCustomTypeEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.data;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -40,7 +41,7 @@ public class Dates extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(DateTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.data;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -39,7 +40,7 @@ public class Enums extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(EnumTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
|
|
@ -25,8 +25,7 @@ package org.hibernate.envers.test.integration.data;
|
|||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
@ -41,7 +40,7 @@ public class LobSerializables extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(LobSerializableTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.data;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -39,7 +40,7 @@ public class Lobs extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(LobTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.data;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -39,7 +40,7 @@ public class Serializables extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(SerializableTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
package org.hibernate.envers.test.integration.entityNames.auditedEntity;
|
||||
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hernán Chanfreau
|
||||
*
|
||||
*/
|
||||
|
||||
@Test(sequential=true)
|
||||
public class ReadEntityWhitEntityNameTest extends AbstractOneSessionTest{
|
||||
|
||||
private long id_pers1;
|
||||
|
@ -32,7 +31,7 @@ public class ReadEntityWhitEntityNameTest extends AbstractOneSessionTest{
|
|||
}
|
||||
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
|
||||
initializeSession();
|
||||
|
@ -86,7 +85,7 @@ public class ReadEntityWhitEntityNameTest extends AbstractOneSessionTest{
|
|||
assert(pers3Revs.size() == 1);
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods="testRetrieveRevisionsWithEntityName")
|
||||
@Test
|
||||
public void testRetrieveAuditedEntityWithEntityName() {
|
||||
person1_1 = getAuditReader().find(Person.class, "Personaje", id_pers1, 1);
|
||||
person1_2 = getAuditReader().find(Person.class, "Personaje", id_pers1, 2);
|
||||
|
@ -98,7 +97,7 @@ public class ReadEntityWhitEntityNameTest extends AbstractOneSessionTest{
|
|||
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods="testRetrieveAuditedEntityWithEntityName")
|
||||
@Test
|
||||
public void testObtainEntityNameAuditedEntityWithEntityName() {
|
||||
|
||||
String currentPers1EN = getSession().getEntityName(currentPers1);
|
||||
|
@ -114,7 +113,7 @@ public class ReadEntityWhitEntityNameTest extends AbstractOneSessionTest{
|
|||
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods="testObtainEntityNameAuditedEntityWithEntityName")
|
||||
@Test
|
||||
public void testRetrieveAuditedEntityWithEntityNameWithNewSession() {
|
||||
|
||||
// force a new session and AR
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
package org.hibernate.envers.test.integration.entityNames.manyToManyAudited;
|
||||
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hernán Chanfreau
|
||||
*
|
||||
*/
|
||||
|
||||
@Test(sequential=true)
|
||||
public class ReadEntityWithAuditedManyToManyTest extends AbstractOneSessionTest{
|
||||
|
||||
private long id_car1;
|
||||
|
@ -34,7 +33,7 @@ public class ReadEntityWithAuditedManyToManyTest extends AbstractOneSessionTest{
|
|||
}
|
||||
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
|
||||
initializeSession();
|
||||
|
@ -117,7 +116,7 @@ public class ReadEntityWithAuditedManyToManyTest extends AbstractOneSessionTest{
|
|||
}
|
||||
|
||||
|
||||
@Test(dependsOnMethods="testGetEntityNameManyYoManyWithEntityName")
|
||||
@Test
|
||||
public void testGetEntityNameManyYoManyWithEntityNameInNewSession() {
|
||||
//force new session and AR
|
||||
forceNewSession();
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
package org.hibernate.envers.test.integration.entityNames.oneToManyAudited;
|
||||
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hernán Chanfreau
|
||||
*
|
||||
*/
|
||||
|
||||
@Test(sequential=true)
|
||||
public class ReadEntityWithAuditedCollectionTest extends AbstractOneSessionTest{
|
||||
|
||||
private long id_car1;
|
||||
|
@ -34,7 +33,7 @@ public class ReadEntityWithAuditedCollectionTest extends AbstractOneSessionTest{
|
|||
}
|
||||
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
|
||||
initializeSession();
|
||||
|
@ -112,7 +111,7 @@ public class ReadEntityWithAuditedCollectionTest extends AbstractOneSessionTest{
|
|||
|
||||
|
||||
|
||||
@Test(dependsOnMethods="testObtainEntityNameAuditedCollectionWithEntityName")
|
||||
@Test
|
||||
public void testObtainEntityNameAuditedCollectionWithEntityNameInNewSession() {
|
||||
// force a new session and AR
|
||||
forceNewSession();
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
package org.hibernate.envers.test.integration.entityNames.oneToManyNotAudited;
|
||||
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hernán Chanfreau
|
||||
*
|
||||
*/
|
||||
|
||||
@Test(sequential=true)
|
||||
public class ReadEntityWithAuditedCollectionTest extends AbstractOneSessionTest{
|
||||
|
||||
private long id_car1;
|
||||
|
@ -33,7 +32,7 @@ public class ReadEntityWithAuditedCollectionTest extends AbstractOneSessionTest{
|
|||
}
|
||||
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
|
||||
initializeSession();
|
||||
|
@ -109,7 +108,7 @@ public class ReadEntityWithAuditedCollectionTest extends AbstractOneSessionTest{
|
|||
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods="testObtainEntityNameCollectionWithEntityNameAndNotAuditedMode")
|
||||
@Test
|
||||
public void testObtainEntityNameCollectionWithEntityNameAndNotAuditedModeInNewSession() {
|
||||
// force new session and AR
|
||||
forceNewSession();
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
package org.hibernate.envers.test.integration.entityNames.singleAssociatedAudited;
|
||||
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hernán Chanfreau
|
||||
*
|
||||
*/
|
||||
|
||||
@Test(sequential=true)
|
||||
public class ReadEntityAssociatedAuditedTest extends AbstractOneSessionTest{
|
||||
|
||||
private long id_car1;
|
||||
|
@ -36,7 +35,7 @@ public class ReadEntityAssociatedAuditedTest extends AbstractOneSessionTest{
|
|||
}
|
||||
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
|
||||
initializeSession();
|
||||
|
@ -105,7 +104,7 @@ public class ReadEntityAssociatedAuditedTest extends AbstractOneSessionTest{
|
|||
}
|
||||
|
||||
|
||||
@Test(dependsOnMethods="testGetAssociationWithEntityName")
|
||||
@Test
|
||||
public void testGetAssociationWithEntityNameInNewSession() {
|
||||
//force a new session and AR
|
||||
forceNewSession();
|
||||
|
@ -116,15 +115,6 @@ public class ReadEntityAssociatedAuditedTest extends AbstractOneSessionTest{
|
|||
|
||||
checkEntityNames();
|
||||
|
||||
//
|
||||
// Car car1 = getAuditReader().find(Car.class, id_car1, 1);
|
||||
// car1.getOwner().getName();
|
||||
// Car car2 = getAuditReader().find(Car.class, id_car2, 2);
|
||||
// car2.getOwner().getName();
|
||||
//
|
||||
// Person person = getAuditReader().find(Person.class, "Personaje", id_car2, 2);
|
||||
// person.getName();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
package org.hibernate.envers.test.integration.entityNames.singleAssociatedNotAudited;
|
||||
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.envers.test.AbstractOneSessionTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hernán Chanfreau
|
||||
*
|
||||
*/
|
||||
|
||||
@Test(sequential=true)
|
||||
public class ReadEntityAssociatedNotAuditedTest extends AbstractOneSessionTest {
|
||||
|
||||
private long id_car1;
|
||||
|
@ -34,7 +33,7 @@ public class ReadEntityAssociatedNotAuditedTest extends AbstractOneSessionTest {
|
|||
config.addFile(new File(url.toURI()));
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
|
||||
initializeSession();
|
||||
|
@ -105,7 +104,7 @@ public class ReadEntityAssociatedNotAuditedTest extends AbstractOneSessionTest {
|
|||
}
|
||||
|
||||
|
||||
@Test(dependsOnMethods="testObtainEntityNameAssociationWithEntityNameAndNotAuditedMode")
|
||||
@Test
|
||||
public void testObtainEntityNameAssociationWithEntityNameAndNotAuditedModeInNewSession() {
|
||||
//force a new session and AR
|
||||
forceNewSession();
|
||||
|
|
|
@ -22,14 +22,16 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.flush;
|
||||
import java.io.IOException;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.FlushMode;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -56,7 +58,7 @@ public abstract class AbstractFlushTest extends AbstractEntityTest {
|
|||
throw new RuntimeException("Invalid entity manager");
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initFlush() throws IOException {
|
||||
Session session = getSession(getEntityManager());
|
||||
session.setFlushMode(getFlushMode());
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.flush;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.FlushMode;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -39,7 +40,7 @@ public class DoubleFlushAddDel extends AbstractFlushTest {
|
|||
return FlushMode.MANUAL;
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "initFlush")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,16 +22,18 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.flush;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.FlushMode;
|
||||
import org.hibernate.envers.RevisionType;
|
||||
import org.hibernate.envers.query.AuditEntity;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -43,7 +45,7 @@ public class DoubleFlushAddMod extends AbstractFlushTest {
|
|||
return FlushMode.MANUAL;
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "initFlush")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,16 +22,18 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.flush;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.FlushMode;
|
||||
import org.hibernate.envers.RevisionType;
|
||||
import org.hibernate.envers.query.AuditEntity;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -43,7 +45,7 @@ public class DoubleFlushModDel extends AbstractFlushTest {
|
|||
return FlushMode.MANUAL;
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "initFlush")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,16 +22,18 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.flush;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.FlushMode;
|
||||
import org.hibernate.envers.RevisionType;
|
||||
import org.hibernate.envers.query.AuditEntity;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -43,7 +45,7 @@ public class DoubleFlushModMod extends AbstractFlushTest {
|
|||
return FlushMode.MANUAL;
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "initFlush")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,16 +22,18 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.flush;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.FlushMode;
|
||||
import org.hibernate.envers.RevisionType;
|
||||
import org.hibernate.envers.query.AuditEntity;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -43,7 +45,7 @@ public class ManualFlush extends AbstractFlushTest {
|
|||
return FlushMode.MANUAL;
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "initFlush")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.hashcode;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -42,7 +43,7 @@ public class ChangingHashcode extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(WikiImage.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.ids;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.ids.CompositeDateIdTestEntity;
|
||||
import org.hibernate.envers.test.entities.ids.DateEmbId;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -42,7 +43,7 @@ public class CompositeDateId extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(CompositeDateIdTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
|
||||
// Revision 1
|
||||
|
|
|
@ -22,19 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.ids;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.ids.CustomEnum;
|
||||
import org.hibernate.envers.test.entities.ids.EmbId;
|
||||
import org.hibernate.envers.test.entities.ids.EmbIdTestEntity;
|
||||
import org.hibernate.envers.test.entities.ids.EmbIdWithCustomType;
|
||||
import org.hibernate.envers.test.entities.ids.EmbIdWithCustomTypeTestEntity;
|
||||
import org.hibernate.envers.test.entities.ids.MulId;
|
||||
import org.hibernate.envers.test.entities.ids.MulIdTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.hibernate.envers.test.entities.ids.*;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -53,7 +48,7 @@ public class CompositeIds extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(EmbIdWithCustomTypeTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
id1 = new EmbId(1, 2);
|
||||
id2 = new EmbId(10, 20);
|
||||
|
|
|
@ -22,14 +22,15 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.ids;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.ids.DateIdTestEntity;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class DateId extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(DateIdTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
|
||||
// Revision 1
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package org.hibernate.envers.test.integration.ids;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.hibernate.envers.test.entities.UnversionedStrTestEntity;
|
||||
import org.hibernate.envers.test.entities.ids.ManyToOneIdNotAuditedTestEntity;
|
||||
import org.hibernate.envers.test.entities.ids.ManyToOneNotAuditedEmbId;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
/**
|
||||
* A test checking that when using Envers it is possible to have non-audited entities that use unsupported
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.joined;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class ChildAuditing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ParentEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.joined;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class ChildNullAuditing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ParentEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.joined;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class ParentAuditing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ParentEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,13 +23,14 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.joined.childrelation;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class ChildReferencing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ReferencedEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.joined.emptychild;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class EmptyChildAuditing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ParentEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,13 +23,14 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.joined.notownedrelation;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class NotOwnedBidirectional extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(PersonalContact.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,15 +23,16 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.joined.primarykeyjoin;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.integration.inheritance.joined.ParentEntity;
|
||||
import org.hibernate.mapping.Column;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -44,7 +45,7 @@ public class ChildPrimaryKeyJoinAuditing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ParentEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,13 +23,14 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.joined.relation;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class PolymorphicCollection extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ReferencedEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,13 +23,14 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.joined.relation.unidirectional;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class UnidirectionalDoubleAbstract extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(SetEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.inheritance.single;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -40,7 +41,7 @@ public class ChildAuditing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ParentEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.inheritance.single;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -40,7 +41,7 @@ public class ParentAuditing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ParentEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.inheritance.single.childrelation;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -44,7 +45,7 @@ public class ChildReferencing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ReferencedEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,13 +23,14 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.single.notownedrelation;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class NotOwnedBidirectional extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(PersonalContact.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.inheritance.single.relation;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -44,7 +45,7 @@ public class PolymorphicCollection extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ReferencedEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.tableperclass;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class ChildAuditing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ParentEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.tableperclass;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -41,7 +42,7 @@ public class ParentAuditing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ParentEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,13 +23,14 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.tableperclass.childrelation;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class ChildReferencing extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ReferencedEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,13 +23,14 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.tableperclass.notownedrelation;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class NotOwnedBidirectional extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(PersonalContact.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,13 +23,14 @@
|
|||
*/
|
||||
|
||||
package org.hibernate.envers.test.integration.inheritance.tableperclass.relation;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -45,7 +46,7 @@ public class PolymorphicCollection extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ReferencedEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.interfaces.components;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -39,7 +40,7 @@ public class InterfacesComponents extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ComponentTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
// Revision 1
|
||||
EntityManager em = getEntityManager();
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.allAudited;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.envers.exception.NotAuditedException;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -15,7 +16,7 @@ public abstract class AbstractAllAuditedTest extends AbstractEntityTest {
|
|||
private long ai_id;
|
||||
private long nai_id;
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.allAudited.joined;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.allAudited.AbstractAllAuditedTest;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.allAudited.AbstractAllAuditedTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -19,22 +20,4 @@ public class JoinedAllAuditedTest extends AbstractAllAuditedTest {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void testRetrieveAudited() {
|
||||
super.testRetrieveAudited();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void testRetrieveNonAudited() {
|
||||
super.testRetrieveNonAudited();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void testRevisions() {
|
||||
super.testRevisions();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.allAudited.subclass;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.allAudited.AbstractAllAuditedTest;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.allAudited.AbstractAllAuditedTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -20,22 +21,4 @@ public class SubclassAllAuditedTest extends AbstractAllAuditedTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void testRetrieveAudited() {
|
||||
super.testRetrieveAudited();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void testRetrieveNonAudited() {
|
||||
super.testRetrieveNonAudited();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void testRevisions() {
|
||||
super.testRevisions();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.allAudited.union;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.allAudited.AbstractAllAuditedTest;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.allAudited.AbstractAllAuditedTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -19,22 +20,4 @@ public class UnionAllAuditedTest extends AbstractAllAuditedTest {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void testRetrieveAudited() {
|
||||
super.testRetrieveAudited();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void testRetrieveNonAudited() {
|
||||
super.testRetrieveNonAudited();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void testRevisions() {
|
||||
super.testRevisions();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.envers.exception.NotAuditedException;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -15,7 +16,7 @@ public abstract class AbstractPropertiesAuditedTest extends AbstractEntityTest {
|
|||
|
||||
private static int NUMERITO = 555;
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited.joined;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited.AbstractPropertiesAuditedTest;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited.AbstractPropertiesAuditedTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -20,9 +21,4 @@ public class JoinedPropertiesAuditedTest extends AbstractPropertiesAuditedTest {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetrieveAudited() {
|
||||
super.testRetrieveAudited();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited.subclass;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited.AbstractPropertiesAuditedTest;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited.AbstractPropertiesAuditedTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -21,9 +22,4 @@ public class SubclassPropertiesAuditedTest extends AbstractPropertiesAuditedTest
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetrieveAudited() {
|
||||
super.testRetrieveAudited();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited.union;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited.AbstractPropertiesAuditedTest;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited.AbstractPropertiesAuditedTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -20,9 +21,4 @@ public class UnionPropertiesAuditedTest extends AbstractPropertiesAuditedTest {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetrieveAudited() {
|
||||
super.testRetrieveAudited();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited2;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.envers.exception.NotAuditedException;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -15,7 +16,7 @@ public abstract class AbstractPropertiesAudited2Test extends AbstractEntityTest
|
|||
|
||||
private static int NUMERITO = 555;
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited2.joined;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited2.AbstractPropertiesAudited2Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited2.AbstractPropertiesAudited2Test;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -19,9 +20,4 @@ public class JoinedPropertiesAudited2Test extends AbstractPropertiesAudited2Test
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetrieveAudited() {
|
||||
super.testRetrieveAudited();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited2.subclass;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited2.AbstractPropertiesAudited2Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited2.AbstractPropertiesAudited2Test;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -21,10 +22,4 @@ public class SubclassPropertiesAudited2Test extends AbstractPropertiesAudited2Te
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRetrieveAudited() {
|
||||
super.testRetrieveAudited();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited2.union;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited2.AbstractPropertiesAudited2Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.integration.interfaces.hbm.propertiesAudited2.AbstractPropertiesAudited2Test;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -20,9 +21,4 @@ public class UnionPropertiesAudited2Test extends AbstractPropertiesAudited2Test
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetrieveAudited() {
|
||||
super.testRetrieveAudited();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.interfaces.relation;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -43,7 +44,7 @@ public class InterfacesRelation extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(SetRefIngEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -23,18 +23,14 @@
|
|||
*/
|
||||
package org.hibernate.envers.test.integration.jta;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.transaction.TransactionManager;
|
||||
|
||||
import org.hibernate.envers.test.EnversTestingJtaBootstrap;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.hibernate.envers.test.integration.reventity.ExceptionListenerRevEntity;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.testing.jta.TestingJtaBootstrap;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.transaction.TransactionManager;
|
||||
|
||||
/**
|
||||
* Same as {@link org.hibernate.envers.test.integration.reventity.ExceptionListener}, but in a JTA environment.
|
||||
|
@ -50,7 +46,7 @@ public class JtaExceptionListener extends AbstractEntityTest {
|
|||
tm = addJTAConfig(cfg);
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = RuntimeException.class)
|
||||
@Test(expected = RuntimeException.class)
|
||||
public void testTransactionRollback() throws Exception {
|
||||
tm.begin();
|
||||
|
||||
|
@ -64,7 +60,7 @@ public class JtaExceptionListener extends AbstractEntityTest {
|
|||
tm.commit();
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testTransactionRollback")
|
||||
@Test
|
||||
public void testDataNotPersisted() throws Exception {
|
||||
tm.begin();
|
||||
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
package org.hibernate.envers.test.integration.jta;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.transaction.NotSupportedException;
|
||||
import javax.transaction.SystemException;
|
||||
import javax.transaction.TransactionManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.hibernate.envers.test.EnversTestingJtaBootstrap;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.IntTestEntity;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.testing.jta.TestingJtaBootstrap;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.transaction.TransactionManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Same as {@link org.hibernate.envers.test.integration.basic.Simple}, but in a JTA environment.
|
||||
|
@ -53,12 +47,12 @@ public class JtaTransaction extends AbstractEntityTest {
|
|||
tm.commit();
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "initData")
|
||||
@Test
|
||||
public void testRevisionsCounts() throws Exception {
|
||||
assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(IntTestEntity.class, id1));
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "initData")
|
||||
@Test
|
||||
public void testHistoryOfId1() {
|
||||
IntTestEntity ver1 = new IntTestEntity(10, id1);
|
||||
IntTestEntity ver2 = new IntTestEntity(20, id1);
|
||||
|
|
|
@ -22,17 +22,18 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.manytomany;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.manytomany.ListOwnedEntity;
|
||||
import org.hibernate.envers.test.entities.manytomany.ListOwningEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -49,7 +50,7 @@ public class BasicList extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ListOwnedEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,17 +22,18 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.manytomany;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.manytomany.MapOwnedEntity;
|
||||
import org.hibernate.envers.test.entities.manytomany.MapOwningEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -49,7 +50,7 @@ public class BasicMap extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(MapOwnedEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,17 +22,18 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.manytomany;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.manytomany.SetOwnedEntity;
|
||||
import org.hibernate.envers.test.entities.manytomany.SetOwningEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -49,7 +50,7 @@ public class BasicSet extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(SetOwnedEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,16 +22,18 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.manytomany;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.IntNoAutoIdTestEntity;
|
||||
import org.hibernate.envers.test.entities.manytomany.WhereJoinTableEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -50,7 +52,7 @@ public class BasicWhereJoinTable extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(IntNoAutoIdTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,16 +22,18 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.manytomany.biowned;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.manytomany.biowned.ListBiowning1Entity;
|
||||
import org.hibernate.envers.test.entities.manytomany.biowned.ListBiowning2Entity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -47,7 +49,7 @@ public class BasicBiowned extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(ListBiowning2Entity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
@ -130,7 +132,7 @@ public class BasicBiowned extends AbstractEntityTest {
|
|||
o2_2_id = o2_2.getId();
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testRevisionsCounts() {
|
||||
// Although it would seem that when modifying references both entities should be marked as modified, because
|
||||
// ownly the owning side is notified (because of the bi-owning mapping), a revision is created only for
|
||||
|
@ -143,7 +145,7 @@ public class BasicBiowned extends AbstractEntityTest {
|
|||
assertEquals(Arrays.asList(1, 4), getAuditReader().getRevisions(ListBiowning2Entity.class, o2_2_id));
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testHistoryOfO1_1() {
|
||||
ListBiowning2Entity o2_1 = getEntityManager().find(ListBiowning2Entity.class, o2_1_id);
|
||||
ListBiowning2Entity o2_2 = getEntityManager().find(ListBiowning2Entity.class, o2_2_id);
|
||||
|
@ -161,7 +163,7 @@ public class BasicBiowned extends AbstractEntityTest {
|
|||
assert TestTools.checkList(rev5.getReferences(), o2_2);
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testHistoryOfO1_2() {
|
||||
ListBiowning2Entity o2_1 = getEntityManager().find(ListBiowning2Entity.class, o2_1_id);
|
||||
ListBiowning2Entity o2_2 = getEntityManager().find(ListBiowning2Entity.class, o2_2_id);
|
||||
|
@ -180,7 +182,7 @@ public class BasicBiowned extends AbstractEntityTest {
|
|||
assert TestTools.checkList(rev5.getReferences(), o2_2);
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testHistoryOfO2_1() {
|
||||
ListBiowning1Entity o1_1 = getEntityManager().find(ListBiowning1Entity.class, o1_1_id);
|
||||
ListBiowning1Entity o1_2 = getEntityManager().find(ListBiowning1Entity.class, o1_2_id);
|
||||
|
@ -198,7 +200,7 @@ public class BasicBiowned extends AbstractEntityTest {
|
|||
assert TestTools.checkList(rev5.getReferences());
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testHistoryOfO2_2() {
|
||||
ListBiowning1Entity o1_1 = getEntityManager().find(ListBiowning1Entity.class, o1_1_id);
|
||||
ListBiowning1Entity o1_2 = getEntityManager().find(ListBiowning1Entity.class, o1_2_id);
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package org.hibernate.envers.test.integration.manytomany.inverseToSuperclass;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import javax.persistence.EntityManager;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Hern<EFBFBD>n Chanfreau
|
||||
|
@ -29,7 +30,7 @@ public class ManyToManyInverseToSuperclassTest extends AbstractEntityTest {
|
|||
}
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,8 +22,7 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.manytomany.sametable;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
|
@ -31,8 +30,10 @@ import org.hibernate.envers.test.entities.manytomany.sametable.Child1Entity;
|
|||
import org.hibernate.envers.test.entities.manytomany.sametable.Child2Entity;
|
||||
import org.hibernate.envers.test.entities.manytomany.sametable.ParentEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Test which checks that auditing entities which contain multiple mappings to same tables work.
|
||||
|
@ -52,7 +53,7 @@ public class BasicSametable extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(Child2Entity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(enabled = true, dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
@ -160,7 +161,7 @@ public class BasicSametable extends AbstractEntityTest {
|
|||
c2_2_id = c2_2.getId();
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testRevisionsCounts() {
|
||||
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(ParentEntity.class, p1_id));
|
||||
assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(ParentEntity.class, p2_id));
|
||||
|
@ -172,7 +173,7 @@ public class BasicSametable extends AbstractEntityTest {
|
|||
assert Arrays.asList(1, 5).equals(getAuditReader().getRevisions(Child1Entity.class, c2_2_id));
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testHistoryOfParent1() {
|
||||
Child1Entity c1_1 = getEntityManager().find(Child1Entity.class, c1_1_id);
|
||||
Child1Entity c1_2 = getEntityManager().find(Child1Entity.class, c1_2_id);
|
||||
|
@ -197,7 +198,7 @@ public class BasicSametable extends AbstractEntityTest {
|
|||
assert TestTools.checkList(rev5.getChildren2(), c2_2);
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testHistoryOfParent2() {
|
||||
Child1Entity c1_1 = getEntityManager().find(Child1Entity.class, c1_1_id);
|
||||
Child2Entity c2_1 = getEntityManager().find(Child2Entity.class, c2_1_id);
|
||||
|
@ -222,7 +223,7 @@ public class BasicSametable extends AbstractEntityTest {
|
|||
assert TestTools.checkList(rev5.getChildren2(), c2_1);
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testHistoryOfChild1_1() {
|
||||
ParentEntity p1 = getEntityManager().find(ParentEntity.class, p1_id);
|
||||
ParentEntity p2 = getEntityManager().find(ParentEntity.class, p2_id);
|
||||
|
@ -240,7 +241,8 @@ public class BasicSametable extends AbstractEntityTest {
|
|||
assert TestTools.checkList(rev5.getParents(), p2);
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
// TODO: was disabled?
|
||||
@Test
|
||||
public void testHistoryOfChild1_2() {
|
||||
ParentEntity p1 = getEntityManager().find(ParentEntity.class, p1_id);
|
||||
|
||||
|
@ -257,7 +259,7 @@ public class BasicSametable extends AbstractEntityTest {
|
|||
assert TestTools.checkList(rev5.getParents());
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testHistoryOfChild2_1() {
|
||||
ParentEntity p2 = getEntityManager().find(ParentEntity.class, p2_id);
|
||||
|
||||
|
@ -274,7 +276,7 @@ public class BasicSametable extends AbstractEntityTest {
|
|||
assert TestTools.checkList(rev5.getParents(), p2);
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
@Test
|
||||
public void testHistoryOfChild2_2() {
|
||||
ParentEntity p1 = getEntityManager().find(ParentEntity.class, p1_id);
|
||||
ParentEntity p2 = getEntityManager().find(ParentEntity.class, p2_id);
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.manytomany.ternary;
|
||||
import java.util.Arrays;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.IntTestEntity;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -51,7 +52,7 @@ public class TernaryMap extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(IntTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,16 +22,19 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.manytomany.ternary;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.IntTestEntity;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -115,7 +118,7 @@ public class TernaryMapFlush extends AbstractEntityTest {
|
|||
int2_id = int2.getId();
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "createData")
|
||||
@Test
|
||||
public void testRevisionsCounts() {
|
||||
assertEquals(Arrays.asList(1, 2, 3), getAuditReader().getRevisions(TernaryMapEntity.class, map1_id));
|
||||
assertEquals(Arrays.asList(1), getAuditReader().getRevisions(StrTestEntity.class, str1_id));
|
||||
|
@ -124,7 +127,7 @@ public class TernaryMapFlush extends AbstractEntityTest {
|
|||
assertEquals(Arrays.asList(1) ,getAuditReader().getRevisions(IntTestEntity.class, int2_id));
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "createData")
|
||||
@Test
|
||||
public void testHistoryOfMap1() {
|
||||
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
|
||||
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
|
||||
|
|
|
@ -22,17 +22,18 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.manytomany.unidirectional;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.hibernate.envers.test.entities.manytomany.unidirectional.ListUniEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -49,7 +50,7 @@ public class BasicUniList extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(StrTestEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
|
@ -22,16 +22,17 @@
|
|||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.envers.test.integration.manytomany.unidirectional;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.ejb.Ejb3Configuration;
|
||||
import org.hibernate.envers.test.AbstractEntityTest;
|
||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||
import org.hibernate.envers.test.entities.manytomany.unidirectional.MapUniEntity;
|
||||
import org.hibernate.envers.test.tools.TestTools;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
|
@ -47,7 +48,7 @@ public class BasicUniMap extends AbstractEntityTest {
|
|||
cfg.addAnnotatedClass(MapUniEntity.class);
|
||||
}
|
||||
|
||||
@BeforeClass(dependsOnMethods = "init")
|
||||
@Test
|
||||
public void initData() {
|
||||
EntityManager em = getEntityManager();
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue