HHH-7498 some tests were targeting to the H2 only but now runs on db matrix

This commit is contained in:
Strong Liu 2012-08-02 17:42:58 +08:00
parent 695ffd2d37
commit 8815b7a200
17 changed files with 55 additions and 4 deletions

View File

@ -43,6 +43,9 @@ import org.hibernate.metamodel.binding.EntityBinding;
import org.hibernate.metamodel.binding.EntityIdentifier; import org.hibernate.metamodel.binding.EntityIdentifier;
import org.hibernate.metamodel.source.MappingException; import org.hibernate.metamodel.source.MappingException;
import org.hibernate.service.ServiceRegistryBuilder; import org.hibernate.service.ServiceRegistryBuilder;
import org.hibernate.testing.DialectCheck;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertFalse;
@ -53,6 +56,7 @@ import static junit.framework.Assert.fail;
/** /**
* @author Hardy Ferentschik * @author Hardy Ferentschik
*/ */
@RequiresDialectFeature( DialectChecks.SupportsSequences.class )
public class IdentifierGeneratorTest extends BaseAnnotationBindingTestCase { public class IdentifierGeneratorTest extends BaseAnnotationBindingTestCase {
@Entity @Entity
class NoGenerationEntity { class NoGenerationEntity {

View File

@ -34,6 +34,7 @@ import java.util.List;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.SessionFactory; import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.exception.GenericJDBCException; import org.hibernate.exception.GenericJDBCException;
import org.hibernate.integrator.internal.IntegratorServiceImpl; import org.hibernate.integrator.internal.IntegratorServiceImpl;
import org.hibernate.integrator.spi.Integrator; import org.hibernate.integrator.spi.Integrator;
@ -43,12 +44,14 @@ import org.hibernate.service.ServiceRegistryBuilder;
import org.hibernate.service.classloading.internal.ClassLoaderServiceImpl; import org.hibernate.service.classloading.internal.ClassLoaderServiceImpl;
import org.hibernate.service.classloading.spi.ClassLoaderService; import org.hibernate.service.classloading.spi.ClassLoaderService;
import org.hibernate.service.internal.BootstrapServiceRegistryImpl; import org.hibernate.service.internal.BootstrapServiceRegistryImpl;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.junit4.BaseUnitTestCase; import org.hibernate.testing.junit4.BaseUnitTestCase;
import org.junit.Test; import org.junit.Test;
/** /**
* @author Chris Pheby * @author Chris Pheby
*/ */
@RequiresDialect(H2Dialect.class)
public class EmbeddableIntegratorTest extends BaseUnitTestCase { public class EmbeddableIntegratorTest extends BaseUnitTestCase {
/** /**

View File

@ -13,11 +13,11 @@ import org.hibernate.annotations.ParamDef;
import org.hibernate.annotations.SqlFragmentAlias; import org.hibernate.annotations.SqlFragmentAlias;
@Entity @Entity
@Table(name="USER") @Table(name="T_USER")
@SecondaryTable(name="SECURITY_USER") @SecondaryTable(name="SECURITY_USER")
@FilterDef(name="ageFilter", parameters=@ParamDef(name="age", type="integer")) @FilterDef(name="ageFilter", parameters=@ParamDef(name="age", type="integer"))
@Filter(name="ageFilter", condition="{u}.AGE < :age AND {s}.LOCKED_OUT <> 1", @Filter(name="ageFilter", condition="{u}.AGE < :age AND {s}.LOCKED_OUT <> 1",
aliases={@SqlFragmentAlias(alias="u", table="USER"), @SqlFragmentAlias(alias="s", table="SECURITY_USER")}) aliases={@SqlFragmentAlias(alias="u", table="T_USER"), @SqlFragmentAlias(alias="s", table="SECURITY_USER")})
public class User { public class User {
@Id @Id
@ -31,10 +31,10 @@ public class User {
@Column(name="AGE") @Column(name="AGE")
private int age; private int age;
@Column(name="USERNAME", table="SECURITY_USER") @Column(name="SECURITY_USERNAME", table="SECURITY_USER")
private String username; private String username;
@Column(name="PASSWORD", table="SECURITY_USER") @Column(name="SECURITY_PASSWORD", table="SECURITY_USER")
private String password; private String password;
@Column(name="LOCKED_OUT", table="SECURITY_USER") @Column(name="LOCKED_OUT", table="SECURITY_USER")

View File

@ -14,9 +14,11 @@ import org.hibernate.ScrollableResults;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory; import org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory;
import org.hibernate.internal.util.SerializationHelper; import org.hibernate.internal.util.SerializationHelper;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider; import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.jta.TestingJtaBootstrap; import org.hibernate.testing.jta.TestingJtaBootstrap;
import org.hibernate.testing.jta.TestingJtaPlatformImpl; import org.hibernate.testing.jta.TestingJtaPlatformImpl;
@ -29,6 +31,7 @@ import static org.junit.Assert.fail;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@RequiresDialect(H2Dialect.class)
public class AggressiveReleaseTest extends ConnectionManagementTestCase { public class AggressiveReleaseTest extends ConnectionManagementTestCase {
@Override @Override
public void configure(Configuration cfg) { public void configure(Configuration cfg) {

View File

@ -27,12 +27,15 @@ import org.hibernate.ConnectionReleaseMode;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.testing.RequiresDialect;
/** /**
* Implementation of BasicConnectionProviderTest. * Implementation of BasicConnectionProviderTest.
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@RequiresDialect(H2Dialect.class)
public class BasicConnectionProviderTest extends ConnectionManagementTestCase { public class BasicConnectionProviderTest extends ConnectionManagementTestCase {
@Override @Override
protected Session getSessionUnderTest() { protected Session getSessionUnderTest() {

View File

@ -26,7 +26,9 @@ import org.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.internal.util.SerializationHelper; import org.hibernate.internal.util.SerializationHelper;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
@ -45,6 +47,7 @@ import static org.junit.Assert.fail;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public abstract class ConnectionManagementTestCase extends BaseCoreFunctionalTestCase { public abstract class ConnectionManagementTestCase extends BaseCoreFunctionalTestCase {
@Override @Override
public final String[] getMappings() { public final String[] getMappings() {

View File

@ -24,12 +24,15 @@
package org.hibernate.test.connections; package org.hibernate.test.connections;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.testing.RequiresDialect;
/** /**
* Implementation of CurrentSessionConnectionTest. * Implementation of CurrentSessionConnectionTest.
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@RequiresDialect(H2Dialect.class)
public class CurrentSessionConnectionTest extends AggressiveReleaseTest { public class CurrentSessionConnectionTest extends AggressiveReleaseTest {
@Override @Override
protected Session getSessionUnderTest() throws Throwable { protected Session getSessionUnderTest() throws Throwable {

View File

@ -31,11 +31,13 @@ import org.hibernate.ConnectionReleaseMode;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.service.jdbc.connections.internal.UserSuppliedConnectionProviderImpl; import org.hibernate.service.jdbc.connections.internal.UserSuppliedConnectionProviderImpl;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider; import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.service.spi.Stoppable; import org.hibernate.service.spi.Stoppable;
import org.hibernate.testing.AfterClassOnce; import org.hibernate.testing.AfterClassOnce;
import org.hibernate.testing.BeforeClassOnce; import org.hibernate.testing.BeforeClassOnce;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.env.ConnectionProviderBuilder; import org.hibernate.testing.env.ConnectionProviderBuilder;
import org.hibernate.tool.hbm2ddl.SchemaExport; import org.hibernate.tool.hbm2ddl.SchemaExport;
@ -44,6 +46,7 @@ import org.hibernate.tool.hbm2ddl.SchemaExport;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@RequiresDialect(H2Dialect.class)
public class SuppliedConnectionTest extends ConnectionManagementTestCase { public class SuppliedConnectionTest extends ConnectionManagementTestCase {
private ConnectionProvider cp = ConnectionProviderBuilder.buildConnectionProvider(); private ConnectionProvider cp = ConnectionProviderBuilder.buildConnectionProvider();
private Connection connectionUnderTest; private Connection connectionUnderTest;

View File

@ -30,8 +30,10 @@ import org.hibernate.Session;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.context.internal.ThreadLocalSessionContext; import org.hibernate.context.internal.ThreadLocalSessionContext;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.transaction.spi.LocalStatus; import org.hibernate.engine.transaction.spi.LocalStatus;
import org.hibernate.testing.RequiresDialect;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
@ -41,6 +43,7 @@ import static org.junit.Assert.fail;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@RequiresDialect(H2Dialect.class)
public class ThreadLocalCurrentSessionTest extends ConnectionManagementTestCase { public class ThreadLocalCurrentSessionTest extends ConnectionManagementTestCase {
@Override @Override
public void configure(Configuration cfg) { public void configure(Configuration cfg) {

View File

@ -25,7 +25,9 @@ package org.hibernate.test.fileimport;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.service.ServiceRegistryBuilder; import org.hibernate.service.ServiceRegistryBuilder;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.tool.hbm2ddl.ImportSqlCommandExtractor; import org.hibernate.tool.hbm2ddl.ImportSqlCommandExtractor;
import org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor; import org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor;
@ -34,6 +36,10 @@ import org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor;
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
*/ */
@TestForIssue( jiraKey = "HHH-2403" ) @TestForIssue( jiraKey = "HHH-2403" )
@RequiresDialect(value = H2Dialect.class,
jiraKey = "HHH-6286",
comment = "Only running the tests against H2, because the sql statements in the import file are not generic. " +
"This test should actually not test directly against the db")
public class CommandExtractorServiceTest extends MultiLineImportFileTest { public class CommandExtractorServiceTest extends MultiLineImportFileTest {
@Override @Override
public void configure(Configuration cfg) { public void configure(Configuration cfg) {

View File

@ -32,11 +32,14 @@ import org.hibernate.cfg.Configuration;
import org.junit.Test; import org.junit.Test;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@RequiresDialect(H2Dialect.class)
public class DoesNotWorkTest extends BaseCoreFunctionalTestCase { public class DoesNotWorkTest extends BaseCoreFunctionalTestCase {
@Override @Override
protected Class<?>[] getAnnotatedClasses() { protected Class<?>[] getAnnotatedClasses() {

View File

@ -31,6 +31,8 @@ import org.hibernate.cfg.Configuration;
import org.junit.Test; import org.junit.Test;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -39,6 +41,7 @@ import static org.junit.Assert.assertNotNull;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@RequiresDialect(H2Dialect.class)
public class DoesNotWorkWithHbmTest extends BaseCoreFunctionalTestCase { public class DoesNotWorkWithHbmTest extends BaseCoreFunctionalTestCase {
@Override @Override

View File

@ -35,6 +35,7 @@ import org.hibernate.service.internal.StandardServiceRegistryImpl;
import org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl; import org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl;
import org.hibernate.service.jdbc.connections.internal.UserSuppliedConnectionProviderImpl; import org.hibernate.service.jdbc.connections.internal.UserSuppliedConnectionProviderImpl;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider; import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.env.ConnectionProviderBuilder; import org.hibernate.testing.env.ConnectionProviderBuilder;
import org.hibernate.testing.junit4.BaseUnitTestCase; import org.hibernate.testing.junit4.BaseUnitTestCase;
@ -44,6 +45,7 @@ import static org.junit.Assert.assertTrue;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@RequiresDialect( H2Dialect.class )
public class ServiceBootstrappingTest extends BaseUnitTestCase { public class ServiceBootstrappingTest extends BaseUnitTestCase {
@Test @Test
public void testBasicBuild() { public void testBasicBuild() {

View File

@ -11,14 +11,17 @@ import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.ejb.test.Cat; import org.hibernate.ejb.test.Cat;
import org.hibernate.ejb.test.Kitten; import org.hibernate.ejb.test.Kitten;
import org.hibernate.internal.util.ConfigHelper; import org.hibernate.internal.util.ConfigHelper;
import org.hibernate.testing.RequiresDialect;
/** /**
* @author Emmanuel Bernard * @author Emmanuel Bernard
*/ */
@RequiresDialect(H2Dialect.class)
public class ProgrammaticConfTest { public class ProgrammaticConfTest {
@Test @Test
public void testProgrammaticAPI() throws Exception { public void testProgrammaticAPI() throws Exception {

View File

@ -36,6 +36,7 @@ import javax.persistence.MappedSuperclass;
import org.junit.Test; import org.junit.Test;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.ejb.packaging.ClassFilter; import org.hibernate.ejb.packaging.ClassFilter;
import org.hibernate.ejb.packaging.Entry; import org.hibernate.ejb.packaging.Entry;
import org.hibernate.ejb.packaging.ExplodedJarVisitor; import org.hibernate.ejb.packaging.ExplodedJarVisitor;
@ -49,6 +50,7 @@ import org.hibernate.ejb.packaging.JarVisitorFactory;
import org.hibernate.ejb.packaging.PackageFilter; import org.hibernate.ejb.packaging.PackageFilter;
import org.hibernate.ejb.test.pack.defaultpar.ApplicationServer; import org.hibernate.ejb.test.pack.defaultpar.ApplicationServer;
import org.hibernate.ejb.test.pack.explodedpar.Carpet; import org.hibernate.ejb.test.pack.explodedpar.Carpet;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -61,6 +63,7 @@ import static org.junit.Assert.assertTrue;
* @author Hardy Ferentschik * @author Hardy Ferentschik
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@RequiresDialect(H2Dialect.class)
public class JarVisitorTest extends PackagingTestCase { public class JarVisitorTest extends PackagingTestCase {
@Test @Test
public void testHttp() throws Exception { public void testHttp() throws Exception {

View File

@ -34,6 +34,7 @@ import javax.persistence.PersistenceException;
import org.junit.Test; import org.junit.Test;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.ejb.AvailableSettings; import org.hibernate.ejb.AvailableSettings;
import org.hibernate.ejb.HibernateEntityManagerFactory; import org.hibernate.ejb.HibernateEntityManagerFactory;
import org.hibernate.ejb.test.Distributor; import org.hibernate.ejb.test.Distributor;
@ -62,6 +63,7 @@ import org.hibernate.event.service.spi.EventListenerRegistry;
import org.hibernate.event.spi.EventType; import org.hibernate.event.spi.EventType;
import org.hibernate.internal.util.ConfigHelper; import org.hibernate.internal.util.ConfigHelper;
import org.hibernate.stat.Statistics; import org.hibernate.stat.Statistics;
import org.hibernate.testing.RequiresDialect;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
@ -79,6 +81,7 @@ import static org.junit.Assert.fail;
* @author Hardy Ferentschik * @author Hardy Ferentschik
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@RequiresDialect(H2Dialect.class)
public class PackagedEntityManagerTest extends PackagingTestCase { public class PackagedEntityManagerTest extends PackagingTestCase {
@Test @Test
public void testDefaultPar() throws Exception { public void testDefaultPar() throws Exception {

View File

@ -36,11 +36,13 @@ import javax.persistence.Persistence;
import org.junit.Test; import org.junit.Test;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.ejb.AvailableSettings; import org.hibernate.ejb.AvailableSettings;
import org.hibernate.ejb.packaging.NamedInputStream; import org.hibernate.ejb.packaging.NamedInputStream;
import org.hibernate.ejb.packaging.NativeScanner; import org.hibernate.ejb.packaging.NativeScanner;
import org.hibernate.ejb.packaging.Scanner; import org.hibernate.ejb.packaging.Scanner;
import org.hibernate.ejb.test.pack.defaultpar.ApplicationServer; import org.hibernate.ejb.test.pack.defaultpar.ApplicationServer;
import org.hibernate.testing.RequiresDialect;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
@ -50,6 +52,7 @@ import static org.junit.Assert.assertTrue;
* @author Emmanuel Bernard * @author Emmanuel Bernard
* @author Hardy Ferentschik * @author Hardy Ferentschik
*/ */
@RequiresDialect(H2Dialect.class)
public class ScannerTest extends PackagingTestCase { public class ScannerTest extends PackagingTestCase {
@Test @Test
public void testNativeScanner() throws Exception { public void testNativeScanner() throws Exception {