diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/synchronization/work/WorkUnitMergeDispatcher.java b/hibernate-envers/src/main/java/org/hibernate/envers/synchronization/work/WorkUnitMergeDispatcher.java index 360e0cf2a1..6a85ed8fd2 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/synchronization/work/WorkUnitMergeDispatcher.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/synchronization/work/WorkUnitMergeDispatcher.java @@ -30,7 +30,7 @@ package org.hibernate.envers.synchronization.work; */ public interface WorkUnitMergeDispatcher { /** - * Shuold be invoked on the second work unit. + * Should be invoked on the second work unit. * @param first First work unit (that is, the one added earlier). * @return The work unit that is the result of the merge. */ diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/AbstractSessionTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/AbstractSessionTest.java deleted file mode 100644 index da29d4c03b..0000000000 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/AbstractSessionTest.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.hibernate.envers.test; - -import java.net.URISyntaxException; - -import org.hibernate.dialect.Dialect; -import org.junit.Before; - -import org.hibernate.MappingException; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.cfg.Configuration; -import org.hibernate.cfg.Environment; -import org.hibernate.envers.AuditReader; -import org.hibernate.envers.AuditReaderFactory; -import org.hibernate.service.ServiceRegistry; -import org.hibernate.testing.AfterClassOnce; -import org.hibernate.testing.BeforeClassOnce; -import org.hibernate.testing.ServiceRegistryBuilder; - -/** - * Base class for testing envers with Session. - * - * @author Hernán Chanfreau - * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) - */ -public abstract class AbstractSessionTest extends AbstractEnversTest { - public static final Dialect DIALECT = Dialect.getDialect(); - - protected Configuration config; - private ServiceRegistry serviceRegistry; - private SessionFactory sessionFactory; - private Session session ; - private AuditReader auditReader; - - protected static Dialect getDialect() { - return DIALECT; - } - - @BeforeClassOnce - public void init() throws URISyntaxException { - config = new Configuration(); - if ( createSchema() ) { - config.setProperty( Environment.HBM2DDL_AUTO, "create-drop" ); - config.setProperty( Environment.USE_NEW_ID_GENERATOR_MAPPINGS, "true" ); - config.setProperty("org.hibernate.envers.use_enhanced_revision_entity", "true"); - } - String auditStrategy = getAuditStrategy(); - if (auditStrategy != null && !"".equals(auditStrategy)) { - config.setProperty("org.hibernate.envers.audit_strategy", auditStrategy); - } - - this.initMappings(); - - serviceRegistry = ServiceRegistryBuilder.buildServiceRegistry( config.getProperties() ); - sessionFactory = config.buildSessionFactory( serviceRegistry ); - } - protected boolean createSchema() { - return true; - } - protected abstract void initMappings() throws MappingException, URISyntaxException ; - - private SessionFactory getSessionFactory(){ - return sessionFactory; - } - - @Before - public void newSessionFactory() { - session = getSessionFactory().openSession(); - auditReader = AuditReaderFactory.get(session); - } - - @AfterClassOnce - public void closeSessionFactory() { - try { - sessionFactory.close(); - } - finally { - if ( serviceRegistry != null ) { - ServiceRegistryBuilder.destroy( serviceRegistry ); - serviceRegistry = null; - } - } - } - - - protected Session getSession() { - return session; - } - - protected Configuration getCfg() { - return config; - } - - protected AuditReader getAuditReader() { - return auditReader; - } - -} - diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/BaseEnversFunctionalTestCase.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/BaseEnversFunctionalTestCase.java new file mode 100644 index 0000000000..0d2bdc44af --- /dev/null +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/BaseEnversFunctionalTestCase.java @@ -0,0 +1,60 @@ +package org.hibernate.envers.test; + +import java.util.Arrays; +import java.util.List; + +import org.hibernate.cfg.Configuration; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import org.hibernate.Session; +import org.hibernate.envers.AuditReader; +import org.hibernate.envers.AuditReaderFactory; +import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; + +/** + * @author Strong Liu (stliu@hibernate.org) + */ +@RunWith(EnversRunner.class) +public abstract class BaseEnversFunctionalTestCase extends BaseCoreFunctionalTestCase { + private String auditStrategy; + + @Parameterized.Parameters + public static List data() { + return Arrays.asList( + new Object[] { null }, + new Object[] { "org.hibernate.envers.strategy.ValidityAuditStrategy" } + ); + } + + public void setTestData(Object[] data) { + auditStrategy = (String) data[0]; + } + + public String getAuditStrategy() { + return auditStrategy; + } + + protected Session getSession() { + if ( session == null || !session.isOpen() ) { + return openSession(); + } + return session; + } + + protected AuditReader getAuditReader(){ + return AuditReaderFactory.get( getSession() ); + } + + @Override + protected Configuration constructConfiguration() { + Configuration configuration = super.constructConfiguration(); + configuration.setProperty("org.hibernate.envers.use_enhanced_revision_entity", "true"); + return configuration; + } + + @Override + protected String getBaseForMappings() { + return ""; + } +} diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/BaseEnversJPAFunctionalTestCase.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/BaseEnversJPAFunctionalTestCase.java new file mode 100644 index 0000000000..675a34a4d3 --- /dev/null +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/BaseEnversJPAFunctionalTestCase.java @@ -0,0 +1,285 @@ +package org.hibernate.envers.test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.transaction.SystemException; + +import org.jboss.logging.Logger; +import org.junit.After; + +import org.hibernate.cfg.Configuration; +import org.hibernate.cfg.Environment; +import org.hibernate.dialect.Dialect; +import org.hibernate.ejb.AvailableSettings; +import org.hibernate.ejb.Ejb3Configuration; +import org.hibernate.ejb.EntityManagerFactoryImpl; +import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper; +import org.hibernate.envers.AuditReader; +import org.hibernate.envers.AuditReaderFactory; +import org.hibernate.envers.event.EnversIntegrator; +import org.hibernate.internal.SessionFactoryImpl; +import org.hibernate.internal.util.StringHelper; +import org.hibernate.service.BootstrapServiceRegistryBuilder; +import org.hibernate.service.ServiceRegistryBuilder; +import org.hibernate.service.internal.StandardServiceRegistryImpl; +import org.hibernate.testing.AfterClassOnce; +import org.hibernate.testing.BeforeClassOnce; +import org.hibernate.testing.jta.TestingJtaBootstrap; + +/** + * @author Strong Liu (stliu@hibernate.org) + */ +public abstract class BaseEnversJPAFunctionalTestCase extends AbstractEnversTest { + private static final Logger log = Logger.getLogger( BaseEnversJPAFunctionalTestCase.class ); + + private static final Dialect dialect = Dialect.getDialect(); + + protected Ejb3Configuration ejb3Configuration; + private StandardServiceRegistryImpl serviceRegistry; + private EntityManagerFactoryImpl entityManagerFactory; + + private EntityManager em; + private AuditReader auditReader; + private ArrayList isolatedEms = new ArrayList(); + + protected Dialect getDialect() { + return dialect; + } + + protected EntityManagerFactory entityManagerFactory() { + return entityManagerFactory; + } + + protected StandardServiceRegistryImpl serviceRegistry() { + return serviceRegistry; + } + + protected Configuration getCfg(){ + return ejb3Configuration.getHibernateConfiguration(); + } + + @BeforeClassOnce + @SuppressWarnings({ "UnusedDeclaration" }) + public void buildEntityManagerFactory() throws Exception { + log.trace( "Building session factory" ); + ejb3Configuration = buildConfiguration(); + ejb3Configuration.configure( getConfig() ); + configure(ejb3Configuration); + + afterConfigurationBuilt( ejb3Configuration ); + + entityManagerFactory = (EntityManagerFactoryImpl) ejb3Configuration.buildEntityManagerFactory( + bootstrapRegistryBuilder() + ); + serviceRegistry = (StandardServiceRegistryImpl) ( (SessionFactoryImpl) entityManagerFactory.getSessionFactory() ) + .getServiceRegistry() + .getParentServiceRegistry(); + + afterEntityManagerFactoryBuilt(); + } + public void configure(Ejb3Configuration cfg) { + } + + private BootstrapServiceRegistryBuilder bootstrapRegistryBuilder() { + return new BootstrapServiceRegistryBuilder(); + } + + protected Ejb3Configuration buildConfiguration() { + Ejb3Configuration ejb3Cfg = constructConfiguration(); + addMappings( ejb3Cfg.getHibernateConfiguration() ); + return ejb3Cfg; + } + + protected Ejb3Configuration constructConfiguration() { + Ejb3Configuration ejb3Configuration = new Ejb3Configuration(); + if ( createSchema() ) { + ejb3Configuration.getHibernateConfiguration().setProperty( Environment.HBM2DDL_AUTO, "create-drop" ); + } + if ( StringHelper.isNotEmpty( getAuditStrategy() ) ) { + ejb3Configuration.getHibernateConfiguration().setProperty( + "org.hibernate.envers.audit_strategy", + getAuditStrategy() + ); + } + if (!isAudit()){ + ejb3Configuration.getHibernateConfiguration().setProperty( EnversIntegrator.AUTO_REGISTER, "false" ); + } + ejb3Configuration + .getHibernateConfiguration() + .setProperty( org.hibernate.cfg.AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true" ); + + ejb3Configuration + .getHibernateConfiguration() + .setProperty( "org.hibernate.envers.use_enhanced_revision_entity", "true" ); + + ejb3Configuration + .getHibernateConfiguration() + .setProperty( Environment.DIALECT, getDialect().getClass().getName() ); + return ejb3Configuration; + } + + protected void addMappings(Configuration configuration) { + String[] mappings = getMappings(); + if ( mappings != null ) { + for ( String mapping : mappings ) { + configuration.addResource( mapping, getClass().getClassLoader() ); + } + } + } + + protected static final String[] NO_MAPPINGS = new String[0]; + + protected String[] getMappings() { + return NO_MAPPINGS; + } + + protected Map getConfig() { + Map config = new HashMap(); + ArrayList classes = new ArrayList(); + + classes.addAll( Arrays.asList( getAnnotatedClasses() ) ); + config.put( AvailableSettings.LOADED_CLASSES, classes ); + for ( Map.Entry entry : getCachedClasses().entrySet() ) { + config.put( AvailableSettings.CLASS_CACHE_PREFIX + "." + entry.getKey().getName(), entry.getValue() ); + } + for ( Map.Entry entry : getCachedCollections().entrySet() ) { + config.put( AvailableSettings.COLLECTION_CACHE_PREFIX + "." + entry.getKey(), entry.getValue() ); + } + if ( getEjb3DD().length > 0 ) { + ArrayList dds = new ArrayList(); + dds.addAll( Arrays.asList( getEjb3DD() ) ); + config.put( AvailableSettings.XML_FILE_NAMES, dds ); + } + + addConfigOptions( config ); + return config; + } + + protected void addConfigOptions(Map options) { + } + + protected static final Class[] NO_CLASSES = new Class[0]; + + protected Class[] getAnnotatedClasses() { + return NO_CLASSES; + } + + public Map getCachedClasses() { + return new HashMap(); + } + + public Map getCachedCollections() { + return new HashMap(); + } + + public String[] getEjb3DD() { + return new String[] { }; + } + + @SuppressWarnings({ "UnusedParameters" }) + protected void afterConfigurationBuilt(Ejb3Configuration ejb3Configuration) { + } + + @SuppressWarnings({ "UnusedParameters" }) + protected void applyServices(ServiceRegistryBuilder registryBuilder) { + } + + protected void afterEntityManagerFactoryBuilt() { + } + + protected boolean createSchema() { + return true; + } + protected boolean isAudit() { + return true; + } + + @AfterClassOnce + public void releaseEntityManagerFactory(){ + if ( entityManagerFactory != null && entityManagerFactory.isOpen() ) { + entityManagerFactory.close(); + } + } + @After + @SuppressWarnings({ "UnusedDeclaration" }) + public void releaseUnclosedEntityManagers() { + releaseUnclosedEntityManager( this.em ); + auditReader =null; + for ( EntityManager isolatedEm : isolatedEms ) { + releaseUnclosedEntityManager( isolatedEm ); + } + } + + private void releaseUnclosedEntityManager(EntityManager em) { + if ( em == null ) { + return; + } + if ( !em.isOpen() ) { + em = null; + return; + } + if ( JtaStatusHelper.isActive( TestingJtaBootstrap.INSTANCE.getTransactionManager() ) ) { + log.warn( "Cleaning up unfinished transaction" ); + try { + TestingJtaBootstrap.INSTANCE.getTransactionManager().rollback(); + } + catch (SystemException ignored) { + } + } + try{ + if ( em.getTransaction().isActive() ) { + em.getTransaction().rollback(); + log.warn( "You left an open transaction! Fix your test case. For now, we are closing it for you." ); + } + } + catch ( IllegalStateException e ) { + } + if ( em.isOpen() ) { + // as we open an EM before the test runs, it will still be open if the test uses a custom EM. + // or, the person may have forgotten to close. So, do not raise a "fail", but log the fact. + em.close(); + log.warn( "The EntityManager is not closed. Closing it." ); + } + } + protected EntityManager getEntityManager(){ + return getOrCreateEntityManager(); + } + protected EntityManager getOrCreateEntityManager() { + if ( em == null || !em.isOpen() ) { + em = entityManagerFactory.createEntityManager(); + } + return em; + } + + protected AuditReader getAuditReader(){ + if(auditReader!=null){ + return auditReader; + } + return auditReader = AuditReaderFactory.get( getOrCreateEntityManager() ); + } + + protected EntityManager createIsolatedEntityManager() { + EntityManager isolatedEm = entityManagerFactory.createEntityManager(); + isolatedEms.add( isolatedEm ); + return isolatedEm; + } + + protected EntityManager createIsolatedEntityManager(Map props) { + EntityManager isolatedEm = entityManagerFactory.createEntityManager( props ); + isolatedEms.add( isolatedEm ); + return isolatedEm; + } + + protected EntityManager createEntityManager(Map properties) { + // always reopen a new EM and close the existing one + if ( em != null && em.isOpen() ) { + em.close(); + } + em = entityManagerFactory.createEntityManager( properties ); + return em; + } +} diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/EnversRunner.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/EnversRunner.java index c103187f8f..50c2905a4c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/EnversRunner.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/EnversRunner.java @@ -43,8 +43,12 @@ public class EnversRunner extends Suite { @Override protected Object getTestInstance() throws Exception { Object testInstance = super.getTestInstance(); - ((AbstractEnversTest) testInstance).setTestData(computeParams()); - + if ( AbstractEnversTest.class.isInstance( testInstance ) ) { + ( (AbstractEnversTest) testInstance ).setTestData( computeParams() ); + } + else if ( BaseEnversFunctionalTestCase.class.isInstance( testInstance ) ) { + ( (BaseEnversFunctionalTestCase) testInstance ).setTestData( computeParams() ); + } return testInstance; } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/entities/IntTestPrivSeqEntity.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/entities/IntTestPrivSeqEntity.java new file mode 100644 index 0000000000..ec1f202242 --- /dev/null +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/entities/IntTestPrivSeqEntity.java @@ -0,0 +1,77 @@ +package org.hibernate.envers.test.entities; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; + +import org.hibernate.envers.Audited; + +/** + * Duplicate of {@link IntTestEntity} but with private sequence generator. + * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) + */ +@Entity +public class IntTestPrivSeqEntity { + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "IntTestPrivSeq") + @SequenceGenerator(name = "IntTestPrivSeq", sequenceName="INTTESTPRIV_SEQ", + allocationSize = 1, initialValue = 1) + private Integer id; + + @Audited + @Column(name = "NUMERIC_VALUE") + private Integer number; + + public IntTestPrivSeqEntity() { + } + + public IntTestPrivSeqEntity(Integer number, Integer id) { + this.id = id; + this.number = number; + } + + public IntTestPrivSeqEntity(Integer number) { + this.number = number; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof IntTestPrivSeqEntity)) return false; + + IntTestPrivSeqEntity that = (IntTestPrivSeqEntity) o; + + if (id != null ? !id.equals(that.id) : that.id != null) return false; + if (number != null ? !number.equals(that.number) : that.number != null) return false; + + return true; + } + + public int hashCode() { + int result = (id != null ? id.hashCode() : 0); + result = 31 * result + (number != null ? number.hashCode() : 0); + return result; + } + + public String toString() { + return "ITPSE(id = " + id + ", number = " + number + ")"; + } +} diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/entities/StrTestPrivSeqEntity.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/entities/StrTestPrivSeqEntity.java new file mode 100644 index 0000000000..5f39679322 --- /dev/null +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/entities/StrTestPrivSeqEntity.java @@ -0,0 +1,78 @@ +package org.hibernate.envers.test.entities; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import org.hibernate.envers.Audited; + +/** + * Duplicate of {@link StrTestEntity} but with private sequence generator. + * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) + */ +@Entity +@Table(name = "STRSEQ") +public class StrTestPrivSeqEntity { + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "StrTestPrivSeq") + @SequenceGenerator(name = "StrTestPrivSeq", sequenceName="STRTESTPRIV_SEQ", + allocationSize = 1, initialValue = 1) + private Integer id; + + @Audited + private String str; + + public StrTestPrivSeqEntity() { + } + + public StrTestPrivSeqEntity(String str, Integer id) { + this.str = str; + this.id = id; + } + + public StrTestPrivSeqEntity(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 StrTestPrivSeqEntity)) return false; + + StrTestPrivSeqEntity that = (StrTestPrivSeqEntity) 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 "STPSE(id = " + id + ", str = " + str + ")"; + } +} diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/FieldAccessType.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/FieldAccessType.java index 037336d8c4..deff5f477e 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/FieldAccessType.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/FieldAccessType.java @@ -31,13 +31,13 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class FieldAccessType extends AbstractEntityTest { +public class FieldAccessType extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/ImmutableClassAccessType.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/ImmutableClassAccessType.java index e885772c69..9301a481e3 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/ImmutableClassAccessType.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/ImmutableClassAccessType.java @@ -6,12 +6,12 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import static org.junit.Assert.assertEquals; -public class ImmutableClassAccessType extends AbstractEntityTest { +public class ImmutableClassAccessType extends BaseEnversJPAFunctionalTestCase { private Country country; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java index 8d5230847c..cd708f5792 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class MixedAccessType extends AbstractEntityTest { +public class MixedAccessType extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/PropertyAccessType.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/PropertyAccessType.java index f104584cd6..3690edbc84 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/PropertyAccessType.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/accesstype/PropertyAccessType.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class PropertyAccessType extends AbstractEntityTest { +public class PropertyAccessType extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java index a6284579d8..ac73beb100 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java @@ -30,7 +30,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.exception.NotAuditedException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** @@ -38,7 +38,7 @@ import org.hibernate.envers.test.Priority; * * @author Hernan Chanfreau */ -public class AuditReaderAPITest extends AbstractEntityTest { +public class AuditReaderAPITest extends BaseEnversJPAFunctionalTestCase { public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(AuditedTestEntity.class); cfg.addAnnotatedClass(NotAuditedTestEntity.class); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/ColumnScalePrecisionTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/ColumnScalePrecisionTest.java index c2df7528c1..74d3d39042 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/ColumnScalePrecisionTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/ColumnScalePrecisionTest.java @@ -7,7 +7,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Column; import org.hibernate.mapping.Table; @@ -17,7 +17,7 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-7003") -public class ColumnScalePrecisionTest extends AbstractEntityTest { +public class ColumnScalePrecisionTest extends BaseEnversJPAFunctionalTestCase { private Table auditTable = null; private Table originalTable = null; private Long id = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/Delete.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/Delete.java index 2558431eeb..3bf67b7980 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/Delete.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/Delete.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class Delete extends AbstractEntityTest { +public class Delete extends BaseEnversJPAFunctionalTestCase { private Integer id1; private Integer id2; private Integer id3; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/GlobalVersioned.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/GlobalVersioned.java index 43f2353dd4..96da875f7f 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/GlobalVersioned.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/GlobalVersioned.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class GlobalVersioned extends AbstractEntityTest { +public class GlobalVersioned extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/ManyOperationsInTransaction.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/ManyOperationsInTransaction.java index 17c376ae09..f1ec4aa7f3 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/ManyOperationsInTransaction.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/ManyOperationsInTransaction.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class ManyOperationsInTransaction extends AbstractEntityTest { +public class ManyOperationsInTransaction extends BaseEnversJPAFunctionalTestCase { private Integer id1; private Integer id2; private Integer id3; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NoneAudited.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NoneAudited.java index 1f27051331..662ff36974 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NoneAudited.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NoneAudited.java @@ -31,22 +31,17 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.mapping.PersistentClass; /** * @author Adam Warski (adam at warski dot org) */ -public class NoneAudited extends AbstractEntityTest { +public class NoneAudited extends BaseEnversJPAFunctionalTestCase { public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(BasicTestEntity3.class); } - @Override - public void newEntityManager() { - // The AuditReader shouldn't be created - } - @Test public void testRevisionInfoTableNotCreated() { @SuppressWarnings({"unchecked"}) List pcs = iteratorToList(getCfg().getClassMappings()); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NotVersioned.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NotVersioned.java index 1b9553327e..ca1efffc0e 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NotVersioned.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NotVersioned.java @@ -29,13 +29,13 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.exception.NotAuditedException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class NotVersioned extends AbstractEntityTest { +public class NotVersioned extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NullProperties.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NullProperties.java index 7e7a3423e4..1e345c30fc 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NullProperties.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/NullProperties.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class NullProperties extends AbstractEntityTest { +public class NullProperties extends BaseEnversJPAFunctionalTestCase { private Integer id1; private Integer id2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/Simple.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/Simple.java index a4627a04bd..07125f3447 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/Simple.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/Simple.java @@ -29,14 +29,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.IntTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class Simple extends AbstractEntityTest { +public class Simple extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/SingleOperationInTransaction.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/SingleOperationInTransaction.java index ca31830eb9..e833d6098e 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/SingleOperationInTransaction.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/SingleOperationInTransaction.java @@ -30,13 +30,13 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.exception.RevisionDoesNotExistException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class SingleOperationInTransaction extends AbstractEntityTest { +public class SingleOperationInTransaction extends BaseEnversJPAFunctionalTestCase { private Integer id1; private Integer id2; private Integer id3; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/UnversionedPropertiesChange.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/UnversionedPropertiesChange.java index b9b1cecc80..3d1d41e226 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/UnversionedPropertiesChange.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/UnversionedPropertiesChange.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class UnversionedPropertiesChange extends AbstractEntityTest { +public class UnversionedPropertiesChange extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/UnversionedProperty.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/UnversionedProperty.java index 048e629588..fc044c4cc4 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/UnversionedProperty.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/basic/UnversionedProperty.java @@ -29,14 +29,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.UnversionedEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class UnversionedProperty extends AbstractEntityTest { +public class UnversionedProperty extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/OneToManyCache.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/OneToManyCache.java index 4ffb10838e..fc8bb2d78b 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/OneToManyCache.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/OneToManyCache.java @@ -28,7 +28,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.SetRefEdEntity; import org.hibernate.envers.test.entities.onetomany.SetRefIngEntity; @@ -37,7 +37,7 @@ import org.hibernate.envers.test.entities.onetomany.SetRefIngEntity; * @author Adam Warski (adam at warski dot org) */ @SuppressWarnings({"ObjectEquality"}) -public class OneToManyCache extends AbstractEntityTest { +public class OneToManyCache extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/OneToOneCache.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/OneToOneCache.java index 8a799bb75f..9e837a818d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/OneToOneCache.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/OneToOneCache.java @@ -28,7 +28,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.integration.onetoone.bidirectional.BiRefEdEntity; import org.hibernate.envers.test.integration.onetoone.bidirectional.BiRefIngEntity; @@ -37,7 +37,7 @@ import org.hibernate.envers.test.integration.onetoone.bidirectional.BiRefIngEnti * @author Adam Warski (adam at warski dot org) */ @SuppressWarnings({"ObjectEquality"}) -public class OneToOneCache extends AbstractEntityTest { +public class OneToOneCache extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; @@ -79,8 +79,6 @@ public class OneToOneCache extends AbstractEntityTest { em.getTransaction().commit(); - // - ed1_id = ed1.getId(); ed2_id = ed2.getId(); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/QueryCache.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/QueryCache.java index 261beb4c81..f981ddb26d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/QueryCache.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/cache/QueryCache.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.IntTestEntity; @@ -37,7 +37,7 @@ import org.hibernate.envers.test.entities.IntTestEntity; * @author Adam Warski (adam at warski dot org) */ @SuppressWarnings({"ObjectEquality"}) -public class QueryCache extends AbstractEntityTest { +public class QueryCache extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/EnumSet.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/EnumSet.java index d6ecb12d3b..268838cfa1 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/EnumSet.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/EnumSet.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.collection.EnumSetEntity; import org.hibernate.envers.test.entities.collection.EnumSetEntity.E1; @@ -39,7 +39,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class EnumSet extends AbstractEntityTest { +public class EnumSet extends BaseEnversJPAFunctionalTestCase { private Integer sse1_id; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringList.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringList.java index b04a88954e..fc741760c8 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringList.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringList.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.collection.StringListEntity; import org.hibernate.envers.test.tools.TestTools; @@ -38,7 +38,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class StringList extends AbstractEntityTest { +public class StringList extends BaseEnversJPAFunctionalTestCase { private Integer sle1_id; private Integer sle2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringMap.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringMap.java index b147a7b0f5..c699321979 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringMap.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringMap.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.collection.StringMapEntity; import org.hibernate.envers.test.tools.TestTools; @@ -38,7 +38,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class StringMap extends AbstractEntityTest { +public class StringMap extends BaseEnversJPAFunctionalTestCase { private Integer sme1_id; private Integer sme2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringSet.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringSet.java index 4ca8c33c18..f6b86b3732 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringSet.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/StringSet.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.collection.StringSetEntity; import org.hibernate.envers.test.tools.TestTools; @@ -38,7 +38,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class StringSet extends AbstractEntityTest { +public class StringSet extends BaseEnversJPAFunctionalTestCase { private Integer sse1_id; private Integer sse2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/mapkey/ComponentMapKey.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/mapkey/ComponentMapKey.java index bee7a65840..d0c175bb85 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/mapkey/ComponentMapKey.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/mapkey/ComponentMapKey.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.components.Component1; import org.hibernate.envers.test.entities.components.Component2; @@ -39,7 +39,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class ComponentMapKey extends AbstractEntityTest { +public class ComponentMapKey extends BaseEnversJPAFunctionalTestCase { private Integer cmke_id; private Integer cte1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/mapkey/IdMapKey.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/mapkey/IdMapKey.java index 6438051b18..54200a55fe 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/mapkey/IdMapKey.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/mapkey/IdMapKey.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.tools.TestTools; @@ -37,7 +37,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class IdMapKey extends AbstractEntityTest { +public class IdMapKey extends BaseEnversJPAFunctionalTestCase { private Integer imke_id; private Integer ste1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/norevision/AbstractCollectionChangeTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/norevision/AbstractCollectionChangeTest.java index 6222147dce..950a6981ef 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/norevision/AbstractCollectionChangeTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/collection/norevision/AbstractCollectionChangeTest.java @@ -1,22 +1,24 @@ package org.hibernate.envers.test.integration.collection.norevision; -import java.net.URISyntaxException; -import java.util.List; - +import org.hibernate.Session; +import org.hibernate.cfg.Configuration; +import org.hibernate.envers.test.BaseEnversFunctionalTestCase; +import org.hibernate.envers.test.Priority; import org.junit.Test; -import org.hibernate.MappingException; -import org.hibernate.envers.test.AbstractSessionTest; -import org.hibernate.envers.test.Priority; +import java.util.List; -public abstract class AbstractCollectionChangeTest extends AbstractSessionTest { +public abstract class AbstractCollectionChangeTest extends BaseEnversFunctionalTestCase { protected Integer personId; @Override - protected void initMappings() throws MappingException, URISyntaxException { - config.addAnnotatedClass(Person.class); - config.addAnnotatedClass(Name.class); - config.setProperty("org.hibernate.envers.revision_on_collection_change", getCollectionChangeValue()); + protected void configure(Configuration configuration) { + configuration.setProperty("org.hibernate.envers.revision_on_collection_change", getCollectionChangeValue()); + } + + @Override + protected Class[] getAnnotatedClasses() { + return new Class[]{Person.class, Name.class}; } protected abstract String getCollectionChangeValue(); @@ -26,29 +28,29 @@ public abstract class AbstractCollectionChangeTest extends AbstractSessionTest { @Test @Priority(10) public void initData() { - newSessionFactory(); + Session session = openSession(); // Rev 1 - getSession().getTransaction().begin(); + session.getTransaction().begin(); Person p = new Person(); Name n = new Name(); n.setName("name1"); p.getNames().add(n); - getSession().saveOrUpdate(p); - getSession().getTransaction().commit(); + session.saveOrUpdate(p); + session.getTransaction().commit(); // Rev 2 - getSession().getTransaction().begin(); + session.getTransaction().begin(); n.setName("Changed name"); - getSession().saveOrUpdate(p); - getSession().getTransaction().commit(); + session.saveOrUpdate(p); + session.getTransaction().commit(); // Rev 3 - getSession().getTransaction().begin(); + session.getTransaction().begin(); Name n2 = new Name(); n2.setName("name2"); p.getNames().add(n2); - getSession().getTransaction().commit(); + session.getTransaction().commit(); personId = p.getId(); } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/Components.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/Components.java index 04995725c4..338cf078e3 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/Components.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/Components.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.components.Component1; import org.hibernate.envers.test.entities.components.Component2; @@ -38,7 +38,7 @@ import org.hibernate.envers.test.entities.components.ComponentTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class Components extends AbstractEntityTest { +public class Components extends BaseEnversJPAFunctionalTestCase { private Integer id1; private Integer id2; private Integer id3; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/DefaultValueComponents.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/DefaultValueComponents.java index c4e03d6a38..b414eb06f8 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/DefaultValueComponents.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/DefaultValueComponents.java @@ -30,7 +30,7 @@ import org.jboss.logging.Logger; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.components.DefaultValueComponent1; import org.hibernate.envers.test.entities.components.DefaultValueComponent2; @@ -45,7 +45,7 @@ import org.hibernate.envers.test.entities.components.DefaultValueComponentTestEn * * @author Erik-Berndt Scheper */ -public class DefaultValueComponents extends AbstractEntityTest { +public class DefaultValueComponents extends BaseEnversJPAFunctionalTestCase { private static final Logger log = Logger.getLogger( DefaultValueComponents.class ); private Integer id0; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/PropertiesGroupTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/PropertiesGroupTest.java index e594d989c0..7c09e7c644 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/PropertiesGroupTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/PropertiesGroupTest.java @@ -4,11 +4,12 @@ import java.io.File; import java.net.URISyntaxException; import java.net.URL; +import org.hibernate.Session; import org.junit.Assert; import org.junit.Test; import org.hibernate.MappingException; -import org.hibernate.envers.test.AbstractSessionTest; +import org.hibernate.envers.test.BaseEnversFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.components.UniquePropsEntity; import org.hibernate.envers.test.entities.components.UniquePropsNotAuditedEntity; @@ -20,42 +21,44 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-6636") -public class PropertiesGroupTest extends AbstractSessionTest { +public class PropertiesGroupTest extends BaseEnversFunctionalTestCase { private PersistentClass uniquePropsAudit = null; private PersistentClass uniquePropsNotAuditedAudit = null; private UniquePropsEntity entityRev1 = null; private UniquePropsNotAuditedEntity entityNotAuditedRev2 = null; - protected void initMappings() throws MappingException, URISyntaxException { - URL url = Thread.currentThread().getContextClassLoader().getResource("mappings/components/UniquePropsEntity.hbm.xml"); - config.addFile(new File(url.toURI())); - url = Thread.currentThread().getContextClassLoader().getResource("mappings/components/UniquePropsNotAuditedEntity.hbm.xml"); - config.addFile(new File(url.toURI())); + @Override + protected String[] getMappings() { + return new String[] { + "mappings/components/UniquePropsEntity.hbm.xml", + "mappings/components/UniquePropsNotAuditedEntity.hbm.xml" + }; } @Test @Priority(10) public void initData() { - uniquePropsAudit = getCfg().getClassMapping("org.hibernate.envers.test.entities.components.UniquePropsEntity_AUD"); - uniquePropsNotAuditedAudit = getCfg().getClassMapping("org.hibernate.envers.test.entities.components.UniquePropsNotAuditedEntity_AUD"); + uniquePropsAudit = configuration().getClassMapping("org.hibernate.envers.test.entities.components.UniquePropsEntity_AUD"); + uniquePropsNotAuditedAudit = configuration().getClassMapping("org.hibernate.envers.test.entities.components.UniquePropsNotAuditedEntity_AUD"); // Revision 1 - getSession().getTransaction().begin(); + Session session = openSession(); + session.getTransaction().begin(); UniquePropsEntity ent = new UniquePropsEntity(); ent.setData1("data1"); ent.setData2("data2"); - getSession().persist(ent); - getSession().getTransaction().commit(); + session.persist(ent); + session.getTransaction().commit(); entityRev1 = new UniquePropsEntity(ent.getId(), ent.getData1(), ent.getData2()); // Revision 2 - getSession().getTransaction().begin(); + session.getTransaction().begin(); UniquePropsNotAuditedEntity entNotAud = new UniquePropsNotAuditedEntity(); entNotAud.setData1("data3"); entNotAud.setData2("data4"); - getSession().persist(entNotAud); - getSession().getTransaction().commit(); + session.persist(entNotAud); + session.getTransaction().commit(); entityNotAuditedRev2 = new UniquePropsNotAuditedEntity(entNotAud.getId(), entNotAud.getData1(), null); } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/collections/CollectionOfComponents.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/collections/CollectionOfComponents.java index 1649bbf789..fea04482cd 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/collections/CollectionOfComponents.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/collections/CollectionOfComponents.java @@ -31,7 +31,7 @@ import org.junit.Ignore; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.components.Component1; import org.hibernate.envers.test.entities.components.ComponentSetTestEntity; @@ -41,7 +41,7 @@ import org.hibernate.envers.test.entities.components.ComponentSetTestEntity; * @author Adam Warski (adam at warski dot org) */ @Ignore -public class CollectionOfComponents extends AbstractEntityTest { +public class CollectionOfComponents extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/ManyToOneInComponent.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/ManyToOneInComponent.java index 4ebd39ef21..b70826928c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/ManyToOneInComponent.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/ManyToOneInComponent.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.components.relations.ManyToOneComponent; @@ -38,14 +38,15 @@ import org.hibernate.envers.test.entities.components.relations.ManyToOneComponen /** * @author Adam Warski (adam at warski dot org) */ -public class ManyToOneInComponent extends AbstractEntityTest { +public class ManyToOneInComponent extends BaseEnversJPAFunctionalTestCase { private Integer mtocte_id1; private Integer ste_id1; private Integer ste_id2; - public void configure(Ejb3Configuration cfg) { - cfg.addAnnotatedClass(ManyToOneComponentTestEntity.class); - cfg.addAnnotatedClass(StrTestEntity.class); + @Override + protected Class[] getAnnotatedClasses() { + return new Class[]{ManyToOneComponentTestEntity.class, StrTestEntity.class}; + } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/NotAuditedManyToOneInComponent.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/NotAuditedManyToOneInComponent.java index 22a9251185..7c778a695c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/NotAuditedManyToOneInComponent.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/NotAuditedManyToOneInComponent.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.UnversionedStrTestEntity; import org.hibernate.envers.test.entities.components.relations.NotAuditedManyToOneComponent; @@ -38,7 +38,7 @@ import org.hibernate.envers.test.entities.components.relations.NotAuditedManyToO /** * @author Adam Warski (adam at warski dot org) */ -public class NotAuditedManyToOneInComponent extends AbstractEntityTest { +public class NotAuditedManyToOneInComponent extends BaseEnversJPAFunctionalTestCase { private Integer mtocte_id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/OneToManyInComponent.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/OneToManyInComponent.java index 196bbd9686..991fab60f7 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/OneToManyInComponent.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/components/relations/OneToManyInComponent.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.components.relations.OneToManyComponent; @@ -38,7 +38,7 @@ import org.hibernate.envers.test.entities.components.relations.OneToManyComponen /** * @author Adam Warski (adam at warski dot org) */ -public class OneToManyInComponent extends AbstractEntityTest { +public class OneToManyInComponent extends BaseEnversJPAFunctionalTestCase { private Integer otmcte_id1; private Integer ste_id1; private Integer ste_id2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/customtype/CompositeCustom.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/customtype/CompositeCustom.java index 145ea25f30..14d2595093 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/customtype/CompositeCustom.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/customtype/CompositeCustom.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.customtype.Component; import org.hibernate.envers.test.entities.customtype.CompositeCustomTypeEntity; @@ -37,7 +37,7 @@ import org.hibernate.envers.test.entities.customtype.CompositeCustomTypeEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class CompositeCustom extends AbstractEntityTest { +public class CompositeCustom extends BaseEnversJPAFunctionalTestCase { private Integer ccte_id; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/customtype/ParametrizedCustom.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/customtype/ParametrizedCustom.java index 5d5c325ca7..c09fd559e6 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/customtype/ParametrizedCustom.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/customtype/ParametrizedCustom.java @@ -29,14 +29,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.customtype.ParametrizedCustomTypeEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class ParametrizedCustom extends AbstractEntityTest { +public class ParametrizedCustom extends BaseEnversJPAFunctionalTestCase { private Integer pcte_id; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Dates.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Dates.java index 7874b7ff05..fe797568e6 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Dates.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Dates.java @@ -31,13 +31,13 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class Dates extends AbstractEntityTest { +public class Dates extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Enums.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Enums.java index 57bc4cc596..544aaa281c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Enums.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Enums.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class Enums extends AbstractEntityTest { +public class Enums extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { @@ -57,8 +57,6 @@ public class Enums extends AbstractEntityTest { ete.setEnum1(EnumTestEntity.E1.Y); ete.setEnum2(EnumTestEntity.E2.B); em.getTransaction().commit(); - - newEntityManager(); } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/LobSerializables.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/LobSerializables.java index 0bf4a1e663..22018eeb9d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/LobSerializables.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/LobSerializables.java @@ -24,14 +24,14 @@ package org.hibernate.envers.test.integration.data; import java.util.Arrays; -import java.util.Properties; +import java.util.Map; import javax.persistence.EntityManager; import org.hibernate.dialect.PostgreSQL82Dialect; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.testing.DialectChecks; import org.hibernate.testing.RequiresDialectFeature; @@ -39,7 +39,7 @@ import org.hibernate.testing.RequiresDialectFeature; * @author Adam Warski (adam at warski dot org) */ @RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class) -public class LobSerializables extends AbstractEntityTest { +public class LobSerializables extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { @@ -47,11 +47,11 @@ public class LobSerializables extends AbstractEntityTest { } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties(configuration); + protected void addConfigOptions(Map options) { + super.addConfigOptions(options); if (getDialect() instanceof PostgreSQL82Dialect) { // In PostgreSQL LOBs cannot be used in auto-commit mode. - configuration.setProperty("hibernate.connection.autocommit", "false"); + options.put("hibernate.connection.autocommit", "false"); } } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Lobs.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Lobs.java index 83270bada9..153220e33f 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Lobs.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Lobs.java @@ -24,14 +24,14 @@ package org.hibernate.envers.test.integration.data; import java.util.Arrays; -import java.util.Properties; +import java.util.Map; import javax.persistence.EntityManager; import org.hibernate.dialect.PostgreSQL82Dialect; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.testing.DialectChecks; import org.hibernate.testing.RequiresDialectFeature; @@ -40,7 +40,7 @@ import org.hibernate.testing.RequiresDialectFeature; * @author Adam Warski (adam at warski dot org) */ @RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class) -public class Lobs extends AbstractEntityTest { +public class Lobs extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { @@ -48,11 +48,11 @@ public class Lobs extends AbstractEntityTest { } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties(configuration); + protected void addConfigOptions(Map options) { + super.addConfigOptions(options); if (getDialect() instanceof PostgreSQL82Dialect) { // In PostgreSQL LOBs cannot be used in auto-commit mode. - configuration.setProperty("hibernate.connection.autocommit", "false"); + options.put("hibernate.connection.autocommit", "false"); } } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Serializables.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Serializables.java index 8ed82e583e..e9e84c81cd 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Serializables.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/data/Serializables.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class Serializables extends AbstractEntityTest { +public class Serializables extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/flush/AbstractFlushTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/flush/AbstractFlushTest.java index 64ab3f3869..d4709eb03f 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/flush/AbstractFlushTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/flush/AbstractFlushTest.java @@ -31,13 +31,13 @@ import org.junit.Before; import org.hibernate.FlushMode; import org.hibernate.Session; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.entities.StrTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public abstract class AbstractFlushTest extends AbstractEntityTest { +public abstract class AbstractFlushTest extends BaseEnversJPAFunctionalTestCase { public abstract FlushMode getFlushMode(); public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/flush/ManualFlushAutoCommitDisabled.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/flush/ManualFlushAutoCommitDisabled.java index 49118a7568..c12e3f4e56 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/flush/ManualFlushAutoCommitDisabled.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/flush/ManualFlushAutoCommitDisabled.java @@ -1,20 +1,17 @@ package org.hibernate.envers.test.integration.flush; -import java.util.Properties; - -import org.hibernate.FlushMode; -import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.testing.TestForIssue; +import java.util.Map; + /** * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-7017") public class ManualFlushAutoCommitDisabled extends ManualFlush { - - @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties( configuration ); - configuration.setProperty("hibernate.connection.autocommit", "false"); - } + @Override + protected void addConfigOptions(Map options) { + super.addConfigOptions(options); + options.put("hibernate.connection.autocommit", "false"); + } } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/hashcode/ChangingHashcode.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/hashcode/ChangingHashcode.java index 04449a48b7..56e28d2afe 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/hashcode/ChangingHashcode.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/hashcode/ChangingHashcode.java @@ -29,14 +29,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class ChangingHashcode extends AbstractEntityTest { +public class ChangingHashcode extends BaseEnversJPAFunctionalTestCase { private Long pageId; private Long imageId; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java index 326888b6ec..48f6449471 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java @@ -29,8 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; -import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.CompositeDateIdTestEntity; import org.hibernate.envers.test.entities.ids.DateEmbId; @@ -38,11 +37,12 @@ import org.hibernate.envers.test.entities.ids.DateEmbId; /** * @author Adam Warski (adam at warski dot org) */ -public class CompositeDateId extends AbstractEntityTest { +public class CompositeDateId extends BaseEnversJPAFunctionalTestCase { private DateEmbId id1; - public void configure(Ejb3Configuration cfg) { - cfg.addAnnotatedClass(CompositeDateIdTestEntity.class); + @Override + protected Class[] getAnnotatedClasses() { + return new Class[]{CompositeDateIdTestEntity.class}; } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/CompositeIds.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/CompositeIds.java index 6708b3f507..1c91c59af5 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/CompositeIds.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/CompositeIds.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.CustomEnum; import org.hibernate.envers.test.entities.ids.EmbId; @@ -42,7 +42,7 @@ import org.hibernate.envers.test.entities.ids.MulIdTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class CompositeIds extends AbstractEntityTest { +public class CompositeIds extends BaseEnversJPAFunctionalTestCase { private EmbId id1; private EmbId id2; private MulId id3; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/DateId.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/DateId.java index 0c9e2112a9..014d6a8837 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/DateId.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/DateId.java @@ -30,14 +30,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.DateIdTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class DateId extends AbstractEntityTest { +public class DateId extends BaseEnversJPAFunctionalTestCase { private Date id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/ManyToOneIdNotAudited.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/ManyToOneIdNotAudited.java index 83f4364c14..87dbe34b97 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/ManyToOneIdNotAudited.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/ids/ManyToOneIdNotAudited.java @@ -5,7 +5,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.UnversionedStrTestEntity; @@ -17,7 +17,7 @@ import org.hibernate.envers.test.entities.ids.ManyToOneNotAuditedEmbId; * components in their ids, e.g. a many-to-one join to another entity. * @author Adam Warski (adam at warski dot org) */ -public class ManyToOneIdNotAudited extends AbstractEntityTest { +public class ManyToOneIdNotAudited extends BaseEnversJPAFunctionalTestCase { private ManyToOneNotAuditedEmbId id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ChildAuditing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ChildAuditing.java index 4c1dd0da9d..30520ea5db 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ChildAuditing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ChildAuditing.java @@ -30,13 +30,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class ChildAuditing extends AbstractEntityTest { +public class ChildAuditing extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ChildNullAuditing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ChildNullAuditing.java index d4f0afd591..b9bf7bba55 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ChildNullAuditing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ChildNullAuditing.java @@ -30,13 +30,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class ChildNullAuditing extends AbstractEntityTest { +public class ChildNullAuditing extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ParentAuditing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ParentAuditing.java index bd258989a7..857a8c0e82 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ParentAuditing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/ParentAuditing.java @@ -30,13 +30,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class ParentAuditing extends AbstractEntityTest { +public class ParentAuditing extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/childrelation/ChildReferencing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/childrelation/ChildReferencing.java index 86792122ff..791171a308 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/childrelation/ChildReferencing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/childrelation/ChildReferencing.java @@ -30,14 +30,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class ChildReferencing extends AbstractEntityTest { +public class ChildReferencing extends BaseEnversJPAFunctionalTestCase { private Integer re_id1; private Integer re_id2; private Integer c_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/emptychild/EmptyChildAuditing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/emptychild/EmptyChildAuditing.java index 1e407aa24e..05e6d15d5a 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/emptychild/EmptyChildAuditing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/emptychild/EmptyChildAuditing.java @@ -30,13 +30,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class EmptyChildAuditing extends AbstractEntityTest { +public class EmptyChildAuditing extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/notownedrelation/NotOwnedBidirectional.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/notownedrelation/NotOwnedBidirectional.java index 0330513460..9edd211662 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/notownedrelation/NotOwnedBidirectional.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/notownedrelation/NotOwnedBidirectional.java @@ -30,14 +30,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class NotOwnedBidirectional extends AbstractEntityTest { +public class NotOwnedBidirectional extends BaseEnversJPAFunctionalTestCase { private Long pc_id; private Long a1_id; private Long a2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/primarykeyjoin/ChildPrimaryKeyJoinAuditing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/primarykeyjoin/ChildPrimaryKeyJoinAuditing.java index ed7179787e..3589fa8c19 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/primarykeyjoin/ChildPrimaryKeyJoinAuditing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/primarykeyjoin/ChildPrimaryKeyJoinAuditing.java @@ -31,7 +31,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.integration.inheritance.joined.ParentEntity; import org.hibernate.mapping.Column; @@ -39,7 +39,7 @@ import org.hibernate.mapping.Column; /** * @author Adam Warski (adam at warski dot org) */ -public class ChildPrimaryKeyJoinAuditing extends AbstractEntityTest { +public class ChildPrimaryKeyJoinAuditing extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/ParentReferencingChildTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/ParentReferencingChildTest.java index fb61d2436a..6947c647da 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/ParentReferencingChildTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/ParentReferencingChildTest.java @@ -7,7 +7,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; import org.hibernate.testing.TestForIssue; @@ -16,7 +16,7 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-3843") -public class ParentReferencingChildTest extends AbstractEntityTest { +public class ParentReferencingChildTest extends BaseEnversJPAFunctionalTestCase { Person expLukaszRev1 = null; Role expAdminRev1 = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/PolymorphicCollection.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/PolymorphicCollection.java index 34895cb8e0..b52c539b96 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/PolymorphicCollection.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/PolymorphicCollection.java @@ -30,14 +30,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class PolymorphicCollection extends AbstractEntityTest { +public class PolymorphicCollection extends BaseEnversJPAFunctionalTestCase { private Integer ed_id1; private Integer c_id; private Integer p_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/unidirectional/UnidirectionalDoubleAbstract.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/unidirectional/UnidirectionalDoubleAbstract.java index 977e93ac03..e747c9047f 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/unidirectional/UnidirectionalDoubleAbstract.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/joined/relation/unidirectional/UnidirectionalDoubleAbstract.java @@ -31,13 +31,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class UnidirectionalDoubleAbstract extends AbstractEntityTest { +public class UnidirectionalDoubleAbstract extends BaseEnversJPAFunctionalTestCase { private Long cce1_id; private Integer cse1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/mixed/MixedInheritanceStrategiesEntityTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/mixed/MixedInheritanceStrategiesEntityTest.java index d98d0dafe2..36d85bd160 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/mixed/MixedInheritanceStrategiesEntityTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/mixed/MixedInheritanceStrategiesEntityTest.java @@ -5,7 +5,7 @@ import java.util.Arrays; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.integration.inheritance.mixed.entities.AbstractActivity; import org.hibernate.envers.test.integration.inheritance.mixed.entities.AbstractCheckActivity; @@ -19,7 +19,7 @@ import static org.junit.Assert.assertEquals; /** * @author Michal Skowronek (mskowr at o2 pl) */ -public class MixedInheritanceStrategiesEntityTest extends AbstractEntityTest { +public class MixedInheritanceStrategiesEntityTest extends BaseEnversJPAFunctionalTestCase { private ActivityId id2; private ActivityId id1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/ChildAuditing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/ChildAuditing.java index 24f393b213..520591f62e 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/ChildAuditing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/ChildAuditing.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class ChildAuditing extends AbstractEntityTest { +public class ChildAuditing extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/ParentAuditing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/ParentAuditing.java index ee9eac552f..e6e6bb6eb3 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/ParentAuditing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/ParentAuditing.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class ParentAuditing extends AbstractEntityTest { +public class ParentAuditing extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java index 5de5874e3e..f143105460 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java @@ -29,14 +29,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class ChildReferencing extends AbstractEntityTest { +public class ChildReferencing extends BaseEnversJPAFunctionalTestCase { private Integer re_id1; private Integer re_id2; private Integer c_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/discriminatorformula/DiscriminatorFormulaTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/discriminatorformula/DiscriminatorFormulaTest.java index 5dd7f0f936..1b0c0ca5c5 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/discriminatorformula/DiscriminatorFormulaTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/discriminatorformula/DiscriminatorFormulaTest.java @@ -9,7 +9,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Formula; import org.hibernate.mapping.PersistentClass; @@ -17,7 +17,7 @@ import org.hibernate.mapping.PersistentClass; /** * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class DiscriminatorFormulaTest extends AbstractEntityTest { +public class DiscriminatorFormulaTest extends BaseEnversJPAFunctionalTestCase { private PersistentClass parentAudit = null; private ChildEntity childVer1 = null; private ChildEntity childVer2 = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/notownedrelation/NotOwnedBidirectional.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/notownedrelation/NotOwnedBidirectional.java index 90503c8ea8..416d084dac 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/notownedrelation/NotOwnedBidirectional.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/notownedrelation/NotOwnedBidirectional.java @@ -30,14 +30,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class NotOwnedBidirectional extends AbstractEntityTest { +public class NotOwnedBidirectional extends BaseEnversJPAFunctionalTestCase { private Long pc_id; private Long a1_id; private Long a2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java index c3cf68cd54..fd15eaae05 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java @@ -29,14 +29,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class PolymorphicCollection extends AbstractEntityTest { +public class PolymorphicCollection extends BaseEnversJPAFunctionalTestCase { private Integer ed_id1; private Integer c_id; private Integer p_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/ChildAuditing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/ChildAuditing.java index 38e215ba17..835b5bd44c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/ChildAuditing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/ChildAuditing.java @@ -30,13 +30,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class ChildAuditing extends AbstractEntityTest { +public class ChildAuditing extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/ParentAuditing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/ParentAuditing.java index 0bbdf63af0..42b585ed16 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/ParentAuditing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/ParentAuditing.java @@ -30,13 +30,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class ParentAuditing extends AbstractEntityTest { +public class ParentAuditing extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/childrelation/ChildReferencing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/childrelation/ChildReferencing.java index 07e0e0e497..e0b83e4ca5 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/childrelation/ChildReferencing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/childrelation/ChildReferencing.java @@ -30,14 +30,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class ChildReferencing extends AbstractEntityTest { +public class ChildReferencing extends BaseEnversJPAFunctionalTestCase { private Integer re_id1; private Integer re_id2; private Integer c_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/notownedrelation/NotOwnedBidirectional.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/notownedrelation/NotOwnedBidirectional.java index 98fdf309a2..24a00789c9 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/notownedrelation/NotOwnedBidirectional.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/notownedrelation/NotOwnedBidirectional.java @@ -30,14 +30,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class NotOwnedBidirectional extends AbstractEntityTest { +public class NotOwnedBidirectional extends BaseEnversJPAFunctionalTestCase { private Long pc_id; private Long a1_id; private Long a2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/relation/PolymorphicCollection.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/relation/PolymorphicCollection.java index 93aaddc7a2..9e89e559c4 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/relation/PolymorphicCollection.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/inheritance/tableperclass/relation/PolymorphicCollection.java @@ -30,14 +30,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class PolymorphicCollection extends AbstractEntityTest { +public class PolymorphicCollection extends BaseEnversJPAFunctionalTestCase { private Integer ed_id1; private Integer c_id; private Integer p_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/components/InterfacesComponents.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/components/InterfacesComponents.java index 175a294319..88de01b5fc 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/components/InterfacesComponents.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/components/InterfacesComponents.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class InterfacesComponents extends AbstractEntityTest { +public class InterfacesComponents extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/AbstractAllAuditedTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/AbstractAllAuditedTest.java index 433659fdf2..a4f858f1b8 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/AbstractAllAuditedTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/AbstractAllAuditedTest.java @@ -7,14 +7,14 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.envers.exception.NotAuditedException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Hern�n Chanfreau * @author Adam Warski (adam at warski dot org) */ -public abstract class AbstractAllAuditedTest extends AbstractEntityTest { +public abstract class AbstractAllAuditedTest extends BaseEnversJPAFunctionalTestCase { private long ai_id; private long nai_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/joined/JoinedAllAuditedTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/joined/JoinedAllAuditedTest.java index 780863dbaa..0589bd6c83 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/joined/JoinedAllAuditedTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/joined/JoinedAllAuditedTest.java @@ -1,23 +1,13 @@ package org.hibernate.envers.test.integration.interfaces.hbm.allAudited.joined; -import java.io.File; -import java.net.URISyntaxException; -import java.net.URL; - -import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.test.integration.interfaces.hbm.allAudited.AbstractAllAuditedTest; /** * @author Hern�n Chanfreau */ public class JoinedAllAuditedTest extends AbstractAllAuditedTest { - - public void configure(Ejb3Configuration cfg) { - try { - URL url = Thread.currentThread().getContextClassLoader().getResource("mappings/interfaces/joinedAllAuditedMappings.hbm.xml"); - cfg.addFile(new File(url.toURI())); - } catch (URISyntaxException e) { - e.printStackTrace(); - } + @Override + protected String[] getMappings() { + return new String[]{"mappings/interfaces/joinedAllAuditedMappings.hbm.xml"}; } } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/subclass/SubclassAllAuditedTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/subclass/SubclassAllAuditedTest.java index 41981ab68c..3cf243f48c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/subclass/SubclassAllAuditedTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/subclass/SubclassAllAuditedTest.java @@ -1,24 +1,13 @@ package org.hibernate.envers.test.integration.interfaces.hbm.allAudited.subclass; -import java.io.File; -import java.net.URISyntaxException; -import java.net.URL; - -import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.test.integration.interfaces.hbm.allAudited.AbstractAllAuditedTest; /** * @author Hern�n Chanfreau */ public class SubclassAllAuditedTest extends AbstractAllAuditedTest { - - public void configure(Ejb3Configuration cfg) { - try { - URL url = Thread.currentThread().getContextClassLoader().getResource("mappings/interfaces/subclassAllAuditedMappings.hbm.xml"); - cfg.addFile(new File(url.toURI())); - } catch (URISyntaxException e) { - e.printStackTrace(); - } + @Override + protected String[] getMappings() { + return new String[]{"mappings/interfaces/subclassAllAuditedMappings.hbm.xml"}; } - } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/union/UnionAllAuditedTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/union/UnionAllAuditedTest.java index d3f2768075..b84209dea1 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/union/UnionAllAuditedTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/allAudited/union/UnionAllAuditedTest.java @@ -1,23 +1,13 @@ package org.hibernate.envers.test.integration.interfaces.hbm.allAudited.union; -import java.io.File; -import java.net.URISyntaxException; -import java.net.URL; - -import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.test.integration.interfaces.hbm.allAudited.AbstractAllAuditedTest; /** * @author Hern�n Chanfreau */ public class UnionAllAuditedTest extends AbstractAllAuditedTest { - - public void configure(Ejb3Configuration cfg) { - try { - URL url = Thread.currentThread().getContextClassLoader().getResource("mappings/interfaces/unionAllAuditedMappings.hbm.xml"); - cfg.addFile(new File(url.toURI())); - } catch (URISyntaxException e) { - e.printStackTrace(); - } + @Override + protected String[] getMappings() { + return new String[]{"mappings/interfaces/unionAllAuditedMappings.hbm.xml"}; } } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/propertiesAudited/AbstractPropertiesAuditedTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/propertiesAudited/AbstractPropertiesAuditedTest.java index ba3dcd99ff..6889fe0dca 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/propertiesAudited/AbstractPropertiesAuditedTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/propertiesAudited/AbstractPropertiesAuditedTest.java @@ -5,14 +5,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.envers.exception.NotAuditedException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; /** * @author Hern�n Chanfreau * */ -public abstract class AbstractPropertiesAuditedTest extends AbstractEntityTest { +public abstract class AbstractPropertiesAuditedTest extends BaseEnversJPAFunctionalTestCase { private long ai_id; private long nai_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/propertiesAudited2/AbstractPropertiesAudited2Test.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/propertiesAudited2/AbstractPropertiesAudited2Test.java index 979382b9a5..2d287a8810 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/propertiesAudited2/AbstractPropertiesAudited2Test.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/hbm/propertiesAudited2/AbstractPropertiesAudited2Test.java @@ -5,14 +5,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.envers.exception.NotAuditedException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Hern�n Chanfreau * */ -public abstract class AbstractPropertiesAudited2Test extends AbstractEntityTest { +public abstract class AbstractPropertiesAudited2Test extends BaseEnversJPAFunctionalTestCase { private long ai_id; private long nai_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/relation/InterfacesRelation.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/relation/InterfacesRelation.java index 24a090feb6..5985211ebb 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/relation/InterfacesRelation.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/interfaces/relation/InterfacesRelation.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class InterfacesRelation extends AbstractEntityTest { +public class InterfacesRelation extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/jta/JtaExceptionListener.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/jta/JtaExceptionListener.java index 00ea0a0bf5..2b6693660b 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/jta/JtaExceptionListener.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/jta/JtaExceptionListener.java @@ -23,7 +23,7 @@ */ package org.hibernate.envers.test.integration.jta; -import java.util.Properties; +import java.util.Map; import javax.persistence.EntityManager; import javax.transaction.RollbackException; @@ -31,7 +31,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.integration.reventity.ExceptionListenerRevEntity; @@ -42,16 +42,15 @@ import org.hibernate.testing.jta.TestingJtaBootstrap; * Same as {@link org.hibernate.envers.test.integration.reventity.ExceptionListener}, but in a JTA environment. * @author Adam Warski (adam at warski dot org) */ -public class JtaExceptionListener extends AbstractEntityTest { +public class JtaExceptionListener extends BaseEnversJPAFunctionalTestCase { public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(StrTestEntity.class); cfg.addAnnotatedClass(ExceptionListenerRevEntity.class); } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties(configuration); - TestingJtaBootstrap.prepare( configuration ); + protected void addConfigOptions(Map options) { + TestingJtaBootstrap.prepare(options); } @Test(expected = RollbackException.class) @@ -60,7 +59,6 @@ public class JtaExceptionListener extends AbstractEntityTest { TestingJtaBootstrap.INSTANCE.getTransactionManager().begin(); try { - newEntityManager(); EntityManager em = getEntityManager(); // Trying to persist an entity - however the listener should throw an exception, so the entity @@ -78,7 +76,6 @@ public class JtaExceptionListener extends AbstractEntityTest { try { // Checking if the entity became persisted - newEntityManager(); EntityManager em = getEntityManager(); long count = em.createQuery("from StrTestEntity s where s.str = 'x'").getResultList().size(); Assert.assertEquals( 0, count ); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/jta/JtaTransaction.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/jta/JtaTransaction.java index 2658bdd566..11710e5712 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/jta/JtaTransaction.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/jta/JtaTransaction.java @@ -2,33 +2,31 @@ package org.hibernate.envers.test.integration.jta; import javax.persistence.EntityManager; import java.util.Arrays; -import java.util.Properties; +import java.util.Map; -import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.IntTestEntity; import org.junit.Test; -import org.hibernate.testing.FailureExpected; import org.hibernate.testing.jta.TestingJtaBootstrap; /** * Same as {@link org.hibernate.envers.test.integration.basic.Simple}, but in a JTA environment. * @author Adam Warski (adam at warski dot org) */ -public class JtaTransaction extends AbstractEntityTest { +public class JtaTransaction extends BaseEnversJPAFunctionalTestCase { private Integer id1; - public void configure(Ejb3Configuration cfg) { - cfg.addAnnotatedClass(IntTestEntity.class); + @Override + protected Class[] getAnnotatedClasses() { + return new Class[]{IntTestEntity.class}; } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties(configuration); - TestingJtaBootstrap.prepare( configuration ); + protected void addConfigOptions(Map options) { + TestingJtaBootstrap.prepare(options); } @Test @@ -39,7 +37,6 @@ public class JtaTransaction extends AbstractEntityTest { EntityManager em; IntTestEntity ite; try { - newEntityManager(); em = getEntityManager(); ite = new IntTestEntity(10); em.persist(ite); @@ -47,19 +44,18 @@ public class JtaTransaction extends AbstractEntityTest { } finally { TestingJtaBootstrap.tryCommit(); } - - // + em.close(); TestingJtaBootstrap.INSTANCE.getTransactionManager().begin(); try { - newEntityManager(); em = getEntityManager(); ite = em.find(IntTestEntity.class, id1); ite.setNumber(20); } finally { TestingJtaBootstrap.tryCommit(); } + em.close(); } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicList.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicList.java index df8cfdf036..86adcbd58c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicList.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicList.java @@ -31,7 +31,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.manytomany.ListOwnedEntity; import org.hibernate.envers.test.entities.manytomany.ListOwningEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicList extends AbstractEntityTest { +public class BasicList extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicMap.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicMap.java index 614478f166..ea562ae3fb 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicMap.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicMap.java @@ -31,7 +31,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.manytomany.MapOwnedEntity; import org.hibernate.envers.test.entities.manytomany.MapOwningEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicMap extends AbstractEntityTest { +public class BasicMap extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicSet.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicSet.java index cc46b52cfc..8d19cfc42a 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicSet.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicSet.java @@ -31,7 +31,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.manytomany.SetOwnedEntity; import org.hibernate.envers.test.entities.manytomany.SetOwningEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicSet extends AbstractEntityTest { +public class BasicSet extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicWhereJoinTable.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicWhereJoinTable.java index bb9268be18..884bdb11d6 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicWhereJoinTable.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/BasicWhereJoinTable.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.IntNoAutoIdTestEntity; import org.hibernate.envers.test.entities.manytomany.WhereJoinTableEntity; @@ -40,7 +40,7 @@ import static org.junit.Assert.assertEquals; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicWhereJoinTable extends AbstractEntityTest { +public class BasicWhereJoinTable extends BaseEnversJPAFunctionalTestCase { private Integer ite1_1_id; private Integer ite1_2_id; private Integer ite2_1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/CustomComparatorEntityTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/CustomComparatorEntityTest.java index c580ad1f45..0a2cbc94ac 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/CustomComparatorEntityTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/CustomComparatorEntityTest.java @@ -33,7 +33,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.StrTestEntityComparator; @@ -44,7 +44,7 @@ import static org.junit.Assert.assertEquals; /** * @author Michal Skowronek (mskowr at o2 pl) */ -public class CustomComparatorEntityTest extends AbstractEntityTest { +public class CustomComparatorEntityTest extends BaseEnversJPAFunctionalTestCase { private Integer id1; private Integer id2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/biowned/BasicBiowned.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/biowned/BasicBiowned.java index c0f97f5986..9856a15b73 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/biowned/BasicBiowned.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/biowned/BasicBiowned.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.manytomany.biowned.ListBiowning1Entity; import org.hibernate.envers.test.entities.manytomany.biowned.ListBiowning2Entity; @@ -40,7 +40,7 @@ import static org.junit.Assert.assertEquals; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicBiowned extends AbstractEntityTest { +public class BasicBiowned extends BaseEnversJPAFunctionalTestCase { private Integer o1_1_id; private Integer o1_2_id; private Integer o2_1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/inverseToSuperclass/ManyToManyInverseToSuperclassTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/inverseToSuperclass/ManyToManyInverseToSuperclassTest.java index de652a681e..b111d13059 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/inverseToSuperclass/ManyToManyInverseToSuperclassTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/inverseToSuperclass/ManyToManyInverseToSuperclassTest.java @@ -9,7 +9,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; /** @@ -17,7 +17,7 @@ import org.hibernate.envers.test.Priority; * */ -public class ManyToManyInverseToSuperclassTest extends AbstractEntityTest { +public class ManyToManyInverseToSuperclassTest extends BaseEnversJPAFunctionalTestCase { private long m1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/sametable/BasicSametable.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/sametable/BasicSametable.java index ebbcfcbfaf..ef302cff11 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/sametable/BasicSametable.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/sametable/BasicSametable.java @@ -33,7 +33,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.dialect.PostgreSQL82Dialect; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.manytomany.sametable.Child1Entity; import org.hibernate.envers.test.entities.manytomany.sametable.Child2Entity; @@ -44,7 +44,7 @@ import org.hibernate.envers.test.tools.TestTools; * Test which checks that auditing entities which contain multiple mappings to same tables work. * @author Adam Warski (adam at warski dot org) */ -public class BasicSametable extends AbstractEntityTest { +public class BasicSametable extends BaseEnversJPAFunctionalTestCase { private Integer p1_id; private Integer p2_id; private Integer c1_1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMap.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMap.java index 82c883869a..22892d0de4 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMap.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMap.java @@ -30,16 +30,16 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; -import org.hibernate.envers.test.entities.IntTestEntity; -import org.hibernate.envers.test.entities.StrTestEntity; +import org.hibernate.envers.test.entities.IntTestPrivSeqEntity; +import org.hibernate.envers.test.entities.StrTestPrivSeqEntity; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class TernaryMap extends AbstractEntityTest { +public class TernaryMap extends BaseEnversJPAFunctionalTestCase { private Integer str1_id; private Integer str2_id; @@ -51,8 +51,8 @@ public class TernaryMap extends AbstractEntityTest { public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(TernaryMapEntity.class); - cfg.addAnnotatedClass(StrTestEntity.class); - cfg.addAnnotatedClass(IntTestEntity.class); + cfg.addAnnotatedClass(StrTestPrivSeqEntity.class); + cfg.addAnnotatedClass(IntTestPrivSeqEntity.class); } @Test @@ -60,11 +60,11 @@ public class TernaryMap extends AbstractEntityTest { public void initData() { EntityManager em = getEntityManager(); - StrTestEntity str1 = new StrTestEntity("a"); - StrTestEntity str2 = new StrTestEntity("b"); + StrTestPrivSeqEntity str1 = new StrTestPrivSeqEntity("a"); + StrTestPrivSeqEntity str2 = new StrTestPrivSeqEntity("b"); - IntTestEntity int1 = new IntTestEntity(1); - IntTestEntity int2 = new IntTestEntity(2); + IntTestPrivSeqEntity int1 = new IntTestPrivSeqEntity(1); + IntTestPrivSeqEntity int2 = new IntTestPrivSeqEntity(2); TernaryMapEntity map1 = new TernaryMapEntity(); TernaryMapEntity map2 = new TernaryMapEntity(); @@ -91,11 +91,11 @@ public class TernaryMap extends AbstractEntityTest { map1 = em.find(TernaryMapEntity.class, map1.getId()); map2 = em.find(TernaryMapEntity.class, map2.getId()); - str1 = em.find(StrTestEntity.class, str1.getId()); - str2 = em.find(StrTestEntity.class, str2.getId()); + str1 = em.find(StrTestPrivSeqEntity.class, str1.getId()); + str2 = em.find(StrTestPrivSeqEntity.class, str2.getId()); - int1 = em.find(IntTestEntity.class, int1.getId()); - int2 = em.find(IntTestEntity.class, int2.getId()); + int1 = em.find(IntTestPrivSeqEntity.class, int1.getId()); + int2 = em.find(IntTestPrivSeqEntity.class, int2.getId()); map1.getMap().put(int1, str2); @@ -110,10 +110,10 @@ public class TernaryMap extends AbstractEntityTest { map1 = em.find(TernaryMapEntity.class, map1.getId()); map2 = em.find(TernaryMapEntity.class, map2.getId()); - str2 = em.find(StrTestEntity.class, str2.getId()); + str2 = em.find(StrTestPrivSeqEntity.class, str2.getId()); - int1 = em.find(IntTestEntity.class, int1.getId()); - int2 = em.find(IntTestEntity.class, int2.getId()); + int1 = em.find(IntTestPrivSeqEntity.class, int1.getId()); + int2 = em.find(IntTestPrivSeqEntity.class, int2.getId()); map1.getMap().remove(int2); map1.getMap().put(int1, str2); @@ -128,10 +128,10 @@ public class TernaryMap extends AbstractEntityTest { map1 = em.find(TernaryMapEntity.class, map1.getId()); map2 = em.find(TernaryMapEntity.class, map2.getId()); - str2 = em.find(StrTestEntity.class, str2.getId()); + str2 = em.find(StrTestPrivSeqEntity.class, str2.getId()); - int1 = em.find(IntTestEntity.class, int1.getId()); - int2 = em.find(IntTestEntity.class, int2.getId()); + int1 = em.find(IntTestPrivSeqEntity.class, int1.getId()); + int2 = em.find(IntTestPrivSeqEntity.class, int2.getId()); map1.getMap().put(int2, str2); @@ -155,20 +155,20 @@ public class TernaryMap extends AbstractEntityTest { assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(TernaryMapEntity.class, map1_id)); assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(TernaryMapEntity.class, map2_id)); - assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id)); - assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id)); + assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestPrivSeqEntity.class, str1_id)); + assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestPrivSeqEntity.class, str2_id)); - assert Arrays.asList(1).equals(getAuditReader().getRevisions(IntTestEntity.class, int1_id)); - assert Arrays.asList(1).equals(getAuditReader().getRevisions(IntTestEntity.class, int2_id)); + assert Arrays.asList(1).equals(getAuditReader().getRevisions(IntTestPrivSeqEntity.class, int1_id)); + assert Arrays.asList(1).equals(getAuditReader().getRevisions(IntTestPrivSeqEntity.class, int2_id)); } @Test public void testHistoryOfMap1() { - StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id); - StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id); + StrTestPrivSeqEntity str1 = getEntityManager().find(StrTestPrivSeqEntity.class, str1_id); + StrTestPrivSeqEntity str2 = getEntityManager().find(StrTestPrivSeqEntity.class, str2_id); - IntTestEntity int1 = getEntityManager().find(IntTestEntity.class, int1_id); - IntTestEntity int2 = getEntityManager().find(IntTestEntity.class, int2_id); + IntTestPrivSeqEntity int1 = getEntityManager().find(IntTestPrivSeqEntity.class, int1_id); + IntTestPrivSeqEntity int2 = getEntityManager().find(IntTestPrivSeqEntity.class, int2_id); TernaryMapEntity rev1 = getAuditReader().find(TernaryMapEntity.class, map1_id, 1); TernaryMapEntity rev2 = getAuditReader().find(TernaryMapEntity.class, map1_id, 2); @@ -183,11 +183,11 @@ public class TernaryMap extends AbstractEntityTest { @Test public void testHistoryOfMap2() { - StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id); - StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id); + StrTestPrivSeqEntity str1 = getEntityManager().find(StrTestPrivSeqEntity.class, str1_id); + StrTestPrivSeqEntity str2 = getEntityManager().find(StrTestPrivSeqEntity.class, str2_id); - IntTestEntity int1 = getEntityManager().find(IntTestEntity.class, int1_id); - IntTestEntity int2 = getEntityManager().find(IntTestEntity.class, int2_id); + IntTestPrivSeqEntity int1 = getEntityManager().find(IntTestPrivSeqEntity.class, int1_id); + IntTestPrivSeqEntity int2 = getEntityManager().find(IntTestPrivSeqEntity.class, int2_id); TernaryMapEntity rev1 = getAuditReader().find(TernaryMapEntity.class, map2_id, 1); TernaryMapEntity rev2 = getAuditReader().find(TernaryMapEntity.class, map2_id, 2); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapEntity.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapEntity.java index 2117d2d447..24a7789b5d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapEntity.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapEntity.java @@ -30,8 +30,8 @@ import javax.persistence.Id; import javax.persistence.ManyToMany; import org.hibernate.envers.Audited; -import org.hibernate.envers.test.entities.IntTestEntity; -import org.hibernate.envers.test.entities.StrTestEntity; +import org.hibernate.envers.test.entities.IntTestPrivSeqEntity; +import org.hibernate.envers.test.entities.StrTestPrivSeqEntity; /** * @author Adam Warski (adam at warski dot org) @@ -45,10 +45,10 @@ public class TernaryMapEntity { @Audited @ManyToMany @javax.persistence.MapKeyJoinColumn - private Map map; + private Map map; public TernaryMapEntity() { - map = new HashMap(); + map = new HashMap(); } public Integer getId() { @@ -59,11 +59,11 @@ public class TernaryMapEntity { this.id = id; } - public Map getMap() { + public Map getMap() { return map; } - public void setMap(Map map) { + public void setMap(Map map) { this.map = map; } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapFlush.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapFlush.java index d2f7983e50..26c5cc5908 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapFlush.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapFlush.java @@ -30,10 +30,10 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; -import org.hibernate.envers.test.entities.IntTestEntity; -import org.hibernate.envers.test.entities.StrTestEntity; +import org.hibernate.envers.test.entities.IntTestPrivSeqEntity; +import org.hibernate.envers.test.entities.StrTestPrivSeqEntity; import org.hibernate.envers.test.tools.TestTools; import static org.junit.Assert.assertEquals; @@ -41,7 +41,7 @@ import static org.junit.Assert.assertEquals; /** * @author Adam Warski (adam at warski dot org) */ -public class TernaryMapFlush extends AbstractEntityTest { +public class TernaryMapFlush extends BaseEnversJPAFunctionalTestCase { private Integer str1_id; private Integer str2_id; private Integer int1_id; @@ -50,8 +50,8 @@ public class TernaryMapFlush extends AbstractEntityTest { public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(TernaryMapEntity.class); - cfg.addAnnotatedClass(StrTestEntity.class); - cfg.addAnnotatedClass(IntTestEntity.class); + cfg.addAnnotatedClass(StrTestPrivSeqEntity.class); + cfg.addAnnotatedClass(IntTestPrivSeqEntity.class); } @Test @@ -59,10 +59,10 @@ public class TernaryMapFlush extends AbstractEntityTest { public void createData() { EntityManager em = getEntityManager(); - StrTestEntity str1 = new StrTestEntity("a"); - StrTestEntity str2 = new StrTestEntity("b"); - IntTestEntity int1 = new IntTestEntity(1); - IntTestEntity int2 = new IntTestEntity(2); + StrTestPrivSeqEntity str1 = new StrTestPrivSeqEntity("a"); + StrTestPrivSeqEntity str2 = new StrTestPrivSeqEntity("b"); + IntTestPrivSeqEntity int1 = new IntTestPrivSeqEntity(1); + IntTestPrivSeqEntity int2 = new IntTestPrivSeqEntity(2); TernaryMapEntity map1 = new TernaryMapEntity(); // Revision 1 (int1 -> str1) @@ -84,10 +84,10 @@ public class TernaryMapFlush extends AbstractEntityTest { em.getTransaction().begin(); map1 = em.find(TernaryMapEntity.class, map1.getId()); - str1 = em.find(StrTestEntity.class, str1.getId()); - int1 = em.find(IntTestEntity.class, int1.getId()); + str1 = em.find(StrTestPrivSeqEntity.class, str1.getId()); + int1 = em.find(IntTestPrivSeqEntity.class, int1.getId()); - map1.setMap(new HashMap()); + map1.setMap(new HashMap()); em.flush(); @@ -101,8 +101,8 @@ public class TernaryMapFlush extends AbstractEntityTest { em.getTransaction().begin(); map1 = em.find(TernaryMapEntity.class, map1.getId()); - str1 = em.find(StrTestEntity.class, str1.getId()); - int1 = em.find(IntTestEntity.class, int1.getId()); + str1 = em.find(StrTestPrivSeqEntity.class, str1.getId()); + int1 = em.find(IntTestPrivSeqEntity.class, int1.getId()); map1.getMap().remove(int1); @@ -124,18 +124,18 @@ public class TernaryMapFlush extends AbstractEntityTest { @Test public void testRevisionsCounts() { assertEquals(Arrays.asList(1, 2, 3), getAuditReader().getRevisions(TernaryMapEntity.class, map1_id)); - assertEquals(Arrays.asList(1), getAuditReader().getRevisions(StrTestEntity.class, str1_id)); - assertEquals(Arrays.asList(1), getAuditReader().getRevisions(StrTestEntity.class, str2_id)); - assertEquals(Arrays.asList(1) ,getAuditReader().getRevisions(IntTestEntity.class, int1_id)); - assertEquals(Arrays.asList(1) ,getAuditReader().getRevisions(IntTestEntity.class, int2_id)); + assertEquals(Arrays.asList(1), getAuditReader().getRevisions(StrTestPrivSeqEntity.class, str1_id)); + assertEquals(Arrays.asList(1), getAuditReader().getRevisions(StrTestPrivSeqEntity.class, str2_id)); + assertEquals(Arrays.asList(1) ,getAuditReader().getRevisions(IntTestPrivSeqEntity.class, int1_id)); + assertEquals(Arrays.asList(1) ,getAuditReader().getRevisions(IntTestPrivSeqEntity.class, int2_id)); } @Test public void testHistoryOfMap1() { - StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id); - StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id); - IntTestEntity int1 = getEntityManager().find(IntTestEntity.class, int1_id); - IntTestEntity int2 = getEntityManager().find(IntTestEntity.class, int2_id); + StrTestPrivSeqEntity str1 = getEntityManager().find(StrTestPrivSeqEntity.class, str1_id); + StrTestPrivSeqEntity str2 = getEntityManager().find(StrTestPrivSeqEntity.class, str2_id); + IntTestPrivSeqEntity int1 = getEntityManager().find(IntTestPrivSeqEntity.class, int1_id); + IntTestPrivSeqEntity int2 = getEntityManager().find(IntTestPrivSeqEntity.class, int2_id); TernaryMapEntity rev1 = getAuditReader().find(TernaryMapEntity.class, map1_id, 1); TernaryMapEntity rev2 = getAuditReader().find(TernaryMapEntity.class, map1_id, 2); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniList.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniList.java index 13aadfbcc2..cc258b8928 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniList.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniList.java @@ -31,7 +31,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.manytomany.unidirectional.ListUniEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicUniList extends AbstractEntityTest { +public class BasicUniList extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniMap.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniMap.java index 46810f3a8f..ce589585c8 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniMap.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniMap.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.manytomany.unidirectional.MapUniEntity; @@ -39,7 +39,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicUniMap extends AbstractEntityTest { +public class BasicUniMap extends BaseEnversJPAFunctionalTestCase { private Integer str1_id; private Integer str2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniSet.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniSet.java index af35b63d28..3520aac978 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniSet.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniSet.java @@ -31,7 +31,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.manytomany.unidirectional.SetUniEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicUniSet extends AbstractEntityTest { +public class BasicUniSet extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/M2MIndexedListNotAuditedTarget.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/M2MIndexedListNotAuditedTarget.java index 8268f4cff5..265d072285 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/M2MIndexedListNotAuditedTarget.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/M2MIndexedListNotAuditedTarget.java @@ -7,7 +7,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.UnversionedStrTestEntity; import org.hibernate.envers.test.entities.manytomany.unidirectional.M2MIndexedListTargetNotAuditedEntity; @@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue; * @author Vladimir Klyushnikov * @author Adam Warski */ -public class M2MIndexedListNotAuditedTarget extends AbstractEntityTest { +public class M2MIndexedListNotAuditedTarget extends BaseEnversJPAFunctionalTestCase { private Integer itnae1_id; private Integer itnae2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/M2MRelationNotAuditedTarget.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/M2MRelationNotAuditedTarget.java index deaeb3e97a..4dadddd0ae 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/M2MRelationNotAuditedTarget.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytomany/unidirectional/M2MRelationNotAuditedTarget.java @@ -31,7 +31,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.UnversionedStrTestEntity; import org.hibernate.envers.test.entities.manytomany.unidirectional.M2MTargetNotAuditedEntity; @@ -43,7 +43,7 @@ import static org.junit.Assert.assertTrue; * A test for auditing a many-to-many relation where the target entity is not audited. * @author Adam Warski */ -public class M2MRelationNotAuditedTarget extends AbstractEntityTest { +public class M2MRelationNotAuditedTarget extends BaseEnversJPAFunctionalTestCase { private Integer tnae1_id; private Integer tnae2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytoone/bidirectional/ImplicitMappedByTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytoone/bidirectional/ImplicitMappedByTest.java index e8d33f32ef..7634b192d4 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytoone/bidirectional/ImplicitMappedByTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytoone/bidirectional/ImplicitMappedByTest.java @@ -9,7 +9,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; import org.hibernate.testing.TestForIssue; @@ -18,7 +18,7 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-4962") -public class ImplicitMappedByTest extends AbstractEntityTest { +public class ImplicitMappedByTest extends BaseEnversJPAFunctionalTestCase { private Long ownedId = null; private Long owning1Id = null; private Long owning2Id = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytoone/unidirectional/RelationNotAuditedTarget.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytoone/unidirectional/RelationNotAuditedTarget.java index 54dca7f85e..6a124d828d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytoone/unidirectional/RelationNotAuditedTarget.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/manytoone/unidirectional/RelationNotAuditedTarget.java @@ -31,7 +31,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.UnversionedStrTestEntity; import org.hibernate.envers.test.entities.manytoone.unidirectional.TargetNotAuditedEntity; @@ -41,7 +41,7 @@ import org.hibernate.proxy.HibernateProxyHelper; /** * @author Tomasz Bech */ -public class RelationNotAuditedTarget extends AbstractEntityTest { +public class RelationNotAuditedTarget extends BaseEnversJPAFunctionalTestCase { private Integer tnae1_id; private Integer tnae2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/merge/AddDelTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/merge/AddDelTest.java index 9625bdfb8a..57f464138e 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/merge/AddDelTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/merge/AddDelTest.java @@ -2,10 +2,11 @@ package org.hibernate.envers.test.integration.merge; import java.util.Arrays; +import org.hibernate.Session; import org.junit.Assert; import org.junit.Test; -import org.hibernate.envers.test.AbstractSessionTest; +import org.hibernate.envers.test.BaseEnversFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.testing.TestForIssue; @@ -14,48 +15,54 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-6753") -public class AddDelTest extends AbstractSessionTest { +public class AddDelTest extends BaseEnversFunctionalTestCase { @Override - protected void initMappings() { - config.addAnnotatedClass(StrTestEntity.class); - config.addAnnotatedClass(GivenIdStrEntity.class); + protected Class[] getAnnotatedClasses() { + return new Class[]{StrTestEntity.class, GivenIdStrEntity.class}; } @Test @Priority(10) public void initData() { // Revision 1 - getSession().getTransaction().begin(); + Session session = openSession(); + session.getTransaction().begin(); GivenIdStrEntity entity = new GivenIdStrEntity(1, "data"); - getSession().persist(entity); - getSession().getTransaction().commit(); + session.persist(entity); + session.getTransaction().commit(); // Revision 2 - getSession().getTransaction().begin(); - getSession().persist(new StrTestEntity("another data")); // Just to create second revision. - entity = (GivenIdStrEntity) getSession().get(GivenIdStrEntity.class, 1); - getSession().delete(entity); // First try to remove the entity. - getSession().save(entity); // Then save it. - getSession().getTransaction().commit(); + session.getTransaction().begin(); + session.persist(new StrTestEntity("another data")); // Just to create second revision. + entity = (GivenIdStrEntity) session.get(GivenIdStrEntity.class, 1); + session.delete(entity); // First try to remove the entity. + session.save(entity); // Then save it. + session.getTransaction().commit(); // Revision 3 - getSession().getTransaction().begin(); - entity = (GivenIdStrEntity) getSession().get(GivenIdStrEntity.class, 1); - getSession().delete(entity); // First try to remove the entity. + session.getTransaction().begin(); + entity = (GivenIdStrEntity) session.get(GivenIdStrEntity.class, 1); + session.delete(entity); // First try to remove the entity. entity.setData("modified data"); // Then change it's state. - getSession().save(entity); // Finally save it. - getSession().getTransaction().commit(); + session.save(entity); // Finally save it. + session.getTransaction().commit(); + + session.close(); } @Test public void testRevisionsCountOfGivenIdStrEntity() { // Revision 2 has not changed entity's state. Assert.assertEquals(Arrays.asList(1, 3), getAuditReader().getRevisions(GivenIdStrEntity.class, 1)); + + getSession().close(); } @Test public void testHistoryOfGivenIdStrEntity() { Assert.assertEquals(new GivenIdStrEntity(1, "data"), getAuditReader().find(GivenIdStrEntity.class, 1, 1)); Assert.assertEquals(new GivenIdStrEntity(1, "modified data"), getAuditReader().find(GivenIdStrEntity.class, 1, 3)); + + getSession().close(); } } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/AbstractModifiedFlagsEntityTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/AbstractModifiedFlagsEntityTest.java index 3001fcbbab..801c06d9b4 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/AbstractModifiedFlagsEntityTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/AbstractModifiedFlagsEntityTest.java @@ -24,26 +24,24 @@ package org.hibernate.envers.test.integration.modifiedflags; import java.util.List; -import java.util.Properties; +import java.util.Map; import org.hibernate.envers.configuration.GlobalConfiguration; import org.hibernate.envers.query.AuditEntity; import org.hibernate.envers.query.AuditQuery; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; /** * Base test for modified flags feature * * @author Michal Skowronek (mskowr at o2 dot pl) */ -public abstract class AbstractModifiedFlagsEntityTest extends AbstractEntityTest { - +public abstract class AbstractModifiedFlagsEntityTest extends BaseEnversJPAFunctionalTestCase { @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties(configuration); + protected void addConfigOptions(Map options) { + super.addConfigOptions(options); if (forceModifiedFlags()) { - configuration.setProperty( - GlobalConfiguration.GLOBAL_WITH_MODIFIED_FLAG_PROPERTY, "true"); + options.put(GlobalConfiguration.GLOBAL_WITH_MODIFIED_FLAG_PROPERTY, "true"); } } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/ModifiedFlagSuffix.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/ModifiedFlagSuffix.java index 6f3a1ab325..993771ae11 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/ModifiedFlagSuffix.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/modifiedflags/ModifiedFlagSuffix.java @@ -24,6 +24,7 @@ package org.hibernate.envers.test.integration.modifiedflags; import java.util.List; +import java.util.Map; import java.util.Properties; import javax.persistence.EntityManager; @@ -52,11 +53,9 @@ public class ModifiedFlagSuffix extends AbstractModifiedFlagsEntityTest { } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties(configuration); - configuration - .setProperty(GlobalConfiguration.MODIFIED_FLAG_SUFFIX_PROPERTY, - "_CHANGED"); + protected void addConfigOptions(Map options) { + super.addConfigOptions(options); + options.put(GlobalConfiguration.MODIFIED_FLAG_SUFFIX_PROPERTY, "_CHANGED"); } private Integer addNewEntity(String str, long lng) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/multiplerelations/MultipleAssociationsTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/multiplerelations/MultipleAssociationsTest.java index 009c0b84b0..5ea6446405 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/multiplerelations/MultipleAssociationsTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/multiplerelations/MultipleAssociationsTest.java @@ -7,7 +7,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; import org.hibernate.testing.TestForIssue; @@ -16,7 +16,7 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-7073") -public class MultipleAssociationsTest extends AbstractEntityTest { +public class MultipleAssociationsTest extends BaseEnversJPAFunctionalTestCase { private long lukaszId = 0; private long kingaId = 0; private long warsawId = 0; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/BasicNaming.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/BasicNaming.java index c1ee022806..c761fe0830 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/BasicNaming.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/BasicNaming.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicNaming extends AbstractEntityTest { +public class BasicNaming extends BaseEnversJPAFunctionalTestCase { private Integer id1; private Integer id2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/EstonianTableAlias.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/EstonianTableAlias.java index f99273b464..069a42917d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/EstonianTableAlias.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/EstonianTableAlias.java @@ -8,7 +8,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; import org.hibernate.testing.TestForIssue; @@ -17,7 +17,7 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-6738") -public class EstonianTableAlias extends AbstractEntityTest { +public class EstonianTableAlias extends BaseEnversJPAFunctionalTestCase { private Long parentId = null; private Long childId = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/JoinNaming.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/JoinNaming.java index 88df5adf3e..19bce7961a 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/JoinNaming.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/JoinNaming.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Column; @@ -41,7 +41,7 @@ import static junit.framework.Assert.assertTrue; /** * @author Adam Warski (adam at warski dot org) */ -public class JoinNaming extends AbstractEntityTest { +public class JoinNaming extends BaseEnversJPAFunctionalTestCase { private Integer ed_id1; private Integer ed_id2; private Integer ing_id1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/OneToManyUnidirectionalNaming.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/OneToManyUnidirectionalNaming.java index ce2697535b..7678ef61a6 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/OneToManyUnidirectionalNaming.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/OneToManyUnidirectionalNaming.java @@ -31,7 +31,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.tools.TestTools; @@ -40,7 +40,7 @@ import org.hibernate.mapping.Column; /** * @author Adam Warski (adam at warski dot org) */ -public class OneToManyUnidirectionalNaming extends AbstractEntityTest { +public class OneToManyUnidirectionalNaming extends BaseEnversJPAFunctionalTestCase { private Integer uni1_id; private Integer str1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableNaming.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableNaming.java index 3b5201af7b..1009e25e8b 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableNaming.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableNaming.java @@ -31,7 +31,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.tools.TestTools; @@ -40,7 +40,7 @@ import org.hibernate.mapping.Column; /** * @author Adam Warski (adam at warski dot org) */ -public class VersionsJoinTableNaming extends AbstractEntityTest { +public class VersionsJoinTableNaming extends BaseEnversJPAFunctionalTestCase { private Integer uni1_id; private Integer str1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableRangeComponentNamingTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableRangeComponentNamingTest.java index b79ba2dd69..7673ec6a60 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableRangeComponentNamingTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableRangeComponentNamingTest.java @@ -31,7 +31,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.components.Component1; import org.hibernate.mapping.Column; @@ -44,7 +44,7 @@ import org.hibernate.mapping.PersistentClass; * @author Erik-Berndt Scheper */ public class VersionsJoinTableRangeComponentNamingTest extends - AbstractEntityTest { + BaseEnversJPAFunctionalTestCase { private Integer vjrcte_id; private Integer vjtrte_id; private Integer vjtrtae_id1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/ids/JoinEmbIdNaming.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/ids/JoinEmbIdNaming.java index 4a3daf891c..7e67745bf6 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/ids/JoinEmbIdNaming.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/ids/JoinEmbIdNaming.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Column; @@ -41,7 +41,7 @@ import static junit.framework.Assert.assertTrue; /** * @author Adam Warski (adam at warski dot org) */ -public class JoinEmbIdNaming extends AbstractEntityTest { +public class JoinEmbIdNaming extends BaseEnversJPAFunctionalTestCase { private EmbIdNaming ed_id1; private EmbIdNaming ed_id2; private EmbIdNaming ing_id1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/ids/JoinMulIdNaming.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/ids/JoinMulIdNaming.java index 89ed047f35..c3d049b374 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/ids/JoinMulIdNaming.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/ids/JoinMulIdNaming.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Column; @@ -41,7 +41,7 @@ import static junit.framework.Assert.assertTrue; /** * @author Adam Warski (adam at warski dot org) */ -public class JoinMulIdNaming extends AbstractEntityTest { +public class JoinMulIdNaming extends BaseEnversJPAFunctionalTestCase { private MulIdNaming ed_id1; private MulIdNaming ed_id2; private MulIdNaming ing_id1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/quotation/QuotedFieldsTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/quotation/QuotedFieldsTest.java index 02e68130c8..3b4dc84057 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/quotation/QuotedFieldsTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/naming/quotation/QuotedFieldsTest.java @@ -7,7 +7,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Column; import org.hibernate.mapping.Table; @@ -15,7 +15,7 @@ import org.hibernate.mapping.Table; /** * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class QuotedFieldsTest extends AbstractEntityTest { +public class QuotedFieldsTest extends BaseEnversJPAFunctionalTestCase { private Long qfeId1 = null; private Long qfeId2 = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/notinsertable/NotInsertable.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/notinsertable/NotInsertable.java index 0dfcea7ce6..8d9522d42a 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/notinsertable/NotInsertable.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/notinsertable/NotInsertable.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class NotInsertable extends AbstractEntityTest { +public class NotInsertable extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/notinsertable/manytoone/ManyToOneNotInsertable.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/notinsertable/manytoone/ManyToOneNotInsertable.java index 7bb3d1d79b..4c532dc94c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/notinsertable/manytoone/ManyToOneNotInsertable.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/notinsertable/manytoone/ManyToOneNotInsertable.java @@ -6,10 +6,10 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; -public class ManyToOneNotInsertable extends AbstractEntityTest { +public class ManyToOneNotInsertable extends BaseEnversJPAFunctionalTestCase { private Integer mto_id1; private Integer type_id1; private Integer type_id2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicCollection.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicCollection.java index f1439a2219..66041fa127 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicCollection.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicCollection.java @@ -32,7 +32,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.CollectionRefEdEntity; import org.hibernate.envers.test.entities.onetomany.CollectionRefIngEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.entities.onetomany.CollectionRefIngEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicCollection extends AbstractEntityTest { +public class BasicCollection extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicList.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicList.java index 09db56b4e7..915e1e644c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicList.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicList.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.ListRefEdEntity; import org.hibernate.envers.test.entities.onetomany.ListRefIngEntity; @@ -38,7 +38,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicList extends AbstractEntityTest { +public class BasicList extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSet.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSet.java index 9e696137a6..e9f572791c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSet.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSet.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.SetRefEdEntity; import org.hibernate.envers.test.entities.onetomany.SetRefIngEntity; @@ -39,7 +39,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicSet extends AbstractEntityTest { +public class BasicSet extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithEmbId.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithEmbId.java index b535113aca..7023d886f9 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithEmbId.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithEmbId.java @@ -32,7 +32,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.EmbId; import org.hibernate.envers.test.entities.onetomany.ids.SetRefEdEmbIdEntity; @@ -41,7 +41,7 @@ import org.hibernate.envers.test.entities.onetomany.ids.SetRefIngEmbIdEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicSetWithEmbId extends AbstractEntityTest { +public class BasicSetWithEmbId extends BaseEnversJPAFunctionalTestCase { private EmbId ed1_id; private EmbId ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithMulId.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithMulId.java index 96d21e94f7..87a1253a49 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithMulId.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithMulId.java @@ -32,7 +32,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.MulId; import org.hibernate.envers.test.entities.onetomany.ids.SetRefEdMulIdEntity; @@ -41,7 +41,7 @@ import org.hibernate.envers.test.entities.onetomany.ids.SetRefIngMulIdEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicSetWithMulId extends AbstractEntityTest { +public class BasicSetWithMulId extends BaseEnversJPAFunctionalTestCase { private MulId ed1_id; private MulId ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithNullsDelete.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithNullsDelete.java index c58ebb924b..d5ef96befb 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithNullsDelete.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithNullsDelete.java @@ -32,7 +32,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.SetRefEdEntity; import org.hibernate.envers.test.entities.onetomany.SetRefIngEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.entities.onetomany.SetRefIngEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicSetWithNullsDelete extends AbstractEntityTest { +public class BasicSetWithNullsDelete extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BidirectionalMapKey.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BidirectionalMapKey.java index 603d51898c..f4016ab90d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BidirectionalMapKey.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/BidirectionalMapKey.java @@ -29,14 +29,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BidirectionalMapKey extends AbstractEntityTest { +public class BidirectionalMapKey extends BaseEnversJPAFunctionalTestCase { private Integer ed_id; private Integer ing1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/InverseSideChanges.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/InverseSideChanges.java index e6a0b4cb25..76841520c3 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/InverseSideChanges.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/InverseSideChanges.java @@ -32,7 +32,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.SetRefEdEntity; import org.hibernate.envers.test.entities.onetomany.SetRefIngEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.entities.onetomany.SetRefIngEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class InverseSideChanges extends AbstractEntityTest { +public class InverseSideChanges extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ing1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedList.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedList.java index 37fbeac342..ae4f0d1a50 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedList.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedList.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.onetomany.detached.ListRefCollEntity; @@ -39,7 +39,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicDetachedList extends AbstractEntityTest { +public class BasicDetachedList extends BaseEnversJPAFunctionalTestCase { private Integer str1_id; private Integer str2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSet.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSet.java index 22ba55ebfa..bcd51c04f3 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSet.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSet.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.onetomany.detached.SetRefCollEntity; @@ -39,7 +39,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicDetachedSet extends AbstractEntityTest { +public class BasicDetachedSet extends BaseEnversJPAFunctionalTestCase { private Integer str1_id; private Integer str2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java index 264d1c015d..96ae7bed2d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.EmbId; import org.hibernate.envers.test.entities.ids.EmbIdTestEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicDetachedSetWithEmbId extends AbstractEntityTest { +public class BasicDetachedSetWithEmbId extends BaseEnversJPAFunctionalTestCase { private EmbId str1_id; private EmbId str2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java index 00dbf25262..61da20f78f 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.MulId; import org.hibernate.envers.test.entities.ids.MulIdTestEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicDetachedSetWithMulId extends AbstractEntityTest { +public class BasicDetachedSetWithMulId extends BaseEnversJPAFunctionalTestCase { private MulId str1_id; private MulId str2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java index 96629c45fe..9d6e8d3151 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.onetomany.detached.SetJoinColumnRefCollEntity; @@ -39,7 +39,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicJoinColumnSet extends AbstractEntityTest { +public class BasicJoinColumnSet extends BaseEnversJPAFunctionalTestCase { private Integer str1_id; private Integer str2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java index 301d49c1d2..34abc270a0 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java @@ -29,8 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; -import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase ; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.onetomany.detached.SetRefCollEntity; @@ -39,14 +38,14 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class DataChangesDetachedSet extends AbstractEntityTest { +public class DataChangesDetachedSet extends BaseEnversJPAFunctionalTestCase { private Integer str1_id; private Integer coll1_id; - public void configure(Ejb3Configuration cfg) { - cfg.addAnnotatedClass(StrTestEntity.class); - cfg.addAnnotatedClass(SetRefCollEntity.class); + @Override + protected Class[] getAnnotatedClasses() { + return new Class[]{StrTestEntity.class, SetRefCollEntity.class}; } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleDetachedSet.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleDetachedSet.java index d48fde4af1..159f64e01f 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleDetachedSet.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleDetachedSet.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.onetomany.detached.DoubleSetRefCollEntity; @@ -39,7 +39,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class DoubleDetachedSet extends AbstractEntityTest { +public class DoubleDetachedSet extends BaseEnversJPAFunctionalTestCase { private Integer str1_id; private Integer str2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleJoinColumnBidirectionalList.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleJoinColumnBidirectionalList.java index f2844f36c6..bf59841f9d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleJoinColumnBidirectionalList.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleJoinColumnBidirectionalList.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.detached.DoubleListJoinColumnBidirectionalRefEdEntity1; import org.hibernate.envers.test.entities.onetomany.detached.DoubleListJoinColumnBidirectionalRefEdEntity2; @@ -44,7 +44,7 @@ import static org.junit.Assert.assertTrue; * (and thus owns the relation), and the other uses a @ManyToOne(insertable=false, updatable=false). * @author Adam Warski (adam at warski dot org) */ -public class DoubleJoinColumnBidirectionalList extends AbstractEntityTest { +public class DoubleJoinColumnBidirectionalList extends BaseEnversJPAFunctionalTestCase { private Integer ed1_1_id; private Integer ed2_1_id; private Integer ed1_2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/IndexedJoinColumnBidirectionalList.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/IndexedJoinColumnBidirectionalList.java index 769dc429a8..b999396438 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/IndexedJoinColumnBidirectionalList.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/IndexedJoinColumnBidirectionalList.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.detached.IndexedListJoinColumnBidirectionalRefEdEntity; import org.hibernate.envers.test.entities.onetomany.detached.IndexedListJoinColumnBidirectionalRefIngEntity; @@ -42,7 +42,7 @@ import static org.junit.Assert.assertTrue; * and the other uses a @ManyToOne(insertable=false, updatable=false). * @author Adam Warski (adam at warski dot org) */ -public class IndexedJoinColumnBidirectionalList extends AbstractEntityTest { +public class IndexedJoinColumnBidirectionalList extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; private Integer ed3_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/InheritanceIndexedJoinColumnBidirectionalList.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/InheritanceIndexedJoinColumnBidirectionalList.java index 254c08b71a..4d410ab97c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/InheritanceIndexedJoinColumnBidirectionalList.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/InheritanceIndexedJoinColumnBidirectionalList.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.detached.inheritance.ChildIndexedListJoinColumnBidirectionalRefIngEntity; import org.hibernate.envers.test.entities.onetomany.detached.inheritance.ParentIndexedListJoinColumnBidirectionalRefIngEntity; @@ -43,7 +43,7 @@ import static org.junit.Assert.assertTrue; * in the parent entity, and the other uses a @ManyToOne(insertable=false, updatable=false). * @author Adam Warski (adam at warski dot org) */ -public class InheritanceIndexedJoinColumnBidirectionalList extends AbstractEntityTest { +public class InheritanceIndexedJoinColumnBidirectionalList extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; private Integer ed3_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/JoinColumnBidirectionalList.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/JoinColumnBidirectionalList.java index 9542beb3a9..034ea82acc 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/JoinColumnBidirectionalList.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/JoinColumnBidirectionalList.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.detached.ListJoinColumnBidirectionalRefEdEntity; import org.hibernate.envers.test.entities.onetomany.detached.ListJoinColumnBidirectionalRefIngEntity; @@ -43,7 +43,7 @@ import static org.junit.Assert.assertTrue; * and the other uses a @ManyToOne(insertable=false, updatable=false). * @author Adam Warski (adam at warski dot org) */ -public class JoinColumnBidirectionalList extends AbstractEntityTest { +public class JoinColumnBidirectionalList extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/JoinColumnBidirectionalListWithInheritance.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/JoinColumnBidirectionalListWithInheritance.java index c86d2df487..c4d731a2b0 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/JoinColumnBidirectionalListWithInheritance.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/detached/JoinColumnBidirectionalListWithInheritance.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.detached.ListJoinColumnBidirectionalInheritanceRefEdChildEntity; import org.hibernate.envers.test.entities.onetomany.detached.ListJoinColumnBidirectionalInheritanceRefEdParentEntity; @@ -44,7 +44,7 @@ import static org.junit.Assert.assertTrue; * and the other uses a @ManyToOne(insertable=false, updatable=false). * @author Adam Warski (adam at warski dot org) */ -public class JoinColumnBidirectionalListWithInheritance extends AbstractEntityTest { +public class JoinColumnBidirectionalListWithInheritance extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/hierarchy/HierarchyTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/hierarchy/HierarchyTest.java index 80e3b8c098..f7b38087f2 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/hierarchy/HierarchyTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/hierarchy/HierarchyTest.java @@ -7,7 +7,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; import org.hibernate.testing.TestForIssue; @@ -16,7 +16,7 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-6661") -public class HierarchyTest extends AbstractEntityTest { +public class HierarchyTest extends BaseEnversJPAFunctionalTestCase { private Long parentId = null; private Long child1Id = null; private Long child2Id = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/inverseToSuperclass/OneToManyInverseToSuperclassTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/inverseToSuperclass/OneToManyInverseToSuperclassTest.java index c8273040cb..2c3cf8d1cd 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/inverseToSuperclass/OneToManyInverseToSuperclassTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetomany/inverseToSuperclass/OneToManyInverseToSuperclassTest.java @@ -9,7 +9,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** @@ -17,7 +17,7 @@ import org.hibernate.envers.test.Priority; * */ -public class OneToManyInverseToSuperclassTest extends AbstractEntityTest { +public class OneToManyInverseToSuperclassTest extends BaseEnversJPAFunctionalTestCase { private long m1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional.java index 2c91f0ec58..7d7b69da31 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class Bidirectional extends AbstractEntityTest { +public class Bidirectional extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional2.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional2.java index 3c73c25cca..95f96029ee 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional2.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional2.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class Bidirectional2 extends AbstractEntityTest { +public class Bidirectional2 extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java index 6ae200f6be..b82c5c4f15 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class BidirectionalNoNulls extends AbstractEntityTest { +public class BidirectionalNoNulls extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java index 076b769a7a..9e7ed21dd6 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java @@ -29,14 +29,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.EmbId; /** * @author Adam Warski (adam at warski dot org) */ -public class EmbIdBidirectional extends AbstractEntityTest { +public class EmbIdBidirectional extends BaseEnversJPAFunctionalTestCase { private EmbId ed1_id; private EmbId ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java index b0b518ccd8..a9d773b829 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java @@ -29,14 +29,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.MulId; /** * @author Adam Warski (adam at warski dot org) */ -public class MulIdBidirectional extends AbstractEntityTest { +public class MulIdBidirectional extends BaseEnversJPAFunctionalTestCase { private MulId ed1_id; private MulId ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/primarykeyjoincolumn/OneToOneWithPrimaryKeyJoinTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/primarykeyjoincolumn/OneToOneWithPrimaryKeyJoinTest.java index ffd0077395..9c409dd431 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/primarykeyjoincolumn/OneToOneWithPrimaryKeyJoinTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/bidirectional/primarykeyjoincolumn/OneToOneWithPrimaryKeyJoinTest.java @@ -9,7 +9,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.RevisionType; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.proxy.HibernateProxy; import org.hibernate.testing.TestForIssue; @@ -18,7 +18,7 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-6825") -public class OneToOneWithPrimaryKeyJoinTest extends AbstractEntityTest { +public class OneToOneWithPrimaryKeyJoinTest extends BaseEnversJPAFunctionalTestCase { private Long personId = null; private Long accountId = null; private Long proxyPersonId = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/Unidirectional.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/Unidirectional.java index 9bd2c495c5..abb09f976d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/Unidirectional.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/Unidirectional.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class Unidirectional extends AbstractEntityTest { +public class Unidirectional extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; private Integer ed3_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalMulIdWithNulls.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalMulIdWithNulls.java index 0f445ec357..74cccc13ef 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalMulIdWithNulls.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalMulIdWithNulls.java @@ -5,7 +5,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.EmbId; import org.hibernate.envers.test.entities.ids.EmbIdTestEntity; @@ -17,7 +17,7 @@ import static org.junit.Assert.assertNull; /** * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class UnidirectionalMulIdWithNulls extends AbstractEntityTest { +public class UnidirectionalMulIdWithNulls extends BaseEnversJPAFunctionalTestCase { private EmbId ei; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java index a0a3122b30..6c02c10d90 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java @@ -29,13 +29,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class UnidirectionalWithNulls extends AbstractEntityTest { +public class UnidirectionalWithNulls extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ed2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/primitive/PrimitiveAddDelete.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/primitive/PrimitiveAddDelete.java index 9c9e519bb2..13c051cf3c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/primitive/PrimitiveAddDelete.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/primitive/PrimitiveAddDelete.java @@ -29,19 +29,19 @@ import javax.persistence.EntityManager; import org.junit.Test; -import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.PrimitiveTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class PrimitiveAddDelete extends AbstractEntityTest { +public class PrimitiveAddDelete extends BaseEnversJPAFunctionalTestCase { private Integer id1; - public void configure(Ejb3Configuration cfg) { - cfg.addAnnotatedClass(PrimitiveTestEntity.class); + @Override + protected Class[] getAnnotatedClasses() { + return new Class[]{PrimitiveTestEntity.class}; } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/properties/UnversionedOptimisticLockingField.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/properties/UnversionedOptimisticLockingField.java index 6cf599bd51..459ea3a65d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/properties/UnversionedOptimisticLockingField.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/properties/UnversionedOptimisticLockingField.java @@ -25,13 +25,13 @@ package org.hibernate.envers.test.integration.properties; import java.util.Arrays; import java.util.Iterator; -import java.util.Properties; +import java.util.Map; import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; @@ -39,7 +39,7 @@ import org.hibernate.mapping.Property; /** * @author Nicolas Doroskevich */ -public class UnversionedOptimisticLockingField extends AbstractEntityTest { +public class UnversionedOptimisticLockingField extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { @@ -48,9 +48,9 @@ public class UnversionedOptimisticLockingField extends AbstractEntityTest { } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties( configuration ); - configuration.setProperty("org.hibernate.envers.doNotAuditOptimisticLockingField", "true"); + public void addConfigOptions(Map configuration) { + super.addConfigOptions( configuration ); + configuration.put("org.hibernate.envers.doNotAuditOptimisticLockingField", "true"); } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/properties/VersionsProperties.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/properties/VersionsProperties.java index fcb6214c3d..d536eba262 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/properties/VersionsProperties.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/properties/VersionsProperties.java @@ -24,19 +24,20 @@ package org.hibernate.envers.test.integration.properties; import java.util.Arrays; +import java.util.Map; import java.util.Properties; import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** * @author Adam Warski (adam at warski dot org) */ -public class VersionsProperties extends AbstractEntityTest { +public class VersionsProperties extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { @@ -46,12 +47,12 @@ public class VersionsProperties extends AbstractEntityTest { } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties( configuration ); - configuration.setProperty("org.hibernate.envers.auditTablePrefix", "VP_"); - configuration.setProperty("org.hibernate.envers.auditTableSuffix", "_VS"); - configuration.setProperty("org.hibernate.envers.revisionFieldName", "ver_rev"); - configuration.setProperty("org.hibernate.envers.revisionTypeFieldName", "ver_rev_type"); + protected void addConfigOptions(Map options) { + super.addConfigOptions( options ); + options.put("org.hibernate.envers.auditTablePrefix", "VP_"); + options.put("org.hibernate.envers.auditTableSuffix", "_VS"); + options.put("org.hibernate.envers.revisionFieldName", "ver_rev"); + options.put("org.hibernate.envers.revisionTypeFieldName", "ver_rev_type"); } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/AuditedCollectionProxyTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/AuditedCollectionProxyTest.java index 5f36bd7ea7..1004bd63f9 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/AuditedCollectionProxyTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/AuditedCollectionProxyTest.java @@ -28,7 +28,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.ListRefEdEntity; import org.hibernate.envers.test.entities.onetomany.ListRefIngEntity; @@ -41,7 +41,7 @@ import org.hibernate.proxy.HibernateProxy; * @author Erik-Berndt Scheper * */ -public class AuditedCollectionProxyTest extends AbstractEntityTest { +public class AuditedCollectionProxyTest extends BaseEnversJPAFunctionalTestCase { Integer id_ListRefEdEntity1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/ProxyIdentifier.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/ProxyIdentifier.java index 229e7ff45b..8242209961 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/ProxyIdentifier.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/ProxyIdentifier.java @@ -28,7 +28,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.UnversionedStrTestEntity; import org.hibernate.envers.test.entities.manytoone.unidirectional.TargetNotAuditedEntity; @@ -39,7 +39,7 @@ import org.hibernate.proxy.LazyInitializer; /** * @author Eugene Goroschenya */ -public class ProxyIdentifier extends AbstractEntityTest { +public class ProxyIdentifier extends BaseEnversJPAFunctionalTestCase { private TargetNotAuditedEntity tnae1; private UnversionedStrTestEntity uste1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java index dc115781b1..49d435e382 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java @@ -8,7 +8,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.MappingException; -import org.hibernate.envers.test.AbstractSessionTest; +import org.hibernate.envers.test.BaseEnversFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.testing.TestForIssue; @@ -16,12 +16,12 @@ import org.hibernate.testing.TestForIssue; /** * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class QueryingWithProxyObjectTest extends AbstractSessionTest { +public class QueryingWithProxyObjectTest extends BaseEnversFunctionalTestCase { private Integer id = null; @Override - protected void initMappings() throws MappingException, URISyntaxException { - config.addAnnotatedClass(StrTestEntity.class); + protected Class[] getAnnotatedClasses() { + return new Class[]{ StrTestEntity.class}; } @Test @@ -33,6 +33,7 @@ public class QueryingWithProxyObjectTest extends AbstractSessionTest { getSession().persist(ste); getSession().getTransaction().commit(); id = ste.getId(); + getSession().close(); } @Test @@ -59,5 +60,7 @@ public class QueryingWithProxyObjectTest extends AbstractSessionTest { ste = (StrTestEntity) getAuditReader().createQuery().forEntitiesModifiedAtRevision(proxySte.getClass(), 1).getSingleResult(); Assert.assertEquals(originalSte, ste); + + getSession().close(); } } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/AggregateQuery.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/AggregateQuery.java index 796965427a..e16e16951a 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/AggregateQuery.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/AggregateQuery.java @@ -29,14 +29,14 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.IntTestEntity; /** * @author Adam Warski (adam at warski dot org) */ @SuppressWarnings({"unchecked"}) -public class AggregateQuery extends AbstractEntityTest { +public class AggregateQuery extends BaseEnversJPAFunctionalTestCase { public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(IntTestEntity.class); } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/DeletedEntities.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/DeletedEntities.java index e8aea2e083..df20742429 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/DeletedEntities.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/DeletedEntities.java @@ -32,14 +32,14 @@ import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.enhanced.DefaultRevisionEntity; import org.hibernate.envers.RevisionType; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class DeletedEntities extends AbstractEntityTest { +public class DeletedEntities extends BaseEnversJPAFunctionalTestCase { private Integer id2; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/MaximalizePropertyQuery.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/MaximalizePropertyQuery.java index 85b28d4291..3ab1ad1e16 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/MaximalizePropertyQuery.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/MaximalizePropertyQuery.java @@ -31,7 +31,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; @@ -39,7 +39,7 @@ import org.hibernate.envers.test.entities.StrIntTestEntity; * @author Adam Warski (adam at warski dot org) */ @SuppressWarnings({"unchecked"}) -public class MaximalizePropertyQuery extends AbstractEntityTest { +public class MaximalizePropertyQuery extends BaseEnversJPAFunctionalTestCase { Integer id1; Integer id2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/NullPropertyQuery.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/NullPropertyQuery.java index 835ee254e8..a2f83c6765 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/NullPropertyQuery.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/NullPropertyQuery.java @@ -6,7 +6,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; import org.hibernate.envers.test.entities.ids.EmbId; @@ -18,7 +18,7 @@ import org.hibernate.envers.test.entities.onetomany.ids.SetRefIngEmbIdEntity; /** * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class NullPropertyQuery extends AbstractEntityTest { +public class NullPropertyQuery extends BaseEnversJPAFunctionalTestCase { private Integer idSimplePropertyNull = null; private Integer idSimplePropertyNotNull = null; private EmbId idMulticolumnReferenceToParentNull = new EmbId(0, 1); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/OrderByLimitQuery.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/OrderByLimitQuery.java index c7d495bd9f..cdccbb6548 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/OrderByLimitQuery.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/OrderByLimitQuery.java @@ -31,7 +31,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.IntTestEntity; @@ -39,7 +39,7 @@ import org.hibernate.envers.test.entities.IntTestEntity; * @author Adam Warski (adam at warski dot org) */ @SuppressWarnings({"unchecked"}) -public class OrderByLimitQuery extends AbstractEntityTest { +public class OrderByLimitQuery extends BaseEnversJPAFunctionalTestCase { private Integer id1; private Integer id2; private Integer id3; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/RevisionConstraintQuery.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/RevisionConstraintQuery.java index de06a0a465..81e765c1e7 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/RevisionConstraintQuery.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/RevisionConstraintQuery.java @@ -35,7 +35,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.RevisionType; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; @@ -43,7 +43,7 @@ import org.hibernate.envers.test.entities.StrIntTestEntity; * @author Adam Warski (adam at warski dot org) */ @SuppressWarnings({"unchecked"}) -public class RevisionConstraintQuery extends AbstractEntityTest { +public class RevisionConstraintQuery extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/SimpleQuery.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/SimpleQuery.java index af26698acf..d9cd57c960 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/SimpleQuery.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/SimpleQuery.java @@ -35,7 +35,7 @@ import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.enhanced.DefaultRevisionEntity; import org.hibernate.envers.RevisionType; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; import org.hibernate.envers.test.tools.TestTools; @@ -45,7 +45,7 @@ import org.hibernate.envers.test.tools.TestTools; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @SuppressWarnings({"unchecked"}) -public class SimpleQuery extends AbstractEntityTest { +public class SimpleQuery extends BaseEnversJPAFunctionalTestCase { private Integer id1; private Integer id2; private Integer id3; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/StoreDeletedData.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/StoreDeletedData.java index 58d17671f5..1196f3992f 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/StoreDeletedData.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/StoreDeletedData.java @@ -24,14 +24,14 @@ package org.hibernate.envers.test.integration.query; import java.util.List; -import java.util.Properties; +import java.util.Map; import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; @@ -40,18 +40,17 @@ import org.hibernate.envers.test.entities.StrIntTestEntity; * @author Adam Warski (adam at warski dot org) */ @SuppressWarnings({"unchecked"}) -public class StoreDeletedData extends AbstractEntityTest { +public class StoreDeletedData extends BaseEnversJPAFunctionalTestCase { private Integer id1; public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(StrIntTestEntity.class); - } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties( configuration ); - configuration.setProperty("org.hibernate.envers.storeDataAtDelete", "true"); + protected void addConfigOptions(Map options) { + super.addConfigOptions( options ); + options.put( "org.hibernate.envers.storeDataAtDelete", "true" ); } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/ids/EmbIdOneToManyQuery.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/ids/EmbIdOneToManyQuery.java index 71fae1219b..a37786d20c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/ids/EmbIdOneToManyQuery.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/ids/EmbIdOneToManyQuery.java @@ -32,7 +32,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.EmbId; import org.hibernate.envers.test.entities.onetomany.ids.SetRefEdEmbIdEntity; @@ -43,7 +43,7 @@ import org.hibernate.envers.test.tools.TestTools; * @author Adam Warski (adam at warski dot org) */ @SuppressWarnings({"unchecked"}) -public class EmbIdOneToManyQuery extends AbstractEntityTest { +public class EmbIdOneToManyQuery extends BaseEnversJPAFunctionalTestCase { private EmbId id1; private EmbId id2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/ids/MulIdOneToManyQuery.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/ids/MulIdOneToManyQuery.java index 252a655b5a..64599ba67c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/ids/MulIdOneToManyQuery.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/query/ids/MulIdOneToManyQuery.java @@ -32,7 +32,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.query.AuditEntity; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.MulId; import org.hibernate.envers.test.entities.onetomany.ids.SetRefEdMulIdEntity; @@ -45,7 +45,7 @@ import static org.junit.Assert.assertEquals; * @author Adam Warski (adam at warski dot org) */ @SuppressWarnings({"unchecked"}) -public class MulIdOneToManyQuery extends AbstractEntityTest { +public class MulIdOneToManyQuery extends BaseEnversJPAFunctionalTestCase { private MulId id1; private MulId id2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/readwriteexpression/ReadWriteExpressionChange.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/readwriteexpression/ReadWriteExpressionChange.java index 36fadd821d..9b0dc508d0 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/readwriteexpression/ReadWriteExpressionChange.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/readwriteexpression/ReadWriteExpressionChange.java @@ -9,10 +9,10 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; -public class ReadWriteExpressionChange extends AbstractEntityTest { +public class ReadWriteExpressionChange extends BaseEnversJPAFunctionalTestCase { private static final Double HEIGHT_INCHES = 73.0d; private static final Double HEIGHT_CENTIMETERS = HEIGHT_INCHES * 2.54d; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reference/BidirectionalReference.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reference/BidirectionalReference.java index 84a7ee7dac..707165eb6c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reference/BidirectionalReference.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reference/BidirectionalReference.java @@ -29,14 +29,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; /** * @author Adam Warski (adam at warski dot org) */ -public class BidirectionalReference extends AbstractEntityTest { +public class BidirectionalReference extends BaseEnversJPAFunctionalTestCase { private Long set1_id; private Long set2_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Custom.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Custom.java index 87bac40d61..692048d7bd 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Custom.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Custom.java @@ -35,7 +35,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.AuditReader; import org.hibernate.envers.exception.RevisionDoesNotExistException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.reventity.CustomRevEntity; @@ -43,7 +43,7 @@ import org.hibernate.envers.test.entities.reventity.CustomRevEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class Custom extends AbstractEntityTest { +public class Custom extends BaseEnversJPAFunctionalTestCase { private Integer id; private long timestamp1; private long timestamp2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomBoxed.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomBoxed.java index c012bd3532..f848613d74 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomBoxed.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomBoxed.java @@ -35,14 +35,14 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.AuditReader; import org.hibernate.envers.exception.RevisionDoesNotExistException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class CustomBoxed extends AbstractEntityTest { +public class CustomBoxed extends BaseEnversJPAFunctionalTestCase { private Integer id; private long timestamp1; private long timestamp2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomColumnMapping.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomColumnMapping.java index 8824a68683..f0fd0048d3 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomColumnMapping.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomColumnMapping.java @@ -32,7 +32,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.AuditReader; import org.hibernate.envers.exception.RevisionDoesNotExistException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.reventity.CustomRevEntityColumnMapping; @@ -42,7 +42,7 @@ import org.hibernate.envers.test.entities.reventity.CustomRevEntityColumnMapping * a columnDefinition specified works. * @author Adam Warski (adam at warski dot org) */ -public class CustomColumnMapping extends AbstractEntityTest { +public class CustomColumnMapping extends BaseEnversJPAFunctionalTestCase { private Integer id; private long timestamp1; private long timestamp2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomDate.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomDate.java index 58a256df41..49e5143ea2 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomDate.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomDate.java @@ -32,7 +32,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.AuditReader; import org.hibernate.envers.exception.RevisionDoesNotExistException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.reventity.CustomDateRevEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.entities.reventity.CustomDateRevEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class CustomDate extends AbstractEntityTest { +public class CustomDate extends BaseEnversJPAFunctionalTestCase { private Integer id; private long timestamp1; private long timestamp2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomNoListener.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomNoListener.java index 15b0801947..15f59ef778 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomNoListener.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomNoListener.java @@ -30,7 +30,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.AuditReader; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.reventity.CustomDataRevEntity; @@ -38,7 +38,7 @@ import org.hibernate.envers.test.entities.reventity.CustomDataRevEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class CustomNoListener extends AbstractEntityTest { +public class CustomNoListener extends BaseEnversJPAFunctionalTestCase { private Integer id; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomPropertyAccess.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomPropertyAccess.java index 95477b8be6..60081662a1 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomPropertyAccess.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/CustomPropertyAccess.java @@ -32,7 +32,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.AuditReader; import org.hibernate.envers.exception.RevisionDoesNotExistException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.reventity.CustomPropertyAccessRevEntity; @@ -40,15 +40,14 @@ import org.hibernate.envers.test.entities.reventity.CustomPropertyAccessRevEntit /** * @author Adam Warski (adam at warski dot org) */ -public class CustomPropertyAccess extends AbstractEntityTest { +public class CustomPropertyAccess extends BaseEnversJPAFunctionalTestCase { private Integer id; private long timestamp1; private long timestamp2; private long timestamp3; - public void configure(Ejb3Configuration cfg) { - cfg.addAnnotatedClass(StrTestEntity.class); - cfg.addAnnotatedClass(CustomPropertyAccessRevEntity.class); + protected Class[] getAnnotatedClasses() { + return new Class[] { StrTestEntity.class, CustomPropertyAccessRevEntity.class }; } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/DifferentDBSchemaTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/DifferentDBSchemaTest.java index 1db26e1633..8fdbcb7161 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/DifferentDBSchemaTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/DifferentDBSchemaTest.java @@ -1,7 +1,7 @@ package org.hibernate.envers.test.integration.reventity; import java.util.Arrays; -import java.util.Properties; +import java.util.Map; import javax.persistence.EntityManager; import org.junit.Test; @@ -9,7 +9,7 @@ import org.junit.Test; import org.hibernate.cfg.Environment; import org.hibernate.dialect.H2Dialect; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.mapping.Table; @@ -21,17 +21,17 @@ import org.hibernate.testing.RequiresDialect; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @RequiresDialect({H2Dialect.class}) -public class DifferentDBSchemaTest extends AbstractEntityTest { +public class DifferentDBSchemaTest extends BaseEnversJPAFunctionalTestCase { private static final String SCHEMA_NAME = "ENVERS_AUDIT"; private Integer steId = null; @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties(configuration); - + protected void addConfigOptions(Map options) { + super.addConfigOptions(options); // Creates new schema after establishing connection - configuration.setProperty(Environment.URL, configuration.getProperty(Environment.URL) + ";INIT=CREATE SCHEMA IF NOT EXISTS " + SCHEMA_NAME); - configuration.setProperty("org.hibernate.envers.default_schema", SCHEMA_NAME); + options.putAll(Environment.getProperties()); + options.put(Environment.URL, options.get(Environment.URL) + ";INIT=CREATE SCHEMA IF NOT EXISTS " + SCHEMA_NAME); + options.put("org.hibernate.envers.default_schema", SCHEMA_NAME); } @Override diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/ExceptionListener.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/ExceptionListener.java index ad04e69e87..45bfefef85 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/ExceptionListener.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/ExceptionListener.java @@ -28,13 +28,13 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.entities.StrTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class ExceptionListener extends AbstractEntityTest { +public class ExceptionListener extends BaseEnversJPAFunctionalTestCase { public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(StrTestEntity.class); cfg.addAnnotatedClass(ExceptionListenerRevEntity.class); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/GloballyConfiguredRevListenerTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/GloballyConfiguredRevListenerTest.java index f5f16d6db6..9b351b4fe9 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/GloballyConfiguredRevListenerTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/GloballyConfiguredRevListenerTest.java @@ -1,13 +1,13 @@ package org.hibernate.envers.test.integration.reventity; -import java.util.Properties; +import java.util.Map; import javax.persistence.EntityManager; import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.testing.TestForIssue; @@ -16,16 +16,15 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-6696") -public class GloballyConfiguredRevListenerTest extends AbstractEntityTest { +public class GloballyConfiguredRevListenerTest extends BaseEnversJPAFunctionalTestCase { public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(StrTestEntity.class); } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties( configuration ); - configuration.setProperty("org.hibernate.envers.revision_listener", "org.hibernate.envers.test.integration.reventity.CountingRevisionListener"); - + protected void addConfigOptions(Map options) { + super.addConfigOptions( options ); + options.put("org.hibernate.envers.revision_listener", "org.hibernate.envers.test.integration.reventity.CountingRevisionListener"); } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Inherited.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Inherited.java index 30623c9ddd..038219d650 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Inherited.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Inherited.java @@ -32,25 +32,23 @@ import javax.persistence.EntityManager; import org.junit.Test; -import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.AuditReader; import org.hibernate.envers.exception.RevisionDoesNotExistException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class Inherited extends AbstractEntityTest { +public class Inherited extends BaseEnversJPAFunctionalTestCase { private Integer id; private long timestamp1; private long timestamp2; private long timestamp3; - public void configure(Ejb3Configuration cfg) { - cfg.addAnnotatedClass(StrTestEntity.class); - cfg.addAnnotatedClass(InheritedRevEntity.class); + protected Class[] getAnnotatedClasses() { + return new Class[]{StrTestEntity.class, InheritedRevEntity.class}; } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Listener.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Listener.java index f789f8da58..31da2f7418 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Listener.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/Listener.java @@ -35,14 +35,14 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.AuditReader; import org.hibernate.envers.exception.RevisionDoesNotExistException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class Listener extends AbstractEntityTest { +public class Listener extends BaseEnversJPAFunctionalTestCase { private Integer id; private long timestamp1; private long timestamp2; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/LongRevEntityInheritanceChildAuditing.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/LongRevEntityInheritanceChildAuditing.java index e8beabe9ec..3bb09ad0d9 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/LongRevEntityInheritanceChildAuditing.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/LongRevEntityInheritanceChildAuditing.java @@ -29,7 +29,7 @@ import java.util.Iterator; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.integration.inheritance.joined.ChildEntity; import org.hibernate.envers.test.integration.inheritance.joined.ParentEntity; import org.hibernate.mapping.Column; @@ -41,7 +41,7 @@ import static org.junit.Assert.assertEquals; * as an int. * @author Adam Warski (adam at warski dot org) */ -public class LongRevEntityInheritanceChildAuditing extends AbstractEntityTest { +public class LongRevEntityInheritanceChildAuditing extends BaseEnversJPAFunctionalTestCase { public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(ChildEntity.class); cfg.addAnnotatedClass(ParentEntity.class); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/LongRevNumber.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/LongRevNumber.java index 6b8fab7450..b677e251a9 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/LongRevNumber.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/LongRevNumber.java @@ -33,14 +33,14 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.AuditReader; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class LongRevNumber extends AbstractEntityTest { +public class LongRevNumber extends BaseEnversJPAFunctionalTestCase { private Integer id; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/AnnotatedTrackingEntitiesTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/AnnotatedTrackingEntitiesTest.java index 705176ba38..a0cb38dc55 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/AnnotatedTrackingEntitiesTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/AnnotatedTrackingEntitiesTest.java @@ -1,5 +1,6 @@ package org.hibernate.envers.test.integration.reventity.trackmodifiedentities; +import java.util.Map; import java.util.Properties; import org.hibernate.ejb.Ejb3Configuration; @@ -18,8 +19,8 @@ public class AnnotatedTrackingEntitiesTest extends DefaultTrackingEntitiesTest { } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties( configuration ); - configuration.setProperty("org.hibernate.envers.track_entities_changed_in_revision", "false"); + public void addConfigOptions(Map configuration) { + super.addConfigOptions( configuration ); + configuration.put("org.hibernate.envers.track_entities_changed_in_revision", "false"); } } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/CustomTrackingEntitiesTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/CustomTrackingEntitiesTest.java index bd434370a4..d9ed2f5355 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/CustomTrackingEntitiesTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/CustomTrackingEntitiesTest.java @@ -7,7 +7,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.EntityTrackingRevisionListener; import org.hibernate.envers.exception.AuditException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; import org.hibernate.envers.test.entities.StrTestEntity; @@ -23,7 +23,7 @@ import org.hibernate.envers.test.tools.TestTools; * added, modified or removed, so that changed entity name can be persisted. * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class CustomTrackingEntitiesTest extends AbstractEntityTest { +public class CustomTrackingEntitiesTest extends BaseEnversJPAFunctionalTestCase { private Integer steId = null; private Integer siteId = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/DefaultTrackingEntitiesTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/DefaultTrackingEntitiesTest.java index a72d4d4ec4..0eb2d498b4 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/DefaultTrackingEntitiesTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/DefaultTrackingEntitiesTest.java @@ -11,7 +11,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.CrossTypeRevisionChangesReader; import org.hibernate.envers.RevisionType; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; import org.hibernate.envers.test.entities.StrTestEntity; @@ -26,7 +26,7 @@ import org.hibernate.mapping.Table; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @SuppressWarnings({"unchecked"}) -public class DefaultTrackingEntitiesTest extends AbstractEntityTest { +public class DefaultTrackingEntitiesTest extends BaseEnversJPAFunctionalTestCase { private Integer steId = null; private Integer siteId = null; @@ -37,9 +37,9 @@ public class DefaultTrackingEntitiesTest extends AbstractEntityTest { } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties( configuration ); - configuration.setProperty("org.hibernate.envers.track_entities_changed_in_revision", "true"); + public void addConfigOptions(Map configuration) { + super.addConfigOptions( configuration ); + configuration.put("org.hibernate.envers.track_entities_changed_in_revision", "true"); } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/EntityNamesTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/EntityNamesTest.java index fd69032f76..ea326bf556 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/EntityNamesTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/EntityNamesTest.java @@ -1,7 +1,7 @@ package org.hibernate.envers.test.integration.reventity.trackmodifiedentities; -import org.hibernate.MappingException; -import org.hibernate.envers.test.AbstractSessionTest; +import org.hibernate.cfg.Configuration; +import org.hibernate.envers.test.BaseEnversFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.integration.entityNames.manyToManyAudited.Car; import org.hibernate.envers.test.integration.entityNames.manyToManyAudited.Person; @@ -9,21 +9,22 @@ import org.hibernate.envers.test.tools.TestTools; import org.hibernate.envers.tools.Pair; import org.junit.Test; -import java.io.File; -import java.net.URISyntaxException; -import java.net.URL; import java.util.ArrayList; import java.util.List; /** * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class EntityNamesTest extends AbstractSessionTest { - protected void initMappings() throws MappingException, URISyntaxException { - URL url = Thread.currentThread().getContextClassLoader().getResource("mappings/entityNames/manyToManyAudited/mappings.hbm.xml"); - config.addFile(new File(url.toURI())); - config.setProperty("org.hibernate.envers.track_entities_changed_in_revision", "true"); - } +public class EntityNamesTest extends BaseEnversFunctionalTestCase { + @Override + protected String[] getMappings() { + return new String[]{"mappings/entityNames/manyToManyAudited/mappings.hbm.xml"}; + } + + @Override + protected void configure(Configuration configuration) { + configuration.setProperty("org.hibernate.envers.track_entities_changed_in_revision", "true"); + } @Test @Priority(10) diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/ExtendedRevisionEntityTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/ExtendedRevisionEntityTest.java index 69e87f5250..8e18f75fd9 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/ExtendedRevisionEntityTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/ExtendedRevisionEntityTest.java @@ -1,6 +1,6 @@ package org.hibernate.envers.test.integration.reventity.trackmodifiedentities; -import java.util.Properties; +import java.util.Map; import org.junit.Assert; import org.junit.Test; @@ -21,11 +21,11 @@ public class ExtendedRevisionEntityTest extends DefaultTrackingEntitiesTest { cfg.addAnnotatedClass(ExtendedRevisionEntity.class); } - @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties(configuration); - configuration.setProperty("org.hibernate.envers.track_entities_changed_in_revision", "false"); - } + @Override + public void addConfigOptions(Map configuration) { + super.addConfigOptions(configuration); + configuration.put("org.hibernate.envers.track_entities_changed_in_revision", "false"); + } @Test public void testCommentPropertyValue() { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/TrackingEntitiesMultipleChangesTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/TrackingEntitiesMultipleChangesTest.java index 05a2b19770..5a0737aee3 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/TrackingEntitiesMultipleChangesTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/reventity/trackmodifiedentities/TrackingEntitiesMultipleChangesTest.java @@ -1,7 +1,7 @@ package org.hibernate.envers.test.integration.reventity.trackmodifiedentities; import java.util.HashSet; -import java.util.Properties; +import java.util.Map; import javax.persistence.EntityManager; import org.junit.Assert; @@ -9,7 +9,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.CrossTypeRevisionChangesReader; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.tools.TestTools; @@ -17,7 +17,7 @@ import org.hibernate.envers.test.tools.TestTools; /** * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class TrackingEntitiesMultipleChangesTest extends AbstractEntityTest { +public class TrackingEntitiesMultipleChangesTest extends BaseEnversJPAFunctionalTestCase { private Integer steId1 = null; private Integer steId2 = null; @@ -27,10 +27,9 @@ public class TrackingEntitiesMultipleChangesTest extends AbstractEntityTest { } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties( configuration ); - configuration.setProperty("org.hibernate.envers.track_entities_changed_in_revision", "true"); - + protected void addConfigOptions(Map options) { + super.addConfigOptions( options ); + options.put( "org.hibernate.envers.track_entities_changed_in_revision", "true" ) ; } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/revfordate/RevisionForDate.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/revfordate/RevisionForDate.java index a4ba50e3fd..a0b7f0d91c 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/revfordate/RevisionForDate.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/revfordate/RevisionForDate.java @@ -31,14 +31,14 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.AuditReader; import org.hibernate.envers.exception.RevisionDoesNotExistException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class RevisionForDate extends AbstractEntityTest { +public class RevisionForDate extends BaseEnversJPAFunctionalTestCase { private long timestamp1; private long timestamp2; private long timestamp3; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/sameids/SameIds.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/sameids/SameIds.java index a3b9e659da..fcd62bc5ff 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/sameids/SameIds.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/sameids/SameIds.java @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; /** @@ -37,7 +37,7 @@ import org.hibernate.envers.test.Priority; * will both be stored. * @author Adam Warski (adam at warski dot org) */ -public class SameIds extends AbstractEntityTest { +public class SameIds extends BaseEnversJPAFunctionalTestCase { public void configure(Ejb3Configuration cfg) { cfg.addAnnotatedClass(SameIdTestEntity1.class); cfg.addAnnotatedClass(SameIdTestEntity2.class); diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/BasicSecondary.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/BasicSecondary.java index 488c9413ad..57af949aa2 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/BasicSecondary.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/BasicSecondary.java @@ -30,14 +30,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Join; /** * @author Adam Warski (adam at warski dot org) */ -public class BasicSecondary extends AbstractEntityTest { +public class BasicSecondary extends BaseEnversJPAFunctionalTestCase { private Integer id; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/NamingSecondary.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/NamingSecondary.java index ead06ae8ff..990cb28373 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/NamingSecondary.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/NamingSecondary.java @@ -30,14 +30,14 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Join; /** * @author Adam Warski (adam at warski dot org) */ -public class NamingSecondary extends AbstractEntityTest { +public class NamingSecondary extends BaseEnversJPAFunctionalTestCase { private Integer id; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/ids/EmbIdSecondary.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/ids/EmbIdSecondary.java index 6663e9fccc..ea5791c001 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/ids/EmbIdSecondary.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/ids/EmbIdSecondary.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.EmbId; import org.hibernate.mapping.Join; @@ -38,7 +38,7 @@ import org.hibernate.mapping.Join; /** * @author Adam Warski (adam at warski dot org) */ -public class EmbIdSecondary extends AbstractEntityTest { +public class EmbIdSecondary extends BaseEnversJPAFunctionalTestCase { private EmbId id; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/ids/MulIdSecondary.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/ids/MulIdSecondary.java index 72defca4a2..c6458dfaf6 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/ids/MulIdSecondary.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/secondary/ids/MulIdSecondary.java @@ -30,7 +30,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.ids.MulId; import org.hibernate.mapping.Join; @@ -38,7 +38,7 @@ import org.hibernate.mapping.Join; /** * @author Adam Warski (adam at warski dot org) */ -public class MulIdSecondary extends AbstractEntityTest { +public class MulIdSecondary extends BaseEnversJPAFunctionalTestCase { private MulId id; public void configure(Ejb3Configuration cfg) { diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/serialization/SerializingCollection.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/serialization/SerializingCollection.java index b115d4c7bd..91f56b7d6f 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/serialization/SerializingCollection.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/serialization/SerializingCollection.java @@ -32,7 +32,7 @@ import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.onetomany.CollectionRefEdEntity; import org.hibernate.envers.test.entities.onetomany.CollectionRefIngEntity; @@ -40,7 +40,7 @@ import org.hibernate.envers.test.entities.onetomany.CollectionRefIngEntity; /** * @author Adam Warski (adam at warski dot org) */ -public class SerializingCollection extends AbstractEntityTest { +public class SerializingCollection extends BaseEnversJPAFunctionalTestCase { private Integer ed1_id; private Integer ing1_id; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyManyToManyTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyManyToManyTest.java index 6a66091c52..d653b743b7 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyManyToManyTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyManyToManyTest.java @@ -2,13 +2,13 @@ package org.hibernate.envers.test.integration.strategy; import java.util.Arrays; import java.util.HashSet; -import java.util.Properties; +import java.util.Map; import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.manytomany.SetOwnedEntity; import org.hibernate.envers.test.entities.manytomany.SetOwningEntity; @@ -24,7 +24,7 @@ import static org.junit.Assert.assertEquals; * @author Oliver Lorenz * @since 3.6.5 */ -public class ValidityAuditStrategyManyToManyTest extends AbstractEntityTest { +public class ValidityAuditStrategyManyToManyTest extends BaseEnversJPAFunctionalTestCase { private Integer ing_id; @@ -37,9 +37,8 @@ public class ValidityAuditStrategyManyToManyTest extends AbstractEntityTest { } @Override - public void addConfigurationProperties(Properties configuration) { - configuration.setProperty("org.hibernate.envers.audit_strategy", - "org.hibernate.envers.strategy.ValidityAuditStrategy"); + protected void addConfigOptions(Map options) { + options.put("org.hibernate.envers.audit_strategy", "org.hibernate.envers.strategy.ValidityAuditStrategy"); } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTestCustomRevEnt.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTestCustomRevEnt.java index b7be61c9e6..46bfc5ed68 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTestCustomRevEnt.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTestCustomRevEnt.java @@ -41,7 +41,7 @@ import org.hibernate.dialect.PostgreSQL82Dialect; import org.hibernate.dialect.SQLServerDialect; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.strategy.ValidityAuditStrategy; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.manytomany.sametable.Child1Entity; import org.hibernate.envers.test.entities.manytomany.sametable.Child2Entity; @@ -55,7 +55,7 @@ import org.hibernate.envers.test.tools.TestTools; * * @author Erik-Berndt Scheper */ -public class ValidityAuditStrategyRevEndTestCustomRevEnt extends AbstractEntityTest { +public class ValidityAuditStrategyRevEndTestCustomRevEnt extends BaseEnversJPAFunctionalTestCase { private final String revendTimestampColumName = "REVEND_TIMESTAMP"; private Integer p1_id; @@ -74,21 +74,12 @@ public class ValidityAuditStrategyRevEndTestCustomRevEnt extends AbstractEntityT } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties( configuration ); - - configuration.setProperty("org.hibernate.envers.audit_strategy", - "org.hibernate.envers.strategy.ValidityAuditStrategy"); - configuration - .setProperty( - "org.hibernate.envers.audit_strategy_validity_store_revend_timestamp", - "true"); - configuration - .setProperty( - "org.hibernate.envers.audit_strategy_validity_revend_timestamp_field_name", - revendTimestampColumName); - - } + protected void addConfigOptions(Map options) { + super.addConfigOptions( options ); + options.put("org.hibernate.envers.audit_strategy", "org.hibernate.envers.strategy.ValidityAuditStrategy"); + options.put("org.hibernate.envers.audit_strategy_validity_store_revend_timestamp", "true"); + options.put("org.hibernate.envers.audit_strategy_validity_revend_timestamp_field_name", revendTimestampColumName); + } @Test @Priority(10) diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTsTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTsTest.java index 6c83f894af..bfab016e56 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTsTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/strategy/ValidityAuditStrategyRevEndTsTest.java @@ -44,7 +44,7 @@ import org.hibernate.dialect.SQLServerDialect; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.enhanced.DefaultRevisionEntity; import org.hibernate.envers.strategy.ValidityAuditStrategy; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.manytomany.sametable.Child1Entity; import org.hibernate.envers.test.entities.manytomany.sametable.Child2Entity; @@ -57,7 +57,7 @@ import org.hibernate.envers.test.tools.TestTools; * * @author Erik-Berndt Scheper */ -public class ValidityAuditStrategyRevEndTsTest extends AbstractEntityTest { +public class ValidityAuditStrategyRevEndTsTest extends BaseEnversJPAFunctionalTestCase { private final String revendTimestampColumName = "REVEND_TIMESTAMP"; private Integer p1_id; @@ -76,19 +76,11 @@ public class ValidityAuditStrategyRevEndTsTest extends AbstractEntityTest { } @Override - public void addConfigurationProperties(Properties configuration) { - super.addConfigurationProperties( configuration ); - - configuration.setProperty("org.hibernate.envers.audit_strategy", - "org.hibernate.envers.strategy.ValidityAuditStrategy"); - configuration - .setProperty( - "org.hibernate.envers.audit_strategy_validity_store_revend_timestamp", - "true"); - configuration - .setProperty( - "org.hibernate.envers.audit_strategy_validity_revend_timestamp_field_name", - revendTimestampColumName); + protected void addConfigOptions(Map options) { + super.addConfigOptions( options ); + options.put("org.hibernate.envers.audit_strategy", "org.hibernate.envers.strategy.ValidityAuditStrategy"); + options.put("org.hibernate.envers.audit_strategy_validity_store_revend_timestamp", "true"); + options.put("org.hibernate.envers.audit_strategy_validity_revend_timestamp_field_name", revendTimestampColumName); } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditAtMethodSuperclassLevel/auditAllSubclass/MappedSubclassingAllAuditedTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditAtMethodSuperclassLevel/auditAllSubclass/MappedSubclassingAllAuditedTest.java index 57a6269279..59cd925597 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditAtMethodSuperclassLevel/auditAllSubclass/MappedSubclassingAllAuditedTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditAtMethodSuperclassLevel/auditAllSubclass/MappedSubclassingAllAuditedTest.java @@ -30,7 +30,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.exception.NotAuditedException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.integration.superclass.auditAtMethodSuperclassLevel.AuditedMethodMappedSuperclass; import org.hibernate.envers.test.integration.superclass.auditAtMethodSuperclassLevel.NotAuditedSubclassEntity; @@ -41,7 +41,7 @@ import org.hibernate.envers.test.integration.superclass.auditAtMethodSuperclassL * @author Hern&aacut;n Chanfreau * */ -public class MappedSubclassingAllAuditedTest extends AbstractEntityTest { +public class MappedSubclassingAllAuditedTest extends BaseEnversJPAFunctionalTestCase { private Integer id2_1; private Integer id1_1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditAtMethodSuperclassLevel/auditMethodSubclass/MappedSubclassingMethodAuditedTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditAtMethodSuperclassLevel/auditMethodSubclass/MappedSubclassingMethodAuditedTest.java index c89171c4f2..ca6b6c6e1f 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditAtMethodSuperclassLevel/auditMethodSubclass/MappedSubclassingMethodAuditedTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditAtMethodSuperclassLevel/auditMethodSubclass/MappedSubclassingMethodAuditedTest.java @@ -30,7 +30,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.exception.NotAuditedException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.integration.superclass.auditAtMethodSuperclassLevel.AuditedMethodMappedSuperclass; import org.hibernate.envers.test.integration.superclass.auditAtMethodSuperclassLevel.NotAuditedSubclassEntity; @@ -41,7 +41,7 @@ import org.hibernate.envers.test.integration.superclass.auditAtMethodSuperclassL * @author Hern&aacut;n Chanfreau * */ -public class MappedSubclassingMethodAuditedTest extends AbstractEntityTest { +public class MappedSubclassingMethodAuditedTest extends BaseEnversJPAFunctionalTestCase { private Integer id2_1; private Integer id1_1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditedAtSuperclassLevel/auditAllSubclass/MappedSubclassingAllAuditedTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditedAtSuperclassLevel/auditAllSubclass/MappedSubclassingAllAuditedTest.java index 9cc074df99..781225bf45 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditedAtSuperclassLevel/auditAllSubclass/MappedSubclassingAllAuditedTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditedAtSuperclassLevel/auditAllSubclass/MappedSubclassingAllAuditedTest.java @@ -30,7 +30,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.exception.NotAuditedException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.integration.superclass.auditedAtSuperclassLevel.AuditedAllMappedSuperclass; import org.hibernate.envers.test.integration.superclass.auditedAtSuperclassLevel.NotAuditedSubclassEntity; @@ -41,7 +41,7 @@ import org.hibernate.envers.test.integration.superclass.auditedAtSuperclassLevel * @author Hern&aacut;n Chanfreau * */ -public class MappedSubclassingAllAuditedTest extends AbstractEntityTest { +public class MappedSubclassingAllAuditedTest extends BaseEnversJPAFunctionalTestCase { private Integer id2_1; private Integer id1_1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditedAtSuperclassLevel/auditMethodSubclass/MappedSubclassingMethodAuditedTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditedAtSuperclassLevel/auditMethodSubclass/MappedSubclassingMethodAuditedTest.java index 92160dfcad..cf0c0f760d 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditedAtSuperclassLevel/auditMethodSubclass/MappedSubclassingMethodAuditedTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditedAtSuperclassLevel/auditMethodSubclass/MappedSubclassingMethodAuditedTest.java @@ -30,7 +30,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.exception.NotAuditedException; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.integration.superclass.auditedAtSuperclassLevel.AuditedAllMappedSuperclass; import org.hibernate.envers.test.integration.superclass.auditedAtSuperclassLevel.NotAuditedSubclassEntity; @@ -41,7 +41,7 @@ import org.hibernate.envers.test.integration.superclass.auditedAtSuperclassLevel * @author Hern&aacut;n Chanfreau * */ -public class MappedSubclassingMethodAuditedTest extends AbstractEntityTest { +public class MappedSubclassingMethodAuditedTest extends BaseEnversJPAFunctionalTestCase { private Integer id2_1; private Integer id1_1; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditClassOverrideTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditClassOverrideTest.java index 197ecf9868..2025ec33de 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditClassOverrideTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditClassOverrideTest.java @@ -6,7 +6,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Column; import org.hibernate.mapping.Table; @@ -16,7 +16,7 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-4439") -public class AuditClassOverrideTest extends AbstractEntityTest { +public class AuditClassOverrideTest extends BaseEnversJPAFunctionalTestCase { private Integer classAuditedEntityId = null; private Integer classNotAuditedEntityId = null; private Table classAuditedTable = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditPropertyOverrideTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditPropertyOverrideTest.java index 21d9280682..9c7f69f660 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditPropertyOverrideTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/AuditPropertyOverrideTest.java @@ -6,7 +6,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Column; import org.hibernate.mapping.Table; @@ -16,7 +16,7 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-4439") -public class AuditPropertyOverrideTest extends AbstractEntityTest { +public class AuditPropertyOverrideTest extends BaseEnversJPAFunctionalTestCase { private Integer propertyEntityId = null; private Integer transitiveEntityId = null; private Integer auditedEntityId = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/MixedOverrideTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/MixedOverrideTest.java index 6729d0b1c2..c6d2e59a30 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/MixedOverrideTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditoverride/MixedOverrideTest.java @@ -6,7 +6,7 @@ import org.junit.Assert; import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.mapping.Column; import org.hibernate.mapping.Table; @@ -16,7 +16,7 @@ import org.hibernate.testing.TestForIssue; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-4439") -public class MixedOverrideTest extends AbstractEntityTest { +public class MixedOverrideTest extends BaseEnversJPAFunctionalTestCase { private Integer mixedEntityId = null; private Table mixedTable = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/MultipleAuditParentsTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/MultipleAuditParentsTest.java index 35c312b9a4..c8ae8d851b 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/MultipleAuditParentsTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/MultipleAuditParentsTest.java @@ -9,7 +9,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.Audited; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; import org.hibernate.envers.test.tools.TestTools; @@ -21,7 +21,7 @@ import org.hibernate.mapping.Table; * All supperclasses are marked with {@link MappedSuperclass} annotation but not {@link Audited}. * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class MultipleAuditParentsTest extends AbstractEntityTest { +public class MultipleAuditParentsTest extends BaseEnversJPAFunctionalTestCase { private long childMultipleId = 1L; private Integer siteMultipleId = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/SingleAuditParentsTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/SingleAuditParentsTest.java index 697065e32f..7f253b5047 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/SingleAuditParentsTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/SingleAuditParentsTest.java @@ -9,7 +9,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.Audited; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; import org.hibernate.envers.test.tools.TestTools; @@ -21,16 +21,13 @@ import org.hibernate.mapping.Table; * All supperclasses are marked with {@link MappedSuperclass} annotation but not {@link Audited}. * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class SingleAuditParentsTest extends AbstractEntityTest { +public class SingleAuditParentsTest extends BaseEnversJPAFunctionalTestCase { private long childSingleId = 1L; private Integer siteSingleId = null; @Override - public void configure(Ejb3Configuration cfg) { - cfg.addAnnotatedClass(MappedGrandparentEntity.class); - cfg.addAnnotatedClass(MappedParentEntity.class); - cfg.addAnnotatedClass(ChildSingleParentEntity.class); - cfg.addAnnotatedClass(StrIntTestEntity.class); + protected Class[] getAnnotatedClasses() { + return new Class[]{MappedGrandparentEntity.class, MappedParentEntity.class, ChildSingleParentEntity.class, StrIntTestEntity.class}; } @Test @@ -44,6 +41,7 @@ public class SingleAuditParentsTest extends AbstractEntityTest { em.persist(new ChildSingleParentEntity(childSingleId, "grandparent 1", "notAudited 1", "parent 1", "child 1", siteSingle)); em.getTransaction().commit(); siteSingleId = siteSingle.getId(); + em.close(); } @Test diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/TotalAuditParentsTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/TotalAuditParentsTest.java index e33c93d08b..530df55636 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/TotalAuditParentsTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/TotalAuditParentsTest.java @@ -8,7 +8,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.Audited; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrIntTestEntity; import org.hibernate.envers.test.tools.TestTools; @@ -21,7 +21,7 @@ import org.hibernate.mapping.Table; * attributes of baby class shall be audited. * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class TotalAuditParentsTest extends AbstractEntityTest { +public class TotalAuditParentsTest extends BaseEnversJPAFunctionalTestCase { private long babyCompleteId = 1L; private Integer siteCompleteId = null; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/TransitiveAuditParentsTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/TransitiveAuditParentsTest.java index 800cb12767..6b2c1cf529 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/TransitiveAuditParentsTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/superclass/auditparents/TransitiveAuditParentsTest.java @@ -8,7 +8,7 @@ import org.junit.Test; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.envers.Audited; -import org.hibernate.envers.test.AbstractEntityTest; +import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.tools.TestTools; import org.hibernate.mapping.Column; @@ -19,7 +19,7 @@ import org.hibernate.mapping.Table; * property. Child entity may mark explicitly its parent as audited or not. * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class TransitiveAuditParentsTest extends AbstractEntityTest { +public class TransitiveAuditParentsTest extends BaseEnversJPAFunctionalTestCase { private long childImpTransId = 1L; private long childExpTransId = 2L; diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java index bf33f4929b..5b9a1476b4 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java @@ -1,34 +1,28 @@ package org.hibernate.envers.test.integration.tools; -import java.net.URISyntaxException; -import java.util.Arrays; - -import org.junit.Assert; -import org.junit.Test; - -import org.hibernate.MappingException; import org.hibernate.Session; -import org.hibernate.cfg.Environment; -import org.hibernate.envers.test.AbstractSessionTest; +import org.hibernate.envers.test.BaseEnversFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.testing.TestForIssue; import org.hibernate.tool.EnversSchemaGenerator; +import org.junit.Assert; +import org.junit.Test; + +import java.util.Arrays; /** * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @TestForIssue(jiraKey = "HHH-7106") -public class SchemaExportTest extends AbstractSessionTest { +public class SchemaExportTest extends BaseEnversFunctionalTestCase { private Integer id = null; @Override - protected void initMappings() throws MappingException, URISyntaxException { - config.addAnnotatedClass(StrTestEntity.class); -// Setting this property causes manual flush tests failures -// config.setProperty( Environment.USE_NEW_ID_GENERATOR_MAPPINGS, "true" ); - config.setProperty("org.hibernate.envers.use_enhanced_revision_entity", "true"); + protected Class[] getAnnotatedClasses() { + return new Class[] {StrTestEntity.class}; } + protected boolean createSchema() { // Disable schema auto generation. return false; @@ -37,7 +31,7 @@ public class SchemaExportTest extends AbstractSessionTest { @Priority(10) public void testSchemaCreation() { // Generate complete schema. - new EnversSchemaGenerator(config).export().create( true, true ); + new EnversSchemaGenerator(configuration()).export().create( true, true ); // Populate database with test data. Session session = getSession(); @@ -49,15 +43,16 @@ public class SchemaExportTest extends AbstractSessionTest { id = entity.getId(); } - @Override - public void closeSessionFactory() { - new EnversSchemaGenerator(config).export().drop( true, true ); - super.closeSessionFactory(); - } - @Test + @Priority(9) public void testAuditDataRetrieval() { Assert.assertEquals(Arrays.asList(1), getAuditReader().getRevisions(StrTestEntity.class, id)); Assert.assertEquals(new StrTestEntity("data", id), getAuditReader().find(StrTestEntity.class, id, 1)); } + + @Test + @Priority(8) + public void testSchemaDrop() { + new EnversSchemaGenerator(configuration()).export().drop( true, true ); + } } diff --git a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/performance/EvictAuditDataAfterCommitTest.java b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/performance/EvictAuditDataAfterCommitTest.java index 2fbdfa081e..dee32bdf67 100644 --- a/hibernate-envers/src/matrix/java/org/hibernate/envers/test/performance/EvictAuditDataAfterCommitTest.java +++ b/hibernate-envers/src/matrix/java/org/hibernate/envers/test/performance/EvictAuditDataAfterCommitTest.java @@ -15,7 +15,7 @@ import org.hibernate.engine.spi.EntityEntry; import org.hibernate.engine.spi.PersistenceContext; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.envers.enhanced.DefaultRevisionEntity; -import org.hibernate.envers.test.AbstractSessionTest; +import org.hibernate.envers.test.BaseEnversFunctionalTestCase; import org.hibernate.envers.test.entities.StrTestEntity; import org.hibernate.envers.test.entities.onetomany.SetRefEdEntity; import org.hibernate.envers.test.entities.onetomany.SetRefIngEntity; @@ -24,22 +24,21 @@ import org.hibernate.testing.TestForIssue; /** * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ -public class EvictAuditDataAfterCommitTest extends AbstractSessionTest { +public class EvictAuditDataAfterCommitTest extends BaseEnversFunctionalTestCase { @Override - protected void initMappings() throws MappingException, URISyntaxException { - config.addAnnotatedClass(StrTestEntity.class); - config.addAnnotatedClass(SetRefEdEntity.class); - config.addAnnotatedClass(SetRefIngEntity.class); + protected Class[] getAnnotatedClasses() { + return new Class[]{StrTestEntity.class, SetRefEdEntity.class, SetRefIngEntity.class}; } @Test @TestForIssue(jiraKey = "HHH-6614") public void testSessionCacheClear() { - getSession().getTransaction().begin(); + Session session = openSession(); + session.getTransaction().begin(); StrTestEntity ste = new StrTestEntity("data"); - getSession().persist(ste); - getSession().getTransaction().commit(); - checkEmptyAuditSessionCache(getSession(), "org.hibernate.envers.test.entities.StrTestEntity_AUD"); + session.persist(ste); + session.getTransaction().commit(); + checkEmptyAuditSessionCache(session, "org.hibernate.envers.test.entities.StrTestEntity_AUD"); } @Test @@ -52,42 +51,45 @@ public class EvictAuditDataAfterCommitTest extends AbstractSessionTest { SetRefEdEntity ed2 = new SetRefEdEntity(2, "data_ed_2"); SetRefIngEntity ing1 = new SetRefIngEntity(3, "data_ing_1"); SetRefIngEntity ing2 = new SetRefIngEntity(4, "data_ing_2"); - - getSession().getTransaction().begin(); - getSession().persist(ed1); - getSession().persist(ed2); - getSession().persist(ing1); - getSession().persist(ing2); - getSession().getTransaction().commit(); - checkEmptyAuditSessionCache(getSession(), auditEntityNames); - getSession().getTransaction().begin(); - ed1 = (SetRefEdEntity) getSession().load(SetRefEdEntity.class, ed1.getId()); + Session session = openSession(); + session.getTransaction().begin(); + session.persist(ed1); + session.persist(ed2); + session.persist(ing1); + session.persist(ing2); + session.getTransaction().commit(); + checkEmptyAuditSessionCache(session, auditEntityNames); + + session.getTransaction().begin(); + ed1 = (SetRefEdEntity) session.load(SetRefEdEntity.class, ed1.getId()); ing1.setReference(ed1); ing2.setReference(ed1); - getSession().getTransaction().commit(); - checkEmptyAuditSessionCache(getSession(), auditEntityNames); + session.getTransaction().commit(); + checkEmptyAuditSessionCache(session, auditEntityNames); - getSession().getTransaction().begin(); - ed2 = (SetRefEdEntity) getSession().load(SetRefEdEntity.class, ed2.getId()); + session.getTransaction().begin(); + ed2 = (SetRefEdEntity) session.load(SetRefEdEntity.class, ed2.getId()); Set reffering = new HashSet(); reffering.add(ing1); reffering.add(ing2); ed2.setReffering(reffering); - getSession().getTransaction().commit(); - checkEmptyAuditSessionCache(getSession(), auditEntityNames); + session.getTransaction().commit(); + checkEmptyAuditSessionCache(session, auditEntityNames); - getSession().getTransaction().begin(); - ed2 = (SetRefEdEntity) getSession().load(SetRefEdEntity.class, ed2.getId()); + session.getTransaction().begin(); + ed2 = (SetRefEdEntity) session.load(SetRefEdEntity.class, ed2.getId()); ed2.getReffering().remove(ing1); - getSession().getTransaction().commit(); - checkEmptyAuditSessionCache(getSession(), auditEntityNames); + session.getTransaction().commit(); + checkEmptyAuditSessionCache(session, auditEntityNames); - getSession().getTransaction().begin(); - ed2 = (SetRefEdEntity) getSession().load(SetRefEdEntity.class, ed2.getId()); + session.getTransaction().begin(); + ed2 = (SetRefEdEntity) session.load(SetRefEdEntity.class, ed2.getId()); ed2.getReffering().iterator().next().setData("mod_data_ing_2"); - getSession().getTransaction().commit(); - checkEmptyAuditSessionCache(getSession(), auditEntityNames); + session.getTransaction().commit(); + checkEmptyAuditSessionCache(session, auditEntityNames); + + session.close(); } private void checkEmptyAuditSessionCache(Session session, String ... auditEntityNames) { diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseCoreFunctionalTestCase.java b/hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseCoreFunctionalTestCase.java index 51a6e5b155..ff0a8909a9 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseCoreFunctionalTestCase.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseCoreFunctionalTestCase.java @@ -88,7 +88,7 @@ public abstract class BaseCoreFunctionalTestCase extends BaseUnitTestCase { private StandardServiceRegistryImpl serviceRegistry; private SessionFactoryImplementor sessionFactory; - private Session session; + protected Session session; protected static Dialect getDialect() { return DIALECT;