Skip to content

Commit 96bf76d

Browse files
committed
[#1550] Disable tests causing ClassCastException for Db2
This seems a bug in the D2 Vert.x Client
1 parent 312a926 commit 96bf76d

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/FilterWithPaginationTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,28 @@
2020
import org.hibernate.annotations.ParamDef;
2121
import org.hibernate.reactive.mutiny.Mutiny;
2222
import org.hibernate.reactive.stage.Stage;
23+
import org.hibernate.reactive.testing.DatabaseSelectionRule;
2324
import org.hibernate.type.descriptor.java.StringJavaType;
2425
import org.junit.Before;
26+
import org.junit.Rule;
2527
import org.junit.Test;
2628

2729
import io.smallrye.mutiny.Uni;
2830
import io.vertx.ext.unit.TestContext;
2931

3032
import static org.assertj.core.api.Assertions.assertThat;
33+
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.DB2;
34+
import static org.hibernate.reactive.testing.DatabaseSelectionRule.skipTestsFor;
3135

3236
/**
3337
* Test the combination of filters, max results and first result.
3438
*/
3539
public class FilterWithPaginationTest extends BaseReactiveTest {
3640

41+
// Db2: java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Long
42+
@Rule
43+
public final DatabaseSelectionRule skipDb2 = skipTestsFor( DB2 );
44+
3745
FamousPerson margaret = new FamousPerson( 1L, "Margaret Howe Lovatt", Status.LIVING, "the woman who lived in a half-flooded home with a dolphin." );
3846
FamousPerson nellie = new FamousPerson( 2L, "Nellie Bly", Status.DECEASED, "In 1888, she traveled around the world in 72 days." );
3947
FamousPerson hedy = new FamousPerson( 3L, "Hedy Lamarr", Status.DECEASED, "Actress and co-inventor of an early version of frequency-hopping spread spectrum communication for torpedo guidance." );

hibernate-reactive-core/src/test/java/org/hibernate/reactive/HQLQueryParameterNamedLimitTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,31 @@
99
import java.util.List;
1010
import java.util.Objects;
1111

12+
import org.hibernate.reactive.testing.DatabaseSelectionRule;
13+
1214
import org.junit.Before;
15+
import org.junit.Rule;
1316
import org.junit.Test;
1417

1518
import io.vertx.ext.unit.TestContext;
1619
import jakarta.persistence.Entity;
1720
import jakarta.persistence.Id;
1821
import jakarta.persistence.Table;
1922

23+
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.DB2;
24+
import static org.hibernate.reactive.testing.DatabaseSelectionRule.skipTestsFor;
25+
2026

2127
/**
2228
* Tests queries using named parameters like ":name",
2329
* as defined by the JPA specification, along with limit parameters
2430
*/
2531
public class HQLQueryParameterNamedLimitTest extends BaseReactiveTest {
2632

33+
// Db2: java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Long
34+
@Rule
35+
public DatabaseSelectionRule skip = skipTestsFor( DB2 );
36+
2737
Flour spelt = new Flour( 1, "Spelt", "An ancient grain, is a hexaploid species of wheat.", "Wheat flour" );
2838
Flour rye = new Flour( 2, "Rye", "Used to bake the traditional sourdough breads of Germany.", "Wheat flour" );
2939
Flour almond = new Flour( 3, "Almond", "made from ground almonds.", "Gluten free" );

hibernate-reactive-core/src/test/java/org/hibernate/reactive/HQLQueryParameterPositionalLimitTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@
99
import java.util.List;
1010
import java.util.Objects;
1111

12+
import org.hibernate.reactive.testing.DatabaseSelectionRule;
13+
1214
import org.junit.Before;
15+
import org.junit.Rule;
1316
import org.junit.Test;
1417

1518
import io.vertx.ext.unit.TestContext;
1619
import jakarta.persistence.Entity;
1720
import jakarta.persistence.Id;
1821
import jakarta.persistence.Table;
1922

23+
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.DB2;
24+
import static org.hibernate.reactive.testing.DatabaseSelectionRule.skipTestsFor;
25+
2026

2127
/**
2228
* Tests queries using positional parameters like "?1, ?2, ...",
@@ -27,6 +33,10 @@
2733
*/
2834
public class HQLQueryParameterPositionalLimitTest extends BaseReactiveTest {
2935

36+
// Db2: Parameter at position[0] with class = [java.lang.Integer] and value = [1] can not be coerced to the expected class = [java.lang.Double] for encoding.
37+
@Rule
38+
public DatabaseSelectionRule skip = skipTestsFor( DB2 );
39+
3040
Flour spelt = new Flour( 1, "Spelt", "An ancient grain, is a hexaploid species of wheat.", "Wheat flour" );
3141
Flour rye = new Flour( 2, "Rye", "Used to bake the traditional sourdough breads of Germany.", "Wheat flour" );
3242
Flour almond = new Flour( 3, "Almond", "made from ground almonds.", "Gluten free" );

0 commit comments

Comments
 (0)