Skip to content

Commit e2a1434

Browse files
VladoKurucbeikov
authored andcommitted
Informix tests fixes
1 parent 7ffd991 commit e2a1434

File tree

19 files changed

+55
-8
lines changed

19 files changed

+55
-8
lines changed

docker_db.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,11 @@ informix() {
908908
}
909909

910910
informix_14_10() {
911+
temp_dir=$(mktemp -d)
912+
echo "ALLOW_NEWLINE 1" >$temp_dir/onconfig.mod
913+
chmod 777 -R $temp_dir
911914
$PRIVILEGED_CLI $CONTAINER_CLI rm -f informix || true
912-
$PRIVILEGED_CLI $CONTAINER_CLI run --name informix --privileged -p 9088:9088 -e LICENSE=accept -e GL_USEGLU=1 -d ${DB_IMAGE_INFORMIX_14_10:-icr.io/informix/informix-developer-database:14.10.FC9W1DE}
915+
$PRIVILEGED_CLI $CONTAINER_CLI run --name informix --privileged -p 9088:9088 -v $temp_dir:/opt/ibm/config -e LICENSE=accept -e GL_USEGLU=1 -d ${DB_IMAGE_INFORMIX_14_10:-icr.io/informix/informix-developer-database:14.10.FC9W1DE}
913916
echo "Starting Informix. This can take a few minutes"
914917
# Give the container some time to start
915918
OUTPUT=

gradle/databases.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ ext {
295295
'jdbc.driver': 'com.informix.jdbc.IfxDriver',
296296
'jdbc.user' : 'informix',
297297
'jdbc.pass' : 'in4mix',
298-
'jdbc.url' : 'jdbc:informix-sqli://' + dbHost + ':9088/dev:INFORMIXSERVER=informix;user=informix;password=in4mix;DELIMIDENT=Y;DB_LOCALE=en_US.utf8',
298+
'jdbc.url' : 'jdbc:informix-sqli://' + dbHost + ':9088/dev:INFORMIXSERVER=informix;user=informix;password=in4mix;DBDATE=Y4MD-;DELIMIDENT=Y;DB_LOCALE=en_US.utf8',
299299
'jdbc.datasource' : 'com.informix.jdbc.IfxDriver',
300300
// 'jdbc.datasource' : 'com.informix.jdbcx.IfxDataSource',
301301
'connection.init_sql' : ''

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/entity/Forest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.hibernate.annotations.ParamDef;
2020
import org.hibernate.annotations.SQLRestriction;
2121

22+
import jakarta.persistence.Column;
2223
import jakarta.persistence.Convert;
2324
import jakarta.persistence.ElementCollection;
2425
import jakarta.persistence.Entity;
@@ -54,6 +55,7 @@ public class Forest {
5455

5556
@OptimisticLock(excluded=true)
5657
@JdbcTypeCode( Types.LONGVARCHAR )
58+
@Column(length = 10000)
5759
public String getLongDescription() {
5860
return longDescription;
5961
}

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/uniqueconstraint/UniqueConstraintTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package org.hibernate.orm.test.annotations.uniqueconstraint;
66

77
import org.hibernate.JDBCException;
8+
import org.hibernate.community.dialect.InformixDialect;
89
import org.hibernate.dialect.SybaseDialect;
910

1011
import org.hibernate.testing.orm.junit.DomainModel;
@@ -25,6 +26,9 @@
2526
*/
2627
@DomainModel( annotatedClasses = { Room.class, Building.class, House.class } )
2728
@SessionFactory
29+
@SkipForDialect( dialectClass = InformixDialect.class,
30+
matchSubTypes = true,
31+
reason = "Informix does not properly support unique constraints on nullable columns" )
2832
@SkipForDialect( dialectClass = SybaseDialect.class,
2933
matchSubTypes = true,
3034
reason = "Sybase does not properly support unique constraints on nullable columns" )

hibernate-core/src/test/java/org/hibernate/orm/test/hql/HQLTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.hibernate.ScrollableResults;
2424
import org.hibernate.Session;
2525
import org.hibernate.community.dialect.FirebirdDialect;
26+
import org.hibernate.community.dialect.InformixDialect;
2627
import org.hibernate.dialect.CockroachDialect;
2728
import org.hibernate.community.dialect.DerbyDialect;
2829
import org.hibernate.dialect.H2Dialect;
@@ -1521,6 +1522,7 @@ public void test_hql_aggregate_functions_filter_example() {
15211522
@SkipForDialect(dialectClass = DerbyDialect.class)
15221523
@SkipForDialect(dialectClass = SybaseASEDialect.class)
15231524
@SkipForDialect(dialectClass = FirebirdDialect.class, reason = "order by not supported in list")
1525+
@SkipForDialect(dialectClass = InformixDialect.class)
15241526
public void test_hql_aggregate_functions_within_group_example() {
15251527
doInJPA(this::entityManagerFactory, entityManager -> {
15261528
//tag::hql-aggregate-functions-within-group-example[]

hibernate-core/src/test/java/org/hibernate/orm/test/id/array/PrimitiveByteArrayIdTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import jakarta.persistence.Id;
1212
import jakarta.persistence.Table;
1313

14+
import org.hibernate.community.dialect.InformixDialect;
1415
import org.hibernate.dialect.MySQLDialect;
1516
import org.hibernate.dialect.OracleDialect;
1617
import org.hibernate.query.Query;
@@ -33,6 +34,7 @@
3334
*/
3435
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 5, reason = "BLOB/TEXT column 'id' used in key specification without a key length")
3536
@SkipForDialect(dialectClass = OracleDialect.class, matchSubTypes = true, reason = "ORA-02329: column of datatype LOB cannot be unique or a primary key")
37+
@SkipForDialect(dialectClass = InformixDialect.class, reason = "Informix does not support unique / primary constraints on binary columns")
3638
@DomainModel(
3739
annotatedClasses = PrimitiveByteArrayIdTest.DemoEntity.class
3840
)

hibernate-core/src/test/java/org/hibernate/orm/test/id/uuid/sqlrep/sqlbinary/UUIDBinaryTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.UUID;
99

1010
import org.hibernate.annotations.JdbcTypeCode;
11+
import org.hibernate.community.dialect.InformixDialect;
1112
import org.hibernate.dialect.PostgreSQLDialect;
1213
import org.hibernate.dialect.SybaseDialect;
1314
import org.hibernate.metamodel.MappingMetamodel;
@@ -37,6 +38,7 @@
3738
@SkipForDialect(dialectClass = PostgreSQLDialect.class, reason = "Postgres has its own UUID type")
3839
@SkipForDialect( dialectClass = SybaseDialect.class, matchSubTypes = true,
3940
reason = "Skipped for Sybase to avoid problems with UUIDs potentially ending with a trailing 0 byte")
41+
@SkipForDialect(dialectClass = InformixDialect.class, reason = "Informix does not support unique / primary constraints on binary columns")
4042
public class UUIDBinaryTest {
4143

4244
private static class UUIDPair {

hibernate-core/src/test/java/org/hibernate/orm/test/inheritance/InheritanceQueryGroupByTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
package org.hibernate.orm.test.inheritance;
66

7+
import org.hibernate.community.dialect.InformixDialect;
78
import org.hibernate.dialect.Dialect;
89
import org.hibernate.dialect.FunctionalDependencyAnalysisSupport;
910
import org.hibernate.metamodel.mapping.EntityMappingType;
@@ -14,6 +15,7 @@
1415
import org.hibernate.testing.orm.junit.Jira;
1516
import org.hibernate.testing.orm.junit.SessionFactory;
1617
import org.hibernate.testing.orm.junit.SessionFactoryScope;
18+
import org.hibernate.testing.orm.junit.SkipForDialect;
1719
import org.junit.jupiter.api.AfterAll;
1820
import org.junit.jupiter.api.BeforeAll;
1921
import org.junit.jupiter.api.Test;
@@ -84,6 +86,7 @@ public void testGroupBySingleTable(SessionFactoryScope scope) {
8486
}
8587

8688
@Test
89+
@SkipForDialect( dialectClass = InformixDialect.class , reason = "Informix does not support case expressions within the GROUP BY clause")
8790
public void testGroupByJoined(SessionFactoryScope scope) {
8891
testGroupBy( scope, "joinedParent", JoinedParent.class, "joined_child_one", 1 );
8992
}
@@ -160,6 +163,7 @@ public void testGroupByAndOrderBySingleTable(SessionFactoryScope scope) {
160163
}
161164

162165
@Test
166+
@SkipForDialect( dialectClass = InformixDialect.class , reason = "Informix does not support case expressions within the GROUP BY clause")
163167
public void testGroupByAndOrderByJoined(SessionFactoryScope scope) {
164168
testGroupByAndOrderBy( scope, "joinedParent", JoinedParent.class, "joined_child_one", 1 );
165169
}

hibernate-core/src/test/java/org/hibernate/orm/test/jpa/criteria/QueryBuilderTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import jakarta.persistence.criteria.SetJoin;
1919
import jakarta.persistence.metamodel.EntityType;
2020
import jakarta.persistence.metamodel.Metamodel;
21+
22+
import org.hibernate.community.dialect.InformixDialect;
2123
import org.hibernate.dialect.CockroachDialect;
2224
import org.hibernate.orm.test.jpa.BaseEntityManagerFunctionalTestCase;
2325
import org.hibernate.orm.test.jpa.metamodel.Address;
@@ -36,8 +38,8 @@
3638
import org.hibernate.query.sqm.tree.predicate.SqmComparisonPredicate;
3739

3840
import org.hibernate.testing.FailureExpected;
39-
import org.hibernate.testing.SkipForDialect;
4041
import org.hibernate.testing.orm.junit.JiraKey;
42+
import org.hibernate.testing.orm.junit.SkipForDialect;
4143
import org.junit.Test;
4244

4345
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
@@ -227,7 +229,7 @@ public void testMultiselectWithPredicates() {
227229
}
228230

229231
@Test
230-
@SkipForDialect(value = CockroachDialect.class, strictMatching = true)
232+
@SkipForDialect(dialectClass = CockroachDialect.class)
231233
public void testDateTimeFunctions() {
232234
EntityManager em = getOrCreateEntityManager();
233235
em.getTransaction().begin();
@@ -253,6 +255,7 @@ public void testDateTimeFunctions() {
253255
}
254256

255257
@Test
258+
@SkipForDialect(dialectClass = InformixDialect.class, majorVersion = 11, minorVersion = 70, reason = "Informix does not support count literals")
256259
public void testFunctionDialectFunctions() {
257260
EntityManager em = getOrCreateEntityManager();
258261
em.getTransaction().begin();

hibernate-core/src/test/java/org/hibernate/orm/test/length/LengthTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@
55
package org.hibernate.orm.test.length;
66

77
import org.hibernate.Length;
8+
import org.hibernate.community.dialect.InformixDialect;
89
import org.hibernate.dialect.Dialect;
910
import org.hibernate.metamodel.mapping.BasicValuedMapping;
1011
import org.hibernate.type.SqlTypes;
1112

1213
import org.hibernate.testing.orm.junit.DomainModel;
1314
import org.hibernate.testing.orm.junit.SessionFactory;
1415
import org.hibernate.testing.orm.junit.SessionFactoryScope;
16+
import org.hibernate.testing.orm.junit.SkipForDialect;
1517
import org.junit.jupiter.api.Test;
1618

1719
import static org.junit.Assert.assertEquals;
1820

1921
@SessionFactory
2022
@DomainModel(annotatedClasses = {WithLongStrings.class,WithLongTypeStrings.class})
23+
@SkipForDialect(dialectClass = InformixDialect.class, reason = "Informix rowsize to exceed the allowable limit (32767).")
2124
public class LengthTest {
2225
@Test
2326
public void testLength(SessionFactoryScope scope) {

0 commit comments

Comments
 (0)