From 45e93dc56219b88e6b7f0a9d3bc569762ceaa42a Mon Sep 17 00:00:00 2001 From: Adam Warski Date: Tue, 20 Jan 2009 09:00:54 +0000 Subject: [PATCH] HHH-3563: changing tests to use the same convention git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15803 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../test/integration/accesstype/MixedAccessType.java | 6 +++--- .../components/relations/ManyToOneInComponent.java | 6 +++--- .../components/relations/OneToManyInComponent.java | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java b/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java index 3fcd6d6908..b8fadbb7dc 100644 --- a/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java +++ b/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java @@ -42,7 +42,7 @@ public class MixedAccessType extends AbstractEntityTest { cfg.addAnnotatedClass(MixedAccessTypeEntity.class); } - @Test + @BeforeClass(dependsOnMethods = "init") public void initData() { EntityManager em = getEntityManager(); em.getTransaction().begin(); @@ -57,12 +57,12 @@ public class MixedAccessType extends AbstractEntityTest { em.getTransaction().commit(); } - @Test(dependsOnMethods = "initData") + @Test public void testRevisionsCounts() { assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(MixedAccessTypeEntity.class, id1)); } - @Test(dependsOnMethods = "initData") + @Test public void testHistoryOfId1() { MixedAccessTypeEntity ver1 = new MixedAccessTypeEntity(id1, "data"); MixedAccessTypeEntity ver2 = new MixedAccessTypeEntity(id1, "data2"); diff --git a/envers/src/test/java/org/hibernate/envers/test/integration/components/relations/ManyToOneInComponent.java b/envers/src/test/java/org/hibernate/envers/test/integration/components/relations/ManyToOneInComponent.java index d0b158bbed..bff8634dd5 100644 --- a/envers/src/test/java/org/hibernate/envers/test/integration/components/relations/ManyToOneInComponent.java +++ b/envers/src/test/java/org/hibernate/envers/test/integration/components/relations/ManyToOneInComponent.java @@ -48,7 +48,7 @@ public class ManyToOneInComponent extends AbstractEntityTest { cfg.addAnnotatedClass(StrTestEntity.class); } - @Test + @BeforeClass(dependsOnMethods = "init") public void initData() { // Revision 1 EntityManager em = getEntityManager(); @@ -89,12 +89,12 @@ public class ManyToOneInComponent extends AbstractEntityTest { ste_id2 = ste2.getId(); } - @Test(dependsOnMethods = "initData") + @Test public void testRevisionsCounts() { assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(ManyToOneComponentTestEntity.class, mtocte_id1)); } - @Test(dependsOnMethods = "initData") + @Test public void testHistoryOfId1() { StrTestEntity ste1 = getEntityManager().find(StrTestEntity.class, ste_id1); StrTestEntity ste2 = getEntityManager().find(StrTestEntity.class, ste_id2); diff --git a/envers/src/test/java/org/hibernate/envers/test/integration/components/relations/OneToManyInComponent.java b/envers/src/test/java/org/hibernate/envers/test/integration/components/relations/OneToManyInComponent.java index 6557913060..2d5fbc68b6 100644 --- a/envers/src/test/java/org/hibernate/envers/test/integration/components/relations/OneToManyInComponent.java +++ b/envers/src/test/java/org/hibernate/envers/test/integration/components/relations/OneToManyInComponent.java @@ -31,6 +31,7 @@ import org.hibernate.envers.test.entities.components.relations.OneToManyComponen import org.hibernate.envers.test.entities.components.relations.OneToManyComponent; import org.hibernate.envers.test.entities.StrTestEntity; import org.testng.annotations.Test; +import org.testng.annotations.BeforeClass; import org.hibernate.ejb.Ejb3Configuration; @@ -47,7 +48,7 @@ public class OneToManyInComponent extends AbstractEntityTest { cfg.addAnnotatedClass(StrTestEntity.class); } - @Test + @BeforeClass(dependsOnMethods = "init") public void initData() { // Revision 1 EntityManager em = getEntityManager(); @@ -89,12 +90,12 @@ public class OneToManyInComponent extends AbstractEntityTest { ste_id2 = ste2.getId(); } - @Test(dependsOnMethods = "initData") + @Test public void testRevisionsCounts() { assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(OneToManyComponentTestEntity.class, otmcte_id1)); } - @Test(dependsOnMethods = "initData") + @Test public void testHistoryOfId1() { StrTestEntity ste1 = getEntityManager().find(StrTestEntity.class, ste_id1); StrTestEntity ste2 = getEntityManager().find(StrTestEntity.class, ste_id2);