JBoss Envers SVN: r175 - in trunk: src/test/org/jboss/envers/test and 1 other directories.
by jboss-envers-commits@lists.jboss.org
Author: adamw
Date: 2008-10-13 08:15:18 -0400 (Mon, 13 Oct 2008)
New Revision: 175
Added:
trunk/src/test/org/jboss/envers/test/various/
trunk/src/test/org/jboss/envers/test/various/HsqlTest.java
Modified:
trunk/resources/demo/META-INF/persistence.xml
Log:
Failing HsqlDB test
Modified: trunk/resources/demo/META-INF/persistence.xml
===================================================================
--- trunk/resources/demo/META-INF/persistence.xml 2008-10-13 10:49:54 UTC (rev 174)
+++ trunk/resources/demo/META-INF/persistence.xml 2008-10-13 12:15:18 UTC (rev 175)
@@ -4,15 +4,23 @@
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>org.jboss.envers.demo.Address</class>
<class>org.jboss.envers.demo.Person</class>
+ <exclude-unlisted-classes />
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:file:${java.io.tmpdir}/_versions_demo.db"/>
- <property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.max_fetch_depth" value="3"/>
- <property name="hibernate.jdbc.batch_size" value="0" />
+ <property name="hibernate.connection.password" value=""/>
+
+ <!--<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
+ <property name="hibernate.connection.url" value="jdbc:mysql:///hibernate_tests?useUnicode=true&characterEncoding=UTF-8"/>
+ <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
+ <property name="hibernate.connection.username" value="root"/>
+ <property name="hibernate.connection.password" value=""/>-->
+
+ <property name="hibernate.hbm2ddl.auto" value="update"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="hibernate.format_sql" value="true"/>
<property name="hibernate.ejb.event.post-insert" value="org.jboss.envers.event.VersionsEventListener" />
<property name="hibernate.ejb.event.post-update" value="org.jboss.envers.event.VersionsEventListener" />
Added: trunk/src/test/org/jboss/envers/test/various/HsqlTest.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/various/HsqlTest.java (rev 0)
+++ trunk/src/test/org/jboss/envers/test/various/HsqlTest.java 2008-10-13 12:15:18 UTC (rev 175)
@@ -0,0 +1,129 @@
+package org.jboss.envers.test.various;
+
+import org.jboss.envers.demo.Person;
+import org.jboss.envers.demo.Address;
+import org.hibernate.Session;
+
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+import javax.persistence.EntityManager;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.HashSet;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+public class HsqlTest {
+ /*
+ Query generated by Hibernate from an old demo, when criteria was used: (works)
+
+ select
+ this_.id as id2_0_,
+ this_._revision as column2_2_0_,
+ this_._revision_type as column3_2_0_,
+ this_.name as name2_0_,
+ this_.surname as surname2_0_,
+ this_.address_id as address6_2_0_
+ from
+ Person_versions this_
+ where
+ this_._revision = (
+ select
+ max(e2_._revision) as y0_
+ from
+ Person_versions e2_
+ where
+ e2_._revision<=1
+ and this_.id=e2_.id
+ )
+ and this_.id=1
+
+ Query generated by Hibernate from a new demo, when query generator is used:
+ (throws Column not found: ID in statement because of "person_ver0_.id=person_ver1_.id")
+
+ select
+ person_ver0_.id as id3_,
+ person_ver0_._revision as column2_3_,
+ person_ver0_._revision_type as column3_3_,
+ person_ver0_.name as name3_,
+ person_ver0_.surname as surname3_,
+ person_ver0_.address_id as address6_3_
+ from
+ Person_versions person_ver0_
+ where
+ person_ver0_._revision_type<>2
+ and person_ver0_._revision=(
+ select
+ max(person_ver1_._revision)
+ from
+ Person_versions person_ver1_
+ where
+ person_ver1_._revision<=1
+ and person_ver0_.id=person_ver1_.id
+ )
+ and person_ver0_.id=1
+
+ Both queries work from HSQL console
+ (to run: java -cp hsqldb.jar org.hsqldb.util.DatabaseManager -user sa -url jdbc:hsqldb:file:/tmp/_versions_demo.db)
+ */
+
+ public static void main(String[] argv) {
+ Map<String, String> configurationOverrides = new HashMap<String, String>();
+ EntityManagerFactory emf = Persistence.createEntityManagerFactory("ConsolePU", configurationOverrides);
+ EntityManager entityManager = emf.createEntityManager();
+
+ populateTestData(entityManager);
+
+ entityManager.getTransaction().begin();
+
+ Session sesion = (Session) entityManager.getDelegate();
+ System.out.println(sesion.createQuery(
+ "select e from org.jboss.envers.demo.Person_versions e " +
+ "where " +
+ "e.originalId._revision.id =" +
+ "(select max(e2.originalId._revision.id) " +
+ "from org.jboss.envers.demo.Person_versions e2 " +
+ "where e.originalId.id = :p0) ")
+ .setParameter("p0", 1)
+ .list());
+
+ entityManager.getTransaction().commit();
+
+ entityManager.close();
+ emf.close();
+ }
+
+ private static void populateTestData(EntityManager entityManager) {
+ entityManager.getTransaction().begin();
+
+ if (!hasData(entityManager)) {
+ Person p1 = new Person();
+
+ Address a1 = new Address();
+
+ p1.setName("James");
+ p1.setSurname("Bond");
+ p1.setAddress(a1);
+
+ a1.setStreetName("MI6");
+ a1.setHouseNumber(18);
+ a1.setFlatNumber(25);
+ a1.setPersons(new HashSet<Person>());
+ a1.getPersons().add(p1);
+
+ entityManager.persist(a1);
+
+ entityManager.persist(p1);
+
+ System.out.println("The DB was populated with example data.");
+ }
+
+ entityManager.getTransaction().commit();
+ }
+
+ private static boolean hasData(EntityManager entityManager) {
+ return (((Long) entityManager.createQuery("select count(a) from Address a").getSingleResult()) +
+ ((Long) entityManager.createQuery("select count(p) from Person p").getSingleResult())) > 0;
+ }
+}
16 years, 2 months
JBoss Envers SVN: r174 - in trunk: lib/db and 38 other directories.
by jboss-envers-commits@lists.jboss.org
Author: adamw
Date: 2008-10-13 06:49:54 -0400 (Mon, 13 Oct 2008)
New Revision: 174
Added:
trunk/lib/db/postgresql.jar
trunk/src/test/org/jboss/envers/test/AbstractEntityTest.java
trunk/src/test/org/jboss/envers/test/entities/UnversionedStrTestEntity.java
trunk/src/test/org/jboss/envers/test/performance/
trunk/src/test/org/jboss/envers/test/performance/AbstractPerformanceTest.java
trunk/src/test/org/jboss/envers/test/performance/InsertsPerformance.java
trunk/src/test/org/jboss/envers/test/performance/UpdatesPerformance.java
Removed:
trunk/src/test/org/jboss/envers/test/integration/AbstractEntityTest.java
Modified:
trunk/envers.iml
trunk/lib/hibernate-3.3.0/hibernate3.jar
trunk/resources/test/hibernate.test.cfg.xml
trunk/src/main/org/jboss/envers/configuration/metadata/MetadataTools.java
trunk/src/test/org/jboss/envers/test/integration/basic/Delete.java
trunk/src/test/org/jboss/envers/test/integration/basic/GlobalVersioned.java
trunk/src/test/org/jboss/envers/test/integration/basic/ManyOperationsInTransaction.java
trunk/src/test/org/jboss/envers/test/integration/basic/NotVersioned.java
trunk/src/test/org/jboss/envers/test/integration/basic/NullProperties.java
trunk/src/test/org/jboss/envers/test/integration/basic/Simple.java
trunk/src/test/org/jboss/envers/test/integration/basic/SingleOperationInTransaction.java
trunk/src/test/org/jboss/envers/test/integration/basic/UnversionedPropertiesChange.java
trunk/src/test/org/jboss/envers/test/integration/basic/UnversionedProperty.java
trunk/src/test/org/jboss/envers/test/integration/cache/OneToManyCache.java
trunk/src/test/org/jboss/envers/test/integration/cache/OneToOneCache.java
trunk/src/test/org/jboss/envers/test/integration/cache/QueryCache.java
trunk/src/test/org/jboss/envers/test/integration/collection/EnumSet.java
trunk/src/test/org/jboss/envers/test/integration/collection/StringList.java
trunk/src/test/org/jboss/envers/test/integration/collection/StringMap.java
trunk/src/test/org/jboss/envers/test/integration/collection/StringSet.java
trunk/src/test/org/jboss/envers/test/integration/collection/mapkey/ComponentMapKey.java
trunk/src/test/org/jboss/envers/test/integration/collection/mapkey/IdMapKey.java
trunk/src/test/org/jboss/envers/test/integration/components/Components.java
trunk/src/test/org/jboss/envers/test/integration/customtype/CompositeCustom.java
trunk/src/test/org/jboss/envers/test/integration/customtype/ParametrizedCustom.java
trunk/src/test/org/jboss/envers/test/integration/data/Dates.java
trunk/src/test/org/jboss/envers/test/integration/data/Enums.java
trunk/src/test/org/jboss/envers/test/integration/data/Lobs.java
trunk/src/test/org/jboss/envers/test/integration/data/Serializables.java
trunk/src/test/org/jboss/envers/test/integration/flush/AbstractFlushTest.java
trunk/src/test/org/jboss/envers/test/integration/ids/CompositeIds.java
trunk/src/test/org/jboss/envers/test/integration/inheritance/single/ChildVersioning.java
trunk/src/test/org/jboss/envers/test/integration/inheritance/single/ParentVersioning.java
trunk/src/test/org/jboss/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java
trunk/src/test/org/jboss/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java
trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicList.java
trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicMap.java
trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicSet.java
trunk/src/test/org/jboss/envers/test/integration/manytomany/ternary/TernaryMap.java
trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniList.java
trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniMap.java
trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniSet.java
trunk/src/test/org/jboss/envers/test/integration/naming/BasicNaming.java
trunk/src/test/org/jboss/envers/test/integration/naming/JoinNaming.java
trunk/src/test/org/jboss/envers/test/integration/naming/OneToManyUnidirectionalNaming.java
trunk/src/test/org/jboss/envers/test/integration/naming/VersionsJoinTableNaming.java
trunk/src/test/org/jboss/envers/test/integration/naming/ids/JoinEmbIdNaming.java
trunk/src/test/org/jboss/envers/test/integration/naming/ids/JoinMulIdNaming.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicCollection.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicList.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSet.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithEmbId.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithMulId.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithNullsDelete.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/BidirectionalMapKey.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedList.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSet.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java
trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/DoubleDetachedSet.java
trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/Bidirectional.java
trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/Bidirectional2.java
trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java
trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java
trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java
trunk/src/test/org/jboss/envers/test/integration/onetoone/unidirectional/Unidirectional.java
trunk/src/test/org/jboss/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java
trunk/src/test/org/jboss/envers/test/integration/properties/UnversionedOptimisticLockingField.java
trunk/src/test/org/jboss/envers/test/integration/properties/VersionsProperties.java
trunk/src/test/org/jboss/envers/test/integration/query/AggregateQuery.java
trunk/src/test/org/jboss/envers/test/integration/query/CustomRevEntityQuery.java
trunk/src/test/org/jboss/envers/test/integration/query/DeletedEntities.java
trunk/src/test/org/jboss/envers/test/integration/query/MaximalizePropertyQuery.java
trunk/src/test/org/jboss/envers/test/integration/query/OrderByLimitQuery.java
trunk/src/test/org/jboss/envers/test/integration/query/RevisionConstraintQuery.java
trunk/src/test/org/jboss/envers/test/integration/query/SimpleQuery.java
trunk/src/test/org/jboss/envers/test/integration/query/ids/EmbIdOneToManyQuery.java
trunk/src/test/org/jboss/envers/test/integration/query/ids/MulIdOneToManyQuery.java
trunk/src/test/org/jboss/envers/test/integration/reventity/Custom.java
trunk/src/test/org/jboss/envers/test/integration/reventity/CustomBoxed.java
trunk/src/test/org/jboss/envers/test/integration/reventity/Inherited.java
trunk/src/test/org/jboss/envers/test/integration/reventity/Listener.java
trunk/src/test/org/jboss/envers/test/integration/reventity/LongRevNumber.java
trunk/src/test/org/jboss/envers/test/integration/revfordate/RevisionForDate.java
trunk/src/test/org/jboss/envers/test/integration/sameids/SameIds.java
trunk/src/test/org/jboss/envers/test/integration/secondary/BasicSecondary.java
trunk/src/test/org/jboss/envers/test/integration/secondary/NamingSecondary.java
trunk/src/test/org/jboss/envers/test/integration/secondary/ids/EmbIdSecondary.java
trunk/src/test/org/jboss/envers/test/integration/secondary/ids/MulIdSecondary.java
trunk/src/test/org/jboss/envers/test/integration/superclass/MappedSubclassing.java
Log:
Simple performance tests
Modified: trunk/envers.iml
===================================================================
--- trunk/envers.iml 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/envers.iml 2008-10-13 10:49:54 UTC (rev 174)
@@ -53,6 +53,15 @@
<orderEntry type="library" name="hibernate-common" level="project" />
<orderEntry type="library" name="hibernate-3.2.6" level="project" />
<orderEntry type="library" name="Clover IDEA Plugin" level="application" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/db/postgresql.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Added: trunk/lib/db/postgresql.jar
===================================================================
(Binary files differ)
Property changes on: trunk/lib/db/postgresql.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/lib/hibernate-3.3.0/hibernate3.jar
===================================================================
(Binary files differ)
Modified: trunk/resources/test/hibernate.test.cfg.xml
===================================================================
--- trunk/resources/test/hibernate.test.cfg.xml 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/resources/test/hibernate.test.cfg.xml 2008-10-13 10:49:54 UTC (rev 174)
@@ -6,12 +6,20 @@
<!--suppress HibernateConfigDomInspection -->
<hibernate-configuration>
<session-factory>
+ <property name="hbm2ddl.auto">create-drop</property>
+
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
- <property name="hbm2ddl.auto">create-drop</property>
<property name="connection.url">jdbc:mysql:///hibernate_tests?useUnicode=true&characterEncoding=UTF-8</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
+
+ <!--<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+ <property name="connection.url">jdbc:postgresql://localhost/hibernate_tests</property>
+ <property name="connection.driver_class">org.postgresql.Driver</property>
+ <property name="connection.username">postgres</property>
+ <property name="connection.password"></property>-->
+
<property name="show_sql">false</property>
<property name="format_sql">true</property>
Modified: trunk/src/main/org/jboss/envers/configuration/metadata/MetadataTools.java
===================================================================
--- trunk/src/main/org/jboss/envers/configuration/metadata/MetadataTools.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/main/org/jboss/envers/configuration/metadata/MetadataTools.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -40,6 +40,8 @@
Element generator_mapping = id_mapping.addElement("generator");
generator_mapping.addAttribute("class", "native");
+ /*generator_mapping.addAttribute("class", "sequence");
+ generator_mapping.addElement("param").addAttribute("name", "sequence").setText("custom");*/
return id_mapping;
}
Copied: trunk/src/test/org/jboss/envers/test/AbstractEntityTest.java (from rev 148, trunk/src/test/org/jboss/envers/test/integration/AbstractEntityTest.java)
===================================================================
--- trunk/src/test/org/jboss/envers/test/AbstractEntityTest.java (rev 0)
+++ trunk/src/test/org/jboss/envers/test/AbstractEntityTest.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -0,0 +1,55 @@
+package org.jboss.envers.test;
+
+import org.hibernate.ejb.Ejb3Configuration;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.jboss.envers.VersionsReader;
+import org.jboss.envers.VersionsReaderFactory;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import java.io.IOException;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+public abstract class AbstractEntityTest {
+ private EntityManagerFactory emf;
+ private EntityManager entityManager;
+ private VersionsReader versionsReader;
+ private Ejb3Configuration cfg;
+
+ public abstract void configure(Ejb3Configuration cfg);
+
+ @BeforeMethod
+ public void newEntityManager() {
+ if (entityManager != null) {
+ entityManager.close();
+ }
+
+ entityManager = emf.createEntityManager();
+ versionsReader = VersionsReaderFactory.get(entityManager);
+ }
+
+ @BeforeClass
+ public void init() throws IOException {
+ cfg = new Ejb3Configuration();
+ cfg.configure("hibernate.test.cfg.xml");
+ configure(cfg);
+ emf = cfg.buildEntityManagerFactory();
+
+ newEntityManager();
+ }
+
+ public EntityManager getEntityManager() {
+ return entityManager;
+ }
+
+ public VersionsReader getVersionsReader() {
+ return versionsReader;
+ }
+
+ public Ejb3Configuration getCfg() {
+ return cfg;
+ }
+}
Copied: trunk/src/test/org/jboss/envers/test/entities/UnversionedStrTestEntity.java (from rev 148, trunk/src/test/org/jboss/envers/test/entities/StrTestEntity.java)
===================================================================
--- trunk/src/test/org/jboss/envers/test/entities/UnversionedStrTestEntity.java (rev 0)
+++ trunk/src/test/org/jboss/envers/test/entities/UnversionedStrTestEntity.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -0,0 +1,70 @@
+package org.jboss.envers.test.entities;
+
+import org.jboss.envers.Versioned;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Entity
+public class UnversionedStrTestEntity {
+ @Id
+ @GeneratedValue
+ private Integer id;
+
+ private String str;
+
+ public UnversionedStrTestEntity() {
+ }
+
+ public UnversionedStrTestEntity(String str, Integer id) {
+ this.str = str;
+ this.id = id;
+ }
+
+ public UnversionedStrTestEntity(String str) {
+ this.str = str;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getStr() {
+ return str;
+ }
+
+ public void setStr(String str) {
+ this.str = str;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof UnversionedStrTestEntity)) return false;
+
+ UnversionedStrTestEntity that = (UnversionedStrTestEntity) o;
+
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str != null ? !str.equals(that.str) : that.str != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (str != null ? str.hashCode() : 0);
+ return result;
+ }
+
+ public String toString() {
+ return "USTE(id = " + id + ", str = " + str + ")";
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/test/org/jboss/envers/test/entities/UnversionedStrTestEntity.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: trunk/src/test/org/jboss/envers/test/integration/AbstractEntityTest.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/AbstractEntityTest.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/AbstractEntityTest.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,55 +0,0 @@
-package org.jboss.envers.test.integration;
-
-import org.hibernate.ejb.Ejb3Configuration;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.jboss.envers.VersionsReader;
-import org.jboss.envers.VersionsReaderFactory;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import java.io.IOException;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public abstract class AbstractEntityTest {
- private EntityManagerFactory emf;
- private EntityManager entityManager;
- private VersionsReader versionsReader;
- private Ejb3Configuration cfg;
-
- public abstract void configure(Ejb3Configuration cfg);
-
- @BeforeMethod
- public void newEntityManager() {
- if (entityManager != null) {
- entityManager.close();
- }
-
- entityManager = emf.createEntityManager();
- versionsReader = VersionsReaderFactory.get(entityManager);
- }
-
- @BeforeClass
- public void init() throws IOException {
- cfg = new Ejb3Configuration();
- cfg.configure("hibernate.test.cfg.xml");
- configure(cfg);
- emf = cfg.buildEntityManagerFactory();
-
- newEntityManager();
- }
-
- public EntityManager getEntityManager() {
- return entityManager;
- }
-
- public VersionsReader getVersionsReader() {
- return versionsReader;
- }
-
- public Ejb3Configuration getCfg() {
- return cfg;
- }
-}
Modified: trunk/src/test/org/jboss/envers/test/integration/basic/Delete.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/basic/Delete.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/basic/Delete.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.basic;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/basic/GlobalVersioned.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/basic/GlobalVersioned.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/basic/GlobalVersioned.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.basic;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/basic/ManyOperationsInTransaction.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/basic/ManyOperationsInTransaction.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/basic/ManyOperationsInTransaction.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.basic;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/basic/NotVersioned.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/basic/NotVersioned.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/basic/NotVersioned.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.basic;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.exception.NotVersionedException;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/basic/NullProperties.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/basic/NullProperties.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/basic/NullProperties.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.basic;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/basic/Simple.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/basic/Simple.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/basic/Simple.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.basic;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.IntTestEntity;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/basic/SingleOperationInTransaction.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/basic/SingleOperationInTransaction.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/basic/SingleOperationInTransaction.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.basic;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.exception.RevisionDoesNotExistException;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/basic/UnversionedPropertiesChange.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/basic/UnversionedPropertiesChange.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/basic/UnversionedPropertiesChange.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.basic;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/basic/UnversionedProperty.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/basic/UnversionedProperty.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/basic/UnversionedProperty.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -4,7 +4,7 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.jboss.envers.test.entities.UnversionedEntity;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import javax.persistence.EntityManager;
import java.util.Arrays;
Modified: trunk/src/test/org/jboss/envers/test/integration/cache/OneToManyCache.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/cache/OneToManyCache.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/cache/OneToManyCache.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.cache;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.SetRefEdEntity;
import org.jboss.envers.test.entities.onetomany.SetRefIngEntity;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/cache/OneToOneCache.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/cache/OneToOneCache.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/cache/OneToOneCache.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.cache;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.integration.onetoone.bidirectional.BiRefEdEntity;
import org.jboss.envers.test.integration.onetoone.bidirectional.BiRefIngEntity;
import org.hibernate.ejb.Ejb3Configuration;
Modified: trunk/src/test/org/jboss/envers/test/integration/cache/QueryCache.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/cache/QueryCache.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/cache/QueryCache.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.cache;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.IntTestEntity;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/collection/EnumSet.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/collection/EnumSet.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/collection/EnumSet.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.collection;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.tools.TestTools;
import org.jboss.envers.test.entities.collection.EnumSetEntity;
import org.testng.annotations.BeforeClass;
@@ -9,7 +9,6 @@
import javax.persistence.EntityManager;
import java.util.Arrays;
-import java.util.Collections;
import static org.jboss.envers.test.entities.collection.EnumSetEntity.*;
Modified: trunk/src/test/org/jboss/envers/test/integration/collection/StringList.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/collection/StringList.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/collection/StringList.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.collection;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.tools.TestTools;
import org.jboss.envers.test.entities.collection.StringListEntity;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/collection/StringMap.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/collection/StringMap.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/collection/StringMap.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.collection;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.tools.TestTools;
import org.jboss.envers.test.entities.collection.StringMapEntity;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/collection/StringSet.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/collection/StringSet.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/collection/StringSet.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.collection;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.tools.TestTools;
import org.jboss.envers.test.entities.collection.StringSetEntity;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/collection/mapkey/ComponentMapKey.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/collection/mapkey/ComponentMapKey.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/collection/mapkey/ComponentMapKey.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.collection.mapkey;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.tools.TestTools;
import org.jboss.envers.test.entities.components.ComponentTestEntity;
import org.jboss.envers.test.entities.components.Component1;
Modified: trunk/src/test/org/jboss/envers/test/integration/collection/mapkey/IdMapKey.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/collection/mapkey/IdMapKey.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/collection/mapkey/IdMapKey.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.collection.mapkey;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.tools.TestTools;
import org.jboss.envers.test.entities.StrTestEntity;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/components/Components.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/components/Components.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/components/Components.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.components;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.components.Component1;
import org.jboss.envers.test.entities.components.Component2;
import org.jboss.envers.test.entities.components.ComponentTestEntity;
Modified: trunk/src/test/org/jboss/envers/test/integration/customtype/CompositeCustom.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/customtype/CompositeCustom.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/customtype/CompositeCustom.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.customtype;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.customtype.CompositeCustomTypeEntity;
import org.jboss.envers.test.entities.customtype.Component;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/customtype/ParametrizedCustom.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/customtype/ParametrizedCustom.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/customtype/ParametrizedCustom.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.customtype;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.customtype.ParametrizedCustomTypeEntity;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/data/Dates.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/data/Dates.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/data/Dates.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.data;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/data/Enums.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/data/Enums.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/data/Enums.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.data;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/data/Lobs.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/data/Lobs.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/data/Lobs.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.data;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/data/Serializables.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/data/Serializables.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/data/Serializables.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,13 +1,12 @@
package org.jboss.envers.test.integration.data;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
import javax.persistence.EntityManager;
import java.util.Arrays;
-import java.util.Date;
/**
* @author Adam Warski (adam at warski dot org)
Modified: trunk/src/test/org/jboss/envers/test/integration/flush/AbstractFlushTest.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/flush/AbstractFlushTest.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/flush/AbstractFlushTest.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.flush;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
import org.hibernate.FlushMode;
import org.hibernate.Session;
Modified: trunk/src/test/org/jboss/envers/test/integration/ids/CompositeIds.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/ids/CompositeIds.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/ids/CompositeIds.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.ids;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.ids.EmbId;
import org.jboss.envers.test.entities.ids.MulId;
import org.jboss.envers.test.entities.ids.EmbIdTestEntity;
Modified: trunk/src/test/org/jboss/envers/test/integration/inheritance/single/ChildVersioning.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/inheritance/single/ChildVersioning.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/inheritance/single/ChildVersioning.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -3,7 +3,7 @@
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import javax.persistence.EntityManager;
import java.util.Arrays;
Modified: trunk/src/test/org/jboss/envers/test/integration/inheritance/single/ParentVersioning.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/inheritance/single/ParentVersioning.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/inheritance/single/ParentVersioning.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -3,7 +3,7 @@
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import javax.persistence.EntityManager;
import java.util.Arrays;
Modified: trunk/src/test/org/jboss/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -3,7 +3,7 @@
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.tools.TestTools;
import javax.persistence.EntityManager;
Modified: trunk/src/test/org/jboss/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -3,7 +3,7 @@
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.tools.TestTools;
import javax.persistence.EntityManager;
Modified: trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicList.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicList.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicList.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.manytomany;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.manytomany.ListOwningEntity;
import org.jboss.envers.test.entities.manytomany.ListOwnedEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicMap.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicMap.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicMap.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.manytomany;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.manytomany.MapOwningEntity;
import org.jboss.envers.test.entities.manytomany.MapOwnedEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicSet.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicSet.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/manytomany/BasicSet.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.manytomany;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.manytomany.SetOwningEntity;
import org.jboss.envers.test.entities.manytomany.SetOwnedEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/manytomany/ternary/TernaryMap.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/manytomany/ternary/TernaryMap.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/manytomany/ternary/TernaryMap.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.manytomany.ternary;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.entities.IntTestEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniList.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniList.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniList.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.manytomany.unidirectional;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.manytomany.unidirectional.ListUniEntity;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniMap.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniMap.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniMap.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.manytomany.unidirectional;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.manytomany.unidirectional.MapUniEntity;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniSet.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniSet.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/manytomany/unidirectional/BasicUniSet.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.manytomany.unidirectional;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.manytomany.unidirectional.SetUniEntity;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/naming/BasicNaming.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/naming/BasicNaming.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/naming/BasicNaming.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.naming;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/naming/JoinNaming.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/naming/JoinNaming.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/naming/JoinNaming.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.naming;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.mapping.Column;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/naming/OneToManyUnidirectionalNaming.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/naming/OneToManyUnidirectionalNaming.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/naming/OneToManyUnidirectionalNaming.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.naming;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.tools.TestTools;
import org.hibernate.ejb.Ejb3Configuration;
Modified: trunk/src/test/org/jboss/envers/test/integration/naming/VersionsJoinTableNaming.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/naming/VersionsJoinTableNaming.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/naming/VersionsJoinTableNaming.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.naming;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.tools.TestTools;
import org.hibernate.ejb.Ejb3Configuration;
Modified: trunk/src/test/org/jboss/envers/test/integration/naming/ids/JoinEmbIdNaming.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/naming/ids/JoinEmbIdNaming.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/naming/ids/JoinEmbIdNaming.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.naming.ids;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.mapping.Column;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/naming/ids/JoinMulIdNaming.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/naming/ids/JoinMulIdNaming.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/naming/ids/JoinMulIdNaming.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.naming.ids;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.mapping.Column;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicCollection.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicCollection.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicCollection.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.CollectionRefEdEntity;
import org.jboss.envers.test.entities.onetomany.CollectionRefIngEntity;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicList.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicList.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicList.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.ListRefEdEntity;
import org.jboss.envers.test.entities.onetomany.ListRefIngEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSet.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSet.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSet.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.SetRefEdEntity;
import org.jboss.envers.test.entities.onetomany.SetRefIngEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithEmbId.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithEmbId.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithEmbId.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.ids.EmbId;
import org.jboss.envers.test.entities.onetomany.ids.SetRefEdEmbIdEntity;
import org.jboss.envers.test.entities.onetomany.ids.SetRefIngEmbIdEntity;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithMulId.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithMulId.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithMulId.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.ids.MulId;
import org.jboss.envers.test.entities.onetomany.ids.SetRefEdMulIdEntity;
import org.jboss.envers.test.entities.onetomany.ids.SetRefIngMulIdEntity;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithNullsDelete.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithNullsDelete.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSetWithNullsDelete.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.SetRefEdEntity;
import org.jboss.envers.test.entities.onetomany.SetRefIngEntity;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/BidirectionalMapKey.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/BidirectionalMapKey.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/BidirectionalMapKey.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.tools.TestTools;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedList.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedList.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedList.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany.detached;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.detached.ListRefCollEntity;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSet.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSet.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSet.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany.detached;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.detached.SetRefCollEntity;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany.detached;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.detached.ids.SetRefCollEntityEmbId;
import org.jboss.envers.test.entities.ids.EmbIdTestEntity;
import org.jboss.envers.test.entities.ids.EmbId;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany.detached;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.detached.ids.SetRefCollEntityMulId;
import org.jboss.envers.test.entities.ids.MulIdTestEntity;
import org.jboss.envers.test.entities.ids.MulId;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany.detached;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.entities.onetomany.detached.SetJoinColumnRefCollEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany.detached;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.detached.SetRefCollEntity;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/DoubleDetachedSet.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/DoubleDetachedSet.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetomany/detached/DoubleDetachedSet.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetomany.detached;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.detached.DoubleSetRefCollEntity;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.tools.TestTools;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/Bidirectional.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/Bidirectional.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/Bidirectional.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetoone.bidirectional;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/Bidirectional2.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/Bidirectional2.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/Bidirectional2.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetoone.bidirectional;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetoone.bidirectional;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetoone.bidirectional.ids;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.ids.EmbId;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetoone.bidirectional.ids;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.ids.MulId;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetoone/unidirectional/Unidirectional.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetoone/unidirectional/Unidirectional.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetoone/unidirectional/Unidirectional.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetoone.unidirectional;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.onetoone.unidirectional;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/properties/UnversionedOptimisticLockingField.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/properties/UnversionedOptimisticLockingField.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/properties/UnversionedOptimisticLockingField.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -2,14 +2,13 @@
import java.util.Arrays;
import java.util.Iterator;
-import java.util.Map;
import javax.persistence.EntityManager;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified: trunk/src/test/org/jboss/envers/test/integration/properties/VersionsProperties.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/properties/VersionsProperties.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/properties/VersionsProperties.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.properties;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/query/AggregateQuery.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/query/AggregateQuery.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/query/AggregateQuery.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.query;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.IntTestEntity;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/query/CustomRevEntityQuery.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/query/CustomRevEntityQuery.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/query/CustomRevEntityQuery.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.query;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrIntTestEntity;
import org.jboss.envers.test.entities.reventity.CustomRevEntity;
import org.jboss.envers.query.VersionsRestrictions;
Modified: trunk/src/test/org/jboss/envers/test/integration/query/DeletedEntities.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/query/DeletedEntities.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/query/DeletedEntities.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.query;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrIntTestEntity;
import org.jboss.envers.query.VersionsRestrictions;
import org.jboss.envers.RevisionType;
Modified: trunk/src/test/org/jboss/envers/test/integration/query/MaximalizePropertyQuery.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/query/MaximalizePropertyQuery.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/query/MaximalizePropertyQuery.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.query;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrIntTestEntity;
import org.jboss.envers.query.VersionsRestrictions;
import org.jboss.envers.query.RevisionProperty;
Modified: trunk/src/test/org/jboss/envers/test/integration/query/OrderByLimitQuery.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/query/OrderByLimitQuery.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/query/OrderByLimitQuery.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.query;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.IntTestEntity;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/query/RevisionConstraintQuery.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/query/RevisionConstraintQuery.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/query/RevisionConstraintQuery.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.query;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrIntTestEntity;
import org.jboss.envers.query.VersionsRestrictions;
import org.jboss.envers.query.RevisionProperty;
Modified: trunk/src/test/org/jboss/envers/test/integration/query/SimpleQuery.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/query/SimpleQuery.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/query/SimpleQuery.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.query;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrIntTestEntity;
import org.jboss.envers.test.tools.TestTools;
import org.jboss.envers.query.VersionsRestrictions;
Modified: trunk/src/test/org/jboss/envers/test/integration/query/ids/EmbIdOneToManyQuery.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/query/ids/EmbIdOneToManyQuery.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/query/ids/EmbIdOneToManyQuery.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,7 +1,7 @@
package org.jboss.envers.test.integration.query.ids;
import org.hibernate.ejb.Ejb3Configuration;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.onetomany.ids.SetRefEdEmbIdEntity;
import org.jboss.envers.test.entities.onetomany.ids.SetRefIngEmbIdEntity;
import org.jboss.envers.test.entities.ids.EmbId;
Modified: trunk/src/test/org/jboss/envers/test/integration/query/ids/MulIdOneToManyQuery.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/query/ids/MulIdOneToManyQuery.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/query/ids/MulIdOneToManyQuery.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,7 +1,7 @@
package org.jboss.envers.test.integration.query.ids;
import org.hibernate.ejb.Ejb3Configuration;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.tools.TestTools;
import org.jboss.envers.test.entities.ids.MulId;
import org.jboss.envers.test.entities.onetomany.ids.SetRefEdMulIdEntity;
Modified: trunk/src/test/org/jboss/envers/test/integration/reventity/Custom.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/reventity/Custom.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/reventity/Custom.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.reventity;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.test.entities.reventity.CustomRevEntity;
import org.jboss.envers.exception.RevisionDoesNotExistException;
Modified: trunk/src/test/org/jboss/envers/test/integration/reventity/CustomBoxed.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/reventity/CustomBoxed.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/reventity/CustomBoxed.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.reventity;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.exception.RevisionDoesNotExistException;
import org.jboss.envers.VersionsReader;
Modified: trunk/src/test/org/jboss/envers/test/integration/reventity/Inherited.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/reventity/Inherited.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/reventity/Inherited.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.reventity;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.exception.RevisionDoesNotExistException;
import org.jboss.envers.VersionsReader;
Modified: trunk/src/test/org/jboss/envers/test/integration/reventity/Listener.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/reventity/Listener.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/reventity/Listener.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.reventity;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.exception.RevisionDoesNotExistException;
import org.jboss.envers.VersionsReader;
Modified: trunk/src/test/org/jboss/envers/test/integration/reventity/LongRevNumber.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/reventity/LongRevNumber.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/reventity/LongRevNumber.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,15 +1,13 @@
package org.jboss.envers.test.integration.reventity;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
-import org.jboss.envers.exception.RevisionDoesNotExistException;
import org.jboss.envers.VersionsReader;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import javax.persistence.EntityManager;
-import java.util.Date;
import java.util.Arrays;
/**
Modified: trunk/src/test/org/jboss/envers/test/integration/revfordate/RevisionForDate.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/revfordate/RevisionForDate.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/revfordate/RevisionForDate.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.revfordate;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.StrTestEntity;
import org.jboss.envers.exception.RevisionDoesNotExistException;
import org.jboss.envers.VersionsReader;
Modified: trunk/src/test/org/jboss/envers/test/integration/sameids/SameIds.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/sameids/SameIds.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/sameids/SameIds.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.sameids;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/secondary/BasicSecondary.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/secondary/BasicSecondary.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/secondary/BasicSecondary.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.secondary;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.mapping.Join;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/secondary/NamingSecondary.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/secondary/NamingSecondary.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/secondary/NamingSecondary.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.secondary;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.mapping.Join;
import org.testng.annotations.BeforeClass;
Modified: trunk/src/test/org/jboss/envers/test/integration/secondary/ids/EmbIdSecondary.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/secondary/ids/EmbIdSecondary.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/secondary/ids/EmbIdSecondary.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.secondary.ids;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.ids.EmbId;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.mapping.Join;
Modified: trunk/src/test/org/jboss/envers/test/integration/secondary/ids/MulIdSecondary.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/secondary/ids/MulIdSecondary.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/secondary/ids/MulIdSecondary.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.secondary.ids;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.jboss.envers.test.entities.ids.MulId;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.mapping.Join;
Modified: trunk/src/test/org/jboss/envers/test/integration/superclass/MappedSubclassing.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/superclass/MappedSubclassing.java 2008-10-01 10:26:59 UTC (rev 173)
+++ trunk/src/test/org/jboss/envers/test/integration/superclass/MappedSubclassing.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -1,6 +1,6 @@
package org.jboss.envers.test.integration.superclass;
-import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.AbstractEntityTest;
import org.hibernate.ejb.Ejb3Configuration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Added: trunk/src/test/org/jboss/envers/test/performance/AbstractPerformanceTest.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/performance/AbstractPerformanceTest.java (rev 0)
+++ trunk/src/test/org/jboss/envers/test/performance/AbstractPerformanceTest.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -0,0 +1,59 @@
+package org.jboss.envers.test.performance;
+
+import org.jboss.envers.test.AbstractEntityTest;
+import org.jboss.envers.tools.Pair;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+public abstract class AbstractPerformanceTest extends AbstractEntityTest {
+ protected String getSecondsString(long milliseconds) {
+ return (milliseconds/1000) + "." + (milliseconds%1000);
+ }
+
+ protected long measureTime(Runnable r) {
+ long start = System.currentTimeMillis();
+ r.run();
+ return System.currentTimeMillis() - start;
+ }
+
+ protected abstract Pair<Long, Long> doTest();
+
+ protected abstract String getName();
+
+ private long totalUnversioned;
+ private long totalVersioned;
+
+ private void printResults(long unversioned, long versioned) {
+ System.out.println("Unversioned: " + getSecondsString(unversioned));
+ System.out.println(" Versioned: " + getSecondsString(versioned));
+ System.out.println(" Delta: " + getSecondsString(versioned-unversioned));
+ System.out.println(" Factor: " + (double)versioned/unversioned);
+ }
+
+ private void test(boolean count) {
+ Pair<Long, Long> result = doTest();
+ long unversioned = result.getFirst();
+ long versioned = result.getSecond();
+
+ totalUnversioned += unversioned;
+ totalVersioned += versioned;
+
+ printResults(unversioned, versioned);
+ }
+
+ public void run(int numberOfRuns) {
+ for (int i=0; i<=numberOfRuns; i++) {
+ System.out.println("");
+ System.out.println(getName() + " TEST, RUN " + i);
+ test(i != 0);
+ }
+
+ totalUnversioned /= numberOfRuns;
+ totalVersioned /= numberOfRuns;
+
+ System.out.println("");
+ System.out.println(getName() + " TEST, AVERAGE");
+ printResults(totalUnversioned, totalVersioned);
+ }
+}
Added: trunk/src/test/org/jboss/envers/test/performance/InsertsPerformance.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/performance/InsertsPerformance.java (rev 0)
+++ trunk/src/test/org/jboss/envers/test/performance/InsertsPerformance.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -0,0 +1,56 @@
+package org.jboss.envers.test.performance;
+
+import org.jboss.envers.test.entities.StrTestEntity;
+import org.jboss.envers.test.entities.UnversionedStrTestEntity;
+import org.jboss.envers.tools.Pair;
+import org.hibernate.ejb.Ejb3Configuration;
+
+import javax.persistence.EntityManager;
+import java.io.IOException;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+public class InsertsPerformance extends AbstractPerformanceTest {
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(StrTestEntity.class);
+ cfg.addAnnotatedClass(UnversionedStrTestEntity.class);
+ }
+
+ private final static int NUMBER_INSERTS = 1000;
+
+ private void insertUnversioned() {
+ EntityManager entityManager = getEntityManager();
+ for (int i=0; i<NUMBER_INSERTS; i++) {
+ entityManager.getTransaction().begin();
+ entityManager.persist(new UnversionedStrTestEntity("x" + i));
+ entityManager.getTransaction().commit();
+ }
+ }
+
+ private void insertVersioned() {
+ EntityManager entityManager = getEntityManager();
+ for (int i=0; i<NUMBER_INSERTS; i++) {
+ entityManager.getTransaction().begin();
+ entityManager.persist(new StrTestEntity("x" + i));
+ entityManager.getTransaction().commit();
+ }
+ }
+
+ protected Pair<Long, Long> doTest() {
+ long unversioned = measureTime(new Runnable() { public void run() { insertUnversioned(); } });
+ long versioned = measureTime(new Runnable() { public void run() { insertVersioned(); } });
+
+ return Pair.make(unversioned, versioned);
+ }
+
+ protected String getName() {
+ return "INSERTS";
+ }
+
+ public static void main(String[] args) throws IOException {
+ InsertsPerformance insertsPerformance = new InsertsPerformance();
+ insertsPerformance.init();
+ insertsPerformance.run(10);
+ }
+}
Added: trunk/src/test/org/jboss/envers/test/performance/UpdatesPerformance.java
===================================================================
--- trunk/src/test/org/jboss/envers/test/performance/UpdatesPerformance.java (rev 0)
+++ trunk/src/test/org/jboss/envers/test/performance/UpdatesPerformance.java 2008-10-13 10:49:54 UTC (rev 174)
@@ -0,0 +1,87 @@
+package org.jboss.envers.test.performance;
+
+import org.jboss.envers.test.entities.StrTestEntity;
+import org.jboss.envers.test.entities.UnversionedStrTestEntity;
+import org.jboss.envers.tools.Pair;
+import org.hibernate.ejb.Ejb3Configuration;
+
+import javax.persistence.EntityManager;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+public class UpdatesPerformance extends AbstractPerformanceTest {
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(StrTestEntity.class);
+ cfg.addAnnotatedClass(UnversionedStrTestEntity.class);
+ }
+
+ private final static int NUMBER_UPDATES = 1000;
+ private final static int NUMBER_ENTITIES = 10;
+
+ private Random random = new Random();
+
+ private List<Integer> unversioned_ids = new ArrayList<Integer>();
+ private List<Integer> versioned_ids = new ArrayList<Integer>();
+
+ public void setup() {
+ EntityManager entityManager = getEntityManager();
+ entityManager.getTransaction().begin();
+ for (int i=0; i<NUMBER_ENTITIES; i++) {
+ UnversionedStrTestEntity testEntity = new UnversionedStrTestEntity("x" + i);
+ entityManager.persist(testEntity);
+ unversioned_ids.add(testEntity.getId());
+ }
+
+ for (int i=0; i<NUMBER_ENTITIES; i++) {
+ StrTestEntity testEntity = new StrTestEntity("x" + i);
+ entityManager.persist(testEntity);
+ versioned_ids.add(testEntity.getId());
+ }
+ entityManager.getTransaction().commit();
+ }
+
+ private void updateUnversioned() {
+ EntityManager entityManager = getEntityManager();
+ for (int i=0; i<NUMBER_UPDATES; i++) {
+ entityManager.getTransaction().begin();
+ Integer id = unversioned_ids.get(random.nextInt(NUMBER_ENTITIES));
+ UnversionedStrTestEntity testEntity = entityManager.find(UnversionedStrTestEntity.class, id);
+ testEntity.setStr("z" + i);
+ entityManager.getTransaction().commit();
+ }
+ }
+
+ private void updateVersioned() {
+ EntityManager entityManager = getEntityManager();
+ for (int i=0; i<NUMBER_UPDATES; i++) {
+ entityManager.getTransaction().begin();
+ Integer id = versioned_ids.get(random.nextInt(NUMBER_ENTITIES));
+ StrTestEntity testEntity = entityManager.find(StrTestEntity.class, id);
+ testEntity.setStr("z" + i);
+ entityManager.getTransaction().commit();
+ }
+ }
+
+ protected Pair<Long, Long> doTest() {
+ long unversioned = measureTime(new Runnable() { public void run() { updateUnversioned(); } });
+ long versioned = measureTime(new Runnable() { public void run() { updateVersioned(); } });
+
+ return Pair.make(unversioned, versioned);
+ }
+
+ protected String getName() {
+ return "UPDATES";
+ }
+
+ public static void main(String[] args) throws IOException {
+ UpdatesPerformance updatesPerformance = new UpdatesPerformance();
+ updatesPerformance.init();
+ updatesPerformance.setup();
+ updatesPerformance.run(10);
+ }
+}
\ No newline at end of file
16 years, 2 months
JBoss Envers SVN: r173 - in trunk: src/main/org/jboss/envers/entities and 5 other directories.
by jboss-envers-commits@lists.jboss.org
Author: adamw
Date: 2008-10-01 06:26:59 -0400 (Wed, 01 Oct 2008)
New Revision: 173
Added:
trunk/src/main/org/jboss/envers/reader/FirstLevelCache.java
trunk/src/test/org/jboss/envers/test/integration/cache/
trunk/src/test/org/jboss/envers/test/integration/cache/OneToManyCache.java
trunk/src/test/org/jboss/envers/test/integration/cache/OneToOneCache.java
trunk/src/test/org/jboss/envers/test/integration/cache/QueryCache.java
Modified:
trunk/resources/test/testng.xml
trunk/src/main/org/jboss/envers/entities/EntityInstantiator.java
trunk/src/main/org/jboss/envers/entities/mapper/relation/ToOneIdMapper.java
trunk/src/main/org/jboss/envers/reader/VersionsReaderImpl.java
trunk/src/main/org/jboss/envers/reader/VersionsReaderImplementor.java
trunk/src/main/org/jboss/envers/tools/ConcurrentReferenceHashMap.java
trunk/src/main/org/jboss/envers/tools/Tools.java
Log:
ENVERS-54: first level cache (versions-reader scoped)
Modified: trunk/resources/test/testng.xml
===================================================================
--- trunk/resources/test/testng.xml 2008-09-26 15:33:14 UTC (rev 172)
+++ trunk/resources/test/testng.xml 2008-10-01 10:26:59 UTC (rev 173)
@@ -4,6 +4,7 @@
<test name="All">
<packages>
<package name="org.jboss.envers.test.integration.basic" />
+ <package name="org.jboss.envers.test.integration.cache" />
<package name="org.jboss.envers.test.integration.collection" />
<package name="org.jboss.envers.test.integration.collection.mapkey" />
<package name="org.jboss.envers.test.integration.components" />
Modified: trunk/src/main/org/jboss/envers/entities/EntityInstantiator.java
===================================================================
--- trunk/src/main/org/jboss/envers/entities/EntityInstantiator.java 2008-09-26 15:33:14 UTC (rev 172)
+++ trunk/src/main/org/jboss/envers/entities/EntityInstantiator.java 2008-10-01 10:26:59 UTC (rev 173)
@@ -63,6 +63,18 @@
entityName = type;
}
+ // First mapping the primary key
+ IdMapper idMapper = verCfg.getEntCfg().get(entityName).getIdMapper();
+ Map originalId = (Map) versionsEntity.get(verCfg.getVerEntCfg().getOriginalIdPropName());
+
+ Object primaryKey = idMapper.mapToIdFromMap(originalId);
+
+ // Checking if the entity is in cache
+ if (versionsReader.getFirstLevelCache().contains(entityName, revision, primaryKey)) {
+ return versionsReader.getFirstLevelCache().get(entityName, revision, primaryKey);
+ }
+
+ // If it is not in the cache, creating a new entity instance
Object ret;
try {
Class<?> cls = ReflectionTools.loadClass(entityName);
@@ -71,11 +83,10 @@
throw new VersionsException(e);
}
- IdMapper idMapper = verCfg.getEntCfg().get(entityName).getIdMapper();
- Map originalId = (Map) versionsEntity.get(verCfg.getVerEntCfg().getOriginalIdPropName());
+ // Putting the newly created entity instance into the first level cache, in case a one-to-one bidirectional
+ // relation is present (which is eagerly loaded).
+ versionsReader.getFirstLevelCache().put(entityName, revision, primaryKey, ret);
- Object primaryKey = idMapper.mapToIdFromMap(originalId);
-
verCfg.getEntCfg().get(entityName).getPropertyMapper().mapToEntityFromMap(verCfg, ret, versionsEntity, primaryKey,
versionsReader, revision);
idMapper.mapToEntityFromMap(ret, originalId);
Modified: trunk/src/main/org/jboss/envers/entities/mapper/relation/ToOneIdMapper.java
===================================================================
--- trunk/src/main/org/jboss/envers/entities/mapper/relation/ToOneIdMapper.java 2008-09-26 15:33:14 UTC (rev 172)
+++ trunk/src/main/org/jboss/envers/entities/mapper/relation/ToOneIdMapper.java 2008-10-01 10:26:59 UTC (rev 173)
@@ -71,10 +71,14 @@
if (entityId == null) {
value = null;
} else {
- Class<?> entityClass = ReflectionTools.loadClass(referencedEntityName);
+ if (versionsReader.getFirstLevelCache().contains(referencedEntityName, revision, entityId)) {
+ value = versionsReader.getFirstLevelCache().get(referencedEntityName, revision, entityId);
+ } else {
+ Class<?> entityClass = ReflectionTools.loadClass(referencedEntityName);
- value = versionsReader.getSessionImplementor().getFactory().getEntityPersister(referencedEntityName).
- createProxy(null, new ToOneDelegateSessionImplementor(versionsReader, entityClass, entityId, revision));
+ value = versionsReader.getSessionImplementor().getFactory().getEntityPersister(referencedEntityName).
+ createProxy(null, new ToOneDelegateSessionImplementor(versionsReader, entityClass, entityId, revision));
+ }
}
Setter setter = ReflectionTools.getSetter(obj.getClass(), propertyName);
@@ -82,9 +86,9 @@
}
public List<PersistentCollectionChangeData> mapCollectionChanges(String referencingPropertyName,
- PersistentCollection newColl,
- Serializable oldColl,
- Serializable id) {
+ PersistentCollection newColl,
+ Serializable oldColl,
+ Serializable id) {
return null;
}
}
Added: trunk/src/main/org/jboss/envers/reader/FirstLevelCache.java
===================================================================
--- trunk/src/main/org/jboss/envers/reader/FirstLevelCache.java (rev 0)
+++ trunk/src/main/org/jboss/envers/reader/FirstLevelCache.java 2008-10-01 10:26:59 UTC (rev 173)
@@ -0,0 +1,32 @@
+package org.jboss.envers.reader;
+
+import org.jboss.envers.tools.Triple;
+import static org.jboss.envers.tools.Triple.*;
+import static org.jboss.envers.tools.Tools.newHashMap;
+
+import java.util.Map;
+
+/**
+ * First level cache for versioned entities, versions reader-scoped. Each entity is uniquely identified by a
+ * revision number and entity id.
+ * @author Adam Warski (adam at warski dot org)
+ */
+public class FirstLevelCache {
+ private final Map<Triple<String, Number, Object>, Object> cache;
+
+ public FirstLevelCache() {
+ cache = newHashMap();
+ }
+
+ public Object get(String entityName, Number revision, Object id) {
+ return cache.get(make(entityName, revision, id));
+ }
+
+ public void put(String entityName, Number revision, Object id, Object entity) {
+ cache.put(make(entityName, revision, id), entity);
+ }
+
+ public boolean contains(String entityName, Number revision, Object id) {
+ return cache.containsKey(make(entityName, revision, id));
+ }
+}
Modified: trunk/src/main/org/jboss/envers/reader/VersionsReaderImpl.java
===================================================================
--- trunk/src/main/org/jboss/envers/reader/VersionsReaderImpl.java 2008-09-26 15:33:14 UTC (rev 172)
+++ trunk/src/main/org/jboss/envers/reader/VersionsReaderImpl.java 2008-10-01 10:26:59 UTC (rev 173)
@@ -46,12 +46,15 @@
private final VersionsConfiguration verCfg;
private final SessionImplementor sessionImplementor;
private final Session session;
+ private final FirstLevelCache firstLevelCache;
public VersionsReaderImpl(VersionsConfiguration verCfg, Session session,
SessionImplementor sessionImplementor) {
this.verCfg = verCfg;
this.sessionImplementor = sessionImplementor;
this.session = session;
+
+ firstLevelCache = new FirstLevelCache();
}
private void checkSession() {
@@ -68,6 +71,10 @@
return session;
}
+ public FirstLevelCache getFirstLevelCache() {
+ return firstLevelCache;
+ }
+
@SuppressWarnings({"unchecked"})
public <T> T find(Class<T> cls, Object primaryKey, Number revision) throws
IllegalArgumentException, NotVersionedException, IllegalStateException {
@@ -83,14 +90,22 @@
throw new NotVersionedException(entityName, entityName + " is not versioned!");
}
+ if (firstLevelCache.contains(entityName, revision, primaryKey)) {
+ return (T) firstLevelCache.get(entityName, revision, primaryKey);
+ }
+
+ Object result;
try {
- return (T) createQuery().forEntitiesAtRevision(cls, revision)
+ // The result is put into the cache by the entity instantiator called from the query
+ result = createQuery().forEntitiesAtRevision(cls, revision)
.add(VersionsRestrictions.idEq(primaryKey)).getSingleResult();
} catch (NoResultException e) {
- return null;
+ result = null;
} catch (NonUniqueResultException e) {
throw new VersionsException(e);
}
+
+ return (T) result;
}
@SuppressWarnings({"unchecked"})
Modified: trunk/src/main/org/jboss/envers/reader/VersionsReaderImplementor.java
===================================================================
--- trunk/src/main/org/jboss/envers/reader/VersionsReaderImplementor.java 2008-09-26 15:33:14 UTC (rev 172)
+++ trunk/src/main/org/jboss/envers/reader/VersionsReaderImplementor.java 2008-10-01 10:26:59 UTC (rev 173)
@@ -32,4 +32,5 @@
public interface VersionsReaderImplementor extends VersionsReader {
SessionImplementor getSessionImplementor();
Session getSession();
+ FirstLevelCache getFirstLevelCache();
}
Modified: trunk/src/main/org/jboss/envers/tools/ConcurrentReferenceHashMap.java
===================================================================
--- trunk/src/main/org/jboss/envers/tools/ConcurrentReferenceHashMap.java 2008-09-26 15:33:14 UTC (rev 172)
+++ trunk/src/main/org/jboss/envers/tools/ConcurrentReferenceHashMap.java 2008-10-01 10:26:59 UTC (rev 173)
@@ -263,6 +263,7 @@
static interface KeyReference {
int keyHash();
+ Object keyRef();
}
/**
@@ -270,13 +271,17 @@
*/
static final class WeakKeyReference<K> extends WeakReference<K> implements KeyReference {
final int hash;
- WeakKeyReference(K key, int hash, ReferenceQueue<K> refQueue) {
+ WeakKeyReference(K key, int hash, ReferenceQueue<Object> refQueue) {
super(key, refQueue);
this.hash = hash;
}
public final int keyHash() {
return hash;
}
+
+ public final Object keyRef() {
+ return this;
+ }
}
/**
@@ -284,15 +289,54 @@
*/
static final class SoftKeyReference<K> extends SoftReference<K> implements KeyReference {
final int hash;
- SoftKeyReference(K key, int hash, ReferenceQueue<K> refQueue) {
+ SoftKeyReference(K key, int hash, ReferenceQueue<Object> refQueue) {
super(key, refQueue);
this.hash = hash;
}
public final int keyHash() {
return hash;
}
+
+ public final Object keyRef() {
+ return this;
+ }
}
+ static final class WeakValueReference<V> extends WeakReference<V> implements KeyReference {
+ final Object keyRef;
+ final int hash;
+ WeakValueReference(V value, Object keyRef, int hash, ReferenceQueue<Object> refQueue) {
+ super(value, refQueue);
+ this.keyRef = keyRef;
+ this.hash = hash;
+ }
+
+ public final int keyHash() {
+ return hash;
+ }
+
+ public final Object keyRef() {
+ return keyRef;
+ }
+ }
+
+ static final class SoftValueReference<V> extends SoftReference<V> implements KeyReference {
+ final Object keyRef;
+ final int hash;
+ SoftValueReference(V value, Object keyRef, int hash, ReferenceQueue<Object> refQueue) {
+ super(value, refQueue);
+ this.keyRef = keyRef;
+ this.hash = hash;
+ }
+ public final int keyHash() {
+ return hash;
+ }
+
+ public final Object keyRef() {
+ return keyRef;
+ }
+ }
+
/**
* ConcurrentReferenceHashMap list entry. Note that this is never exported
* out as a user-visible Map.Entry.
@@ -310,45 +354,39 @@
final int hash;
volatile Object valueRef;
final HashEntry<K,V> next;
- final ReferenceType keyType;
- final ReferenceType valueType;
HashEntry(K key, int hash, HashEntry<K,V> next, V value,
ReferenceType keyType, ReferenceType valueType,
- ReferenceQueue<K> refQueue) {
- this.keyType = keyType;
- this.valueType = valueType;
- this.keyRef = newKeyReference(key, hash, refQueue);
+ ReferenceQueue<Object> refQueue) {
this.hash = hash;
this.next = next;
- this.valueRef = newValueReference(value);
+ this.keyRef = newKeyReference(key, keyType, refQueue);
+ this.valueRef = newValueReference(value, valueType, refQueue);
}
- final Object newKeyReference(K key, int hash, ReferenceQueue<K> refQueue) {
- switch (keyType) {
- case WEAK:
- return new WeakKeyReference<K>(key, hash, refQueue);
- case SOFT:
- return new SoftKeyReference<K>(key, hash, refQueue);
- }
+ final Object newKeyReference(K key, ReferenceType keyType,
+ ReferenceQueue<Object> refQueue) {
+ if (keyType == ReferenceType.WEAK)
+ return new WeakKeyReference<K>(key, hash, refQueue);
+ if (keyType == ReferenceType.SOFT)
+ return new SoftKeyReference<K>(key, hash, refQueue);
return key;
}
- final Object newValueReference(V value) {
- switch (valueType) {
- case WEAK:
- return new WeakReference<V>(value);
- case SOFT:
- return new SoftReference<V>(value);
- }
+ final Object newValueReference(V value, ReferenceType valueType,
+ ReferenceQueue<Object> refQueue) {
+ if (valueType == ReferenceType.WEAK)
+ return new WeakValueReference<V>(value, keyRef, hash, refQueue);
+ if (valueType == ReferenceType.SOFT)
+ return new SoftValueReference<V>(value, keyRef, hash, refQueue);
return value;
}
@SuppressWarnings("unchecked")
final K key() {
- if (keyRef instanceof Reference)
+ if (keyRef instanceof KeyReference)
return ((Reference<K>)keyRef).get();
return (K) keyRef;
@@ -360,14 +398,14 @@
@SuppressWarnings("unchecked")
final V dereferenceValue(Object value) {
- if (value instanceof Reference)
+ if (value instanceof KeyReference)
return ((Reference<V>)value).get();
return (V) value;
}
- final void setValue(V value) {
- this.valueRef = newValueReference(value);
+ final void setValue(V value, ReferenceType valueType, ReferenceQueue<Object> refQueue) {
+ this.valueRef = newValueReference(value, valueType, refQueue);
}
@SuppressWarnings("unchecked")
@@ -460,7 +498,7 @@
* The collected weak-key reference queue for this segment.
* This should be (re)initialized whenever table is assigned,
*/
- transient volatile ReferenceQueue<K> refQueue;
+ transient volatile ReferenceQueue<Object> refQueue;
final ReferenceType keyType;
@@ -493,7 +531,7 @@
void setTable(HashEntry<K,V>[] newTable) {
threshold = (int)(newTable.length * loadFactor);
table = newTable;
- refQueue = new ReferenceQueue<K>();
+ refQueue = new ReferenceQueue<Object>();
}
/**
@@ -525,7 +563,7 @@
}
}
- /* Specialized implementations of mapToMapFromEntity methods */
+ /* Specialized implementations of map methods */
V get(Object key, int hash) {
if (count != 0) { // read-volatile
@@ -589,7 +627,7 @@
boolean replaced = false;
if (e != null && oldValue.equals(e.value())) {
replaced = true;
- e.setValue(newValue);
+ e.setValue(newValue, valueType, refQueue);
}
return replaced;
} finally {
@@ -608,7 +646,7 @@
V oldValue = null;
if (e != null) {
oldValue = e.value();
- e.setValue(newValue);
+ e.setValue(newValue, valueType, refQueue);
}
return oldValue;
} finally {
@@ -639,7 +677,7 @@
if (e != null) {
oldValue = e.value();
if (!onlyIfAbsent)
- e.setValue(value);
+ e.setValue(value, valueType, refQueue);
}
else {
oldValue = null;
@@ -726,19 +764,19 @@
/**
* Remove; match on key only if value null, else match both.
*/
- V remove(Object key, int hash, Object value, boolean weakRemove) {
+ V remove(Object key, int hash, Object value, boolean refRemove) {
lock();
try {
- if (!weakRemove)
+ if (!refRemove)
removeStale();
int c = count - 1;
HashEntry<K,V>[] tab = table;
int index = hash & (tab.length - 1);
HashEntry<K,V> first = tab[index];
HashEntry<K,V> e = first;
- // a weak remove operation compares the WeakReference instance
- while (e != null && (!weakRemove || key != e.keyRef)
- && (e.hash != hash || !keyEq(key, e.key())))
+ // a ref remove operation compares the Reference instance
+ while (e != null && key != e.keyRef
+ && (refRemove || hash != e.hash || !keyEq(key, e.key())))
e = e.next;
V oldValue = null;
@@ -771,12 +809,9 @@
}
final void removeStale() {
- if (keyType == ReferenceType.STRONG)
- return;
-
KeyReference ref;
while ((ref = (KeyReference) refQueue.poll()) != null) {
- remove(ref, ref.keyHash(), null, true);
+ remove(ref.keyRef(), ref.keyHash(), null, true);
}
}
@@ -789,7 +824,7 @@
tab[i] = null;
++modCount;
// replace the reference queue to avoid unnecessary stale cleanups
- refQueue = new ReferenceQueue<K>();
+ refQueue = new ReferenceQueue<Object>();
count = 0; // write-volatile
} finally {
unlock();
Modified: trunk/src/main/org/jboss/envers/tools/Tools.java
===================================================================
--- trunk/src/main/org/jboss/envers/tools/Tools.java 2008-09-26 15:33:14 UTC (rev 172)
+++ trunk/src/main/org/jboss/envers/tools/Tools.java 2008-10-01 10:26:59 UTC (rev 173)
@@ -21,14 +21,16 @@
*/
package org.jboss.envers.tools;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.*;
/**
* @author Adam Warski (adam at warski dot org)
*/
public class Tools {
+ public static <K,V> Map<K,V> newHashMap() {
+ return new HashMap<K,V>();
+ }
+
public static boolean objectsEqual(Object obj1, Object obj2) {
if (obj1 == null) {
return obj2 == null;
Copied: trunk/src/test/org/jboss/envers/test/integration/cache/OneToManyCache.java (from rev 148, trunk/src/test/org/jboss/envers/test/integration/onetomany/BasicSet.java)
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/cache/OneToManyCache.java (rev 0)
+++ trunk/src/test/org/jboss/envers/test/integration/cache/OneToManyCache.java 2008-10-01 10:26:59 UTC (rev 173)
@@ -0,0 +1,120 @@
+package org.jboss.envers.test.integration.cache;
+
+import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.entities.onetomany.SetRefEdEntity;
+import org.jboss.envers.test.entities.onetomany.SetRefIngEntity;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import org.hibernate.ejb.Ejb3Configuration;
+
+import javax.persistence.EntityManager;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@SuppressWarnings({"ObjectEquality"})
+public class OneToManyCache extends AbstractEntityTest {
+ private Integer ed1_id;
+ private Integer ed2_id;
+
+ private Integer ing1_id;
+ private Integer ing2_id;
+
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(SetRefEdEntity.class);
+ cfg.addAnnotatedClass(SetRefIngEntity.class);
+ }
+
+ @BeforeClass(dependsOnMethods = "init")
+ public void initData() {
+ EntityManager em = getEntityManager();
+
+ SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
+ SetRefEdEntity ed2 = new SetRefEdEntity(2, "data_ed_2");
+
+ SetRefIngEntity ing1 = new SetRefIngEntity(1, "data_ing_1");
+ SetRefIngEntity ing2 = new SetRefIngEntity(2, "data_ing_2");
+
+ // Revision 1
+ em.getTransaction().begin();
+
+ em.persist(ed1);
+ em.persist(ed2);
+
+ ing1.setReference(ed1);
+ ing2.setReference(ed1);
+
+ em.persist(ing1);
+ em.persist(ing2);
+
+ em.getTransaction().commit();
+
+ // Revision 2
+ em.getTransaction().begin();
+
+ ing1 = em.find(SetRefIngEntity.class, ing1.getId());
+ ing2 = em.find(SetRefIngEntity.class, ing2.getId());
+ ed2 = em.find(SetRefEdEntity.class, ed2.getId());
+
+ ing1.setReference(ed2);
+ ing2.setReference(ed2);
+
+ em.getTransaction().commit();
+
+ //
+
+ ed1_id = ed1.getId();
+ ed2_id = ed2.getId();
+
+ ing1_id = ing1.getId();
+ ing2_id = ing2.getId();
+ }
+
+ @Test
+ public void testCacheReferenceAccessAfterFind() {
+ SetRefEdEntity ed1_rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
+
+ SetRefIngEntity ing1_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 1);
+ SetRefIngEntity ing2_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 1);
+
+ // It should be exactly the same object
+ assert ing1_rev1.getReference() == ed1_rev1;
+ assert ing2_rev1.getReference() == ed1_rev1;
+ }
+
+ @Test
+ public void testCacheReferenceAccessAfterCollectionAccessRev1() {
+ SetRefEdEntity ed1_rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
+
+ // It should be exactly the same object
+ assert ed1_rev1.getReffering().size() == 2;
+ for (SetRefIngEntity setRefIngEntity : ed1_rev1.getReffering()) {
+ assert setRefIngEntity.getReference() == ed1_rev1;
+ }
+ }
+
+ @Test
+ public void testCacheReferenceAccessAfterCollectionAccessRev2() {
+ SetRefEdEntity ed2_rev2 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 2);
+
+ assert ed2_rev2.getReffering().size() == 2;
+ for (SetRefIngEntity setRefIngEntity : ed2_rev2.getReffering()) {
+ assert setRefIngEntity.getReference() == ed2_rev2;
+ }
+ }
+
+ @Test
+ public void testCacheFindAfterCollectionAccessRev1() {
+ SetRefEdEntity ed1_rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
+
+ // Reading the collection
+ assert ed1_rev1.getReffering().size() == 2;
+
+ SetRefIngEntity ing1_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 1);
+ SetRefIngEntity ing2_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 1);
+
+ for (SetRefIngEntity setRefIngEntity : ed1_rev1.getReffering()) {
+ assert setRefIngEntity == ing1_rev1 || setRefIngEntity == ing2_rev1;
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/test/org/jboss/envers/test/integration/cache/OneToManyCache.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/test/org/jboss/envers/test/integration/cache/OneToOneCache.java (from rev 148, trunk/src/test/org/jboss/envers/test/integration/onetoone/bidirectional/Bidirectional.java)
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/cache/OneToOneCache.java (rev 0)
+++ trunk/src/test/org/jboss/envers/test/integration/cache/OneToOneCache.java 2008-10-01 10:26:59 UTC (rev 173)
@@ -0,0 +1,80 @@
+package org.jboss.envers.test.integration.cache;
+
+import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.integration.onetoone.bidirectional.BiRefEdEntity;
+import org.jboss.envers.test.integration.onetoone.bidirectional.BiRefIngEntity;
+import org.hibernate.ejb.Ejb3Configuration;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import javax.persistence.EntityManager;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@SuppressWarnings({"ObjectEquality"})
+public class OneToOneCache extends AbstractEntityTest {
+ private Integer ed1_id;
+ private Integer ed2_id;
+
+ private Integer ing1_id;
+
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(BiRefEdEntity.class);
+ cfg.addAnnotatedClass(BiRefIngEntity.class);
+ }
+
+ @BeforeClass(dependsOnMethods = "init")
+ public void initData() {
+ BiRefEdEntity ed1 = new BiRefEdEntity(1, "data_ed_1");
+ BiRefEdEntity ed2 = new BiRefEdEntity(2, "data_ed_2");
+
+ BiRefIngEntity ing1 = new BiRefIngEntity(3, "data_ing_1");
+
+ // Revision 1
+ EntityManager em = getEntityManager();
+ em.getTransaction().begin();
+
+ ing1.setReference(ed1);
+
+ em.persist(ed1);
+ em.persist(ed2);
+
+ em.persist(ing1);
+
+ em.getTransaction().commit();
+
+ // Revision 2
+ em.getTransaction().begin();
+
+ ing1 = em.find(BiRefIngEntity.class, ing1.getId());
+ ed2 = em.find(BiRefEdEntity.class, ed2.getId());
+
+ ing1.setReference(ed2);
+
+ em.getTransaction().commit();
+
+ //
+
+ ed1_id = ed1.getId();
+ ed2_id = ed2.getId();
+
+ ing1_id = ing1.getId();
+ }
+
+ @Test
+ public void testCacheReferenceAccessAfterFindRev1() {
+ BiRefEdEntity ed1_rev1 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 1);
+ BiRefIngEntity ing1_rev1 = getVersionsReader().find(BiRefIngEntity.class, ing1_id, 1);
+
+ assert ing1_rev1.getReference() == ed1_rev1;
+ }
+
+ @Test
+ public void testCacheReferenceAccessAfterFindRev2() {
+ BiRefEdEntity ed2_rev2 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 2);
+ BiRefIngEntity ing1_rev2 = getVersionsReader().find(BiRefIngEntity.class, ing1_id, 2);
+
+ assert ing1_rev2.getReference() == ed2_rev2;
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/test/org/jboss/envers/test/integration/cache/OneToOneCache.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/test/org/jboss/envers/test/integration/cache/QueryCache.java (from rev 148, trunk/src/test/org/jboss/envers/test/integration/basic/Simple.java)
===================================================================
--- trunk/src/test/org/jboss/envers/test/integration/cache/QueryCache.java (rev 0)
+++ trunk/src/test/org/jboss/envers/test/integration/cache/QueryCache.java 2008-10-01 10:26:59 UTC (rev 173)
@@ -0,0 +1,63 @@
+package org.jboss.envers.test.integration.cache;
+
+import org.jboss.envers.test.integration.AbstractEntityTest;
+import org.jboss.envers.test.entities.IntTestEntity;
+import org.hibernate.ejb.Ejb3Configuration;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
+
+import javax.persistence.EntityManager;
+import java.util.List;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@SuppressWarnings({"ObjectEquality"})
+public class QueryCache extends AbstractEntityTest {
+ private Integer id1;
+
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(IntTestEntity.class);
+ }
+
+ @BeforeClass(dependsOnMethods = "init")
+ public void initData() {
+ // Revision 1
+ EntityManager em = getEntityManager();
+ em.getTransaction().begin();
+ IntTestEntity ite = new IntTestEntity(10);
+ em.persist(ite);
+ id1 = ite.getId();
+ em.getTransaction().commit();
+
+ // Revision 2
+ em.getTransaction().begin();
+ ite = em.find(IntTestEntity.class, id1);
+ ite.setNumber(20);
+ em.getTransaction().commit();
+ }
+
+ @Test
+ public void testCacheFindAfterRevisionsOfEntityQuery() {
+ List entsFromQuery = getVersionsReader().createQuery()
+ .forRevisionsOfEntity(IntTestEntity.class, true, false)
+ .getResultList();
+
+ IntTestEntity entFromFindRev1 = getVersionsReader().find(IntTestEntity.class, id1, 1);
+ IntTestEntity entFromFindRev2 = getVersionsReader().find(IntTestEntity.class, id1, 2);
+
+ assert entFromFindRev1 == entsFromQuery.get(0);
+ assert entFromFindRev2 == entsFromQuery.get(1);
+ }
+
+ @Test
+ public void testCacheFindAfterEntitiesAtRevisionQuery() {
+ IntTestEntity entFromQuery = (IntTestEntity) getVersionsReader().createQuery()
+ .forEntitiesAtRevision(IntTestEntity.class, 1)
+ .getSingleResult();
+
+ IntTestEntity entFromFind = getVersionsReader().find(IntTestEntity.class, id1, 1);
+
+ assert entFromFind == entFromQuery;
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/test/org/jboss/envers/test/integration/cache/QueryCache.java
___________________________________________________________________
Name: svn:mergeinfo
+
16 years, 3 months