|
19 | 19 | import org.hibernate.boot.registry.StandardServiceRegistry;
|
20 | 20 | import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
|
21 | 21 | import org.hibernate.cfg.AvailableSettings;
|
22 |
| -import org.hibernate.community.dialect.AltibaseDialect; |
23 |
| -import org.hibernate.community.dialect.FirebirdDialect; |
24 |
| -import org.hibernate.community.dialect.InformixDialect; |
25 |
| -import org.hibernate.dialect.HANADialect; |
26 | 22 | import org.hibernate.dialect.CockroachDialect;
|
27 |
| -import org.hibernate.dialect.DB2Dialect; |
28 |
| -import org.hibernate.community.dialect.DerbyDialect; |
29 |
| -import org.hibernate.dialect.H2Dialect; |
30 |
| -import org.hibernate.dialect.HSQLDialect; |
31 | 23 | import org.hibernate.dialect.MariaDBDialect;
|
32 | 24 | import org.hibernate.dialect.MySQLDialect;
|
33 |
| -import org.hibernate.dialect.OracleDialect; |
| 25 | +import org.hibernate.dialect.PostgreSQLDialect; |
34 | 26 | import org.hibernate.dialect.PostgresPlusDialect;
|
35 | 27 | import org.hibernate.dialect.SQLServerDialect;
|
36 |
| -import org.hibernate.dialect.SybaseDialect; |
37 | 28 | import org.hibernate.community.dialect.TiDBDialect;
|
| 29 | +import org.hibernate.testing.orm.junit.RequiresDialect; |
38 | 30 | import org.hibernate.type.NumericBooleanConverter;
|
39 | 31 | import org.hibernate.type.YesNoConverter;
|
40 | 32 |
|
@@ -92,21 +84,9 @@ public void testYesNo(BiConsumer<SessionFactoryScope, Consumer<? extends SharedS
|
92 | 84 |
|
93 | 85 | @ParameterizedTest
|
94 | 86 | @MethodSource("transactionKind")
|
95 |
| - @SkipForDialect(dialectClass = H2Dialect.class, reason = "H2 silently converts a boolean to string types") |
96 |
| - @SkipForDialect(dialectClass = HSQLDialect.class, reason = "HSQL silently converts a boolean to string types") |
97 |
| - @SkipForDialect(dialectClass = DerbyDialect.class, reason = "Derby silently converts a boolean to string types") |
98 |
| - @SkipForDialect(dialectClass = DB2Dialect.class, reason = "DB2 silently converts a boolean to string types") |
99 |
| - @SkipForDialect(dialectClass = MySQLDialect.class, reason = "MySQL silently converts a boolean to string types") |
100 |
| - @SkipForDialect(dialectClass = MariaDBDialect.class, reason = "MariaDB silently converts a boolean to string types") |
101 |
| - @SkipForDialect(dialectClass = TiDBDialect.class, reason = "TiDB silently converts a boolean to string types") |
102 |
| - @SkipForDialect(dialectClass = SybaseDialect.class, matchSubTypes = true, reason = "Sybase silently converts a boolean to string types") |
103 |
| - @SkipForDialect(dialectClass = HANADialect.class, matchSubTypes = true, reason = "HANA silently converts a boolean to string types") |
104 |
| - @SkipForDialect(dialectClass = CockroachDialect.class, matchSubTypes = true, reason = "Cockroach silently converts a boolean to string types") |
105 |
| - @SkipForDialect(dialectClass = PostgresPlusDialect.class, reason = "PostgresPlus silently converts a boolean to string types") |
106 |
| - @SkipForDialect(dialectClass = FirebirdDialect.class, reason = "Firebird silently converts a boolean to string") |
107 |
| - @SkipForDialect(dialectClass = AltibaseDialect.class, reason = "Altibase silently converts a boolean to string") |
108 |
| - @SkipForDialect(dialectClass = OracleDialect.class, majorVersion = 23, reason = "Oracle 23 interprets Y and T as true and N and F as false, so this works") |
109 |
| - @SkipForDialect(dialectClass = InformixDialect.class) |
| 87 | + // most dialects silently convert boolean to string types |
| 88 | + @RequiresDialect(SQLServerDialect.class) |
| 89 | + @RequiresDialect(value = PostgreSQLDialect.class, matchSubTypes = false) |
110 | 90 | public void testYesNoMismatch(BiConsumer<SessionFactoryScope, Consumer<? extends SharedSessionContract>> inTransaction) {
|
111 | 91 | scope.inTransaction( (session) -> {
|
112 | 92 | session.disableFilter( "subDepartmentFilter" );
|
@@ -147,20 +127,9 @@ public void testNumeric(BiConsumer<SessionFactoryScope, Consumer<? extends Share
|
147 | 127 |
|
148 | 128 | @ParameterizedTest
|
149 | 129 | @MethodSource("transactionKind")
|
150 |
| - @SkipForDialect(dialectClass = H2Dialect.class, reason = "H2 silently converts a boolean to integral types") |
151 |
| - @SkipForDialect(dialectClass = OracleDialect.class, reason = "Oracle silently converts a boolean to integral types") |
152 |
| - @SkipForDialect(dialectClass = HSQLDialect.class, reason = "HSQL silently converts a boolean to integral types") |
153 |
| - @SkipForDialect(dialectClass = DerbyDialect.class, reason = "Derby silently converts a boolean to integral types") |
154 |
| - @SkipForDialect(dialectClass = DB2Dialect.class, reason = "DB2 silently converts a boolean to integral types") |
155 |
| - @SkipForDialect(dialectClass = MySQLDialect.class, reason = "MySQL silently converts a boolean to integral types") |
156 |
| - @SkipForDialect(dialectClass = MariaDBDialect.class, reason = "MariaDB silently converts a boolean to integral types") |
157 |
| - @SkipForDialect(dialectClass = TiDBDialect.class, reason = "TiDB silently converts a boolean to integral types") |
158 |
| - @SkipForDialect(dialectClass = SQLServerDialect.class, reason = "SQL Server silently converts a boolean to integral types") |
159 |
| - @SkipForDialect(dialectClass = AltibaseDialect.class, reason = "Altibase silently converts a boolean to integral types") |
160 |
| - @SkipForDialect(dialectClass = SybaseDialect.class, matchSubTypes = true, reason = "Sybase silently converts a boolean to integral types") |
161 |
| - @SkipForDialect(dialectClass = HANADialect.class, matchSubTypes = true, reason = "HANA silently converts a boolean to integral types") |
162 |
| - @SkipForDialect(dialectClass = FirebirdDialect.class, matchSubTypes = true, reason = "Firebird silently converts a boolean to integral types") |
163 |
| - @SkipForDialect(dialectClass = InformixDialect.class) |
| 130 | + // most dialects silently convert boolean to integral types |
| 131 | + @RequiresDialect(PostgreSQLDialect.class) |
| 132 | + @RequiresDialect(CockroachDialect.class) |
164 | 133 | public void testNumericMismatch(BiConsumer<SessionFactoryScope, Consumer<? extends SharedSessionContract>> inTransaction) {
|
165 | 134 | scope.inTransaction( (session) -> {
|
166 | 135 | session.disableFilter( "subDepartmentFilter" );
|
|
0 commit comments