HHH-7281 Tests fail on Postgresql due to failure in typecasting

This commit is contained in:
Strong Liu 2012-04-27 16:44:59 +08:00
parent bfc8e6ec81
commit 016ce8649e
9 changed files with 18 additions and 9 deletions

View File

@ -37,6 +37,7 @@ import org.hibernate.SQLQuery;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.function.SQLFunction; import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.stat.Statistics; import org.hibernate.stat.Statistics;
@ -353,7 +354,7 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@SkipForDialect(value = { PostgreSQLDialect.class }, @SkipForDialect(value = { PostgreSQL81Dialect.class },
comment = "postgresql jdbc driver does not implement the setQueryTimeout method") comment = "postgresql jdbc driver does not implement the setQueryTimeout method")
public void testCache() throws Exception { public void testCache() throws Exception {
Session s; Session s;

View File

@ -31,6 +31,7 @@ import org.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.SessionFactory; import org.hibernate.SessionFactory;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.persister.collection.BasicCollectionPersister; import org.hibernate.persister.collection.BasicCollectionPersister;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
@ -44,7 +45,7 @@ import static org.junit.Assert.assertNotNull;
*/ */
public class Ejb3XmlTest extends BaseCoreFunctionalTestCase { public class Ejb3XmlTest extends BaseCoreFunctionalTestCase {
@Test @Test
@SkipForDialect(value = { PostgreSQLDialect.class }, @SkipForDialect(value = { PostgreSQL81Dialect.class },
comment = "postgresql jdbc driver does not implement the setQueryTimeout method") comment = "postgresql jdbc driver does not implement the setQueryTimeout method")
public void testEjb3Xml() throws Exception { public void testEjb3Xml() throws Exception {
Session s = openSession(); Session s = openSession();

View File

@ -30,6 +30,7 @@ import org.junit.Test;
import org.hibernate.Hibernate; import org.hibernate.Hibernate;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -48,7 +49,7 @@ public class AuctionTest extends BaseCoreFunctionalTestCase {
@Test @Test
@SuppressWarnings( {"unchecked"}) @SuppressWarnings( {"unchecked"})
@SkipForDialect( value = PostgreSQLDialect.class, comment = "doesn't like boolean=1" ) @SkipForDialect( value = PostgreSQL81Dialect.class, comment = "doesn't like boolean=1" )
public void testLazy() { public void testLazy() {
Session s = openSession(); Session s = openSession();
Transaction t = s.beginTransaction(); Transaction t = s.beginTransaction();

View File

@ -26,6 +26,7 @@ package org.hibernate.test.inheritancediscriminator;
import org.junit.Test; import org.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -33,7 +34,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
/** /**
* @author Pawel Stawicki * @author Pawel Stawicki
*/ */
@RequiresDialect( value = PostgreSQLDialect.class, jiraKey = "HHH-6580" ) @RequiresDialect( value = PostgreSQL81Dialect.class, jiraKey = "HHH-6580" )
public class PersistChildEntitiesWithDiscriminatorTest extends BaseCoreFunctionalTestCase { public class PersistChildEntitiesWithDiscriminatorTest extends BaseCoreFunctionalTestCase {
@Override @Override
protected Class<?>[] getAnnotatedClasses() { protected Class<?>[] getAnnotatedClasses() {

View File

@ -10,6 +10,7 @@ import org.junit.Test;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.dialect.Dialect; import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.id.PostInsertIdentifierGenerator; import org.hibernate.id.PostInsertIdentifierGenerator;
import org.hibernate.testing.DialectCheck; import org.hibernate.testing.DialectCheck;
@ -39,7 +40,7 @@ public class CustomSQLTest extends LegacyTestCase {
@Test @Test
@RequiresDialectFeature( NonIdentityGeneratorChecker.class ) @RequiresDialectFeature( NonIdentityGeneratorChecker.class )
@SkipForDialect( value = PostgreSQLDialect.class, jiraKey = "HHH-6704") @SkipForDialect( value = PostgreSQL81Dialect.class, jiraKey = "HHH-6704")
@SuppressWarnings( {"UnnecessaryBoxing"}) @SuppressWarnings( {"UnnecessaryBoxing"})
public void testInsert() throws HibernateException, SQLException { public void testInsert() throws HibernateException, SQLException {
Session s = openSession(); Session s = openSession();

View File

@ -34,6 +34,7 @@ import org.hibernate.cfg.DefaultNamingStrategy;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.dialect.DB2Dialect; import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.Dialect; import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory; import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory;
import org.hibernate.internal.util.StringHelper; import org.hibernate.internal.util.StringHelper;
@ -56,7 +57,7 @@ public abstract class LegacyTestCase extends BaseCoreFunctionalTestCase {
protected boolean supportsLockingNullableSideOfJoin(Dialect dialect) { protected boolean supportsLockingNullableSideOfJoin(Dialect dialect) {
// db2 and pgsql do *NOT* // db2 and pgsql do *NOT*
return ! ( DB2Dialect.class.isInstance( dialect ) || PostgreSQLDialect.class.isInstance( dialect ) ); return ! ( DB2Dialect.class.isInstance( dialect ) || PostgreSQL81Dialect.class.isInstance( dialect ) );
} }
protected static String extractFromSystem(String systemPropertyName) { protected static String extractFromSystem(String systemPropertyName) {

View File

@ -15,6 +15,7 @@ import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.dialect.HSQLDialect; import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.MySQLDialect; import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.TimesTenDialect; import org.hibernate.dialect.TimesTenDialect;
import org.hibernate.testing.FailureExpected; import org.hibernate.testing.FailureExpected;
@ -373,7 +374,7 @@ public class SQLLoaderTest extends LegacyTestCase {
} }
@Test @Test
@SkipForDialect( { HSQLDialect.class, PostgreSQLDialect.class } ) @SkipForDialect( { HSQLDialect.class, PostgreSQL81Dialect.class } )
public void testEscapedJDBC() throws HibernateException, SQLException { public void testEscapedJDBC() throws HibernateException, SQLException {
Session session = openSession(); Session session = openSession();
session.beginTransaction(); session.beginTransaction();

View File

@ -28,6 +28,7 @@ import org.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.TransactionException; import org.hibernate.TransactionException;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.test.jdbc.Person; import org.hibernate.test.jdbc.Person;
@ -42,7 +43,7 @@ import static org.junit.Assert.assertNotSame;
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
*/ */
@TestForIssue(jiraKey = "HHH-6780") @TestForIssue(jiraKey = "HHH-6780")
@SkipForDialect( value = PostgreSQLDialect.class, comment = "PostgreSQL jdbc driver doesn't impl timeout method") @SkipForDialect( value = PostgreSQL81Dialect.class, comment = "PostgreSQL jdbc driver doesn't impl timeout method")
public class TransactionTimeoutTest extends BaseCoreFunctionalTestCase { public class TransactionTimeoutTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { public String[] getMappings() {

View File

@ -28,6 +28,7 @@ import org.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.Dialect; import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
@ -69,7 +70,7 @@ public class TypeOverrideTest extends BaseCoreFunctionalTestCase {
getDialect().remapSqlTypeDescriptor( BlobTypeDescriptor.DEFAULT ) getDialect().remapSqlTypeDescriptor( BlobTypeDescriptor.DEFAULT )
); );
} }
else if ( PostgreSQLDialect.class.isInstance( getDialect() ) ) { else if ( PostgreSQL81Dialect.class.isInstance( getDialect() ) ) {
assertSame( assertSame(
BlobTypeDescriptor.BLOB_BINDING, BlobTypeDescriptor.BLOB_BINDING,
getDialect().remapSqlTypeDescriptor( BlobTypeDescriptor.DEFAULT ) getDialect().remapSqlTypeDescriptor( BlobTypeDescriptor.DEFAULT )