Skip to content

Commit 453975b

Browse files
HHH-15070 - enable stacktrace output in ci testing to troubleshoot the broken Oracle testing case
1 parent 2cb1134 commit 453975b

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

Diff for: hibernate-core/hibernate-core.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,10 @@ tasks.withType( Test.class ).each { test ->
213213
}
214214
}
215215

216+
test {
217+
testLogging {
218+
events "failed"
219+
exceptionFormat "full"
220+
}
221+
}
222+

Diff for: hibernate-core/src/main/java/org/hibernate/query/results/complete/CompleteResultBuilderBasicValuedStandard.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public boolean equals(Object o) {
173173
public int hashCode() {
174174
int result = explicitColumnName != null ? explicitColumnName.hashCode() : 0;
175175
result = 31 * result + ( explicitType != null ? explicitType.hashCode() : 0 );
176-
result = 31 * result + explicitJavaType.hashCode();
176+
result = 31 * result + ( explicitJavaType != null ? explicitJavaType.hashCode() : 0 );
177177
return result;
178178
}
179179
}

Diff for: hibernate-core/src/test/java/org/hibernate/orm/test/query/resultmapping/NamedNativeQueryTest.java renamed to hibernate-core/src/test/java/org/hibernate/orm/test/query/resultmapping/NamedNativeQueryWithCountColumnTest.java

+4-12
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@
1212
import org.hibernate.testing.orm.junit.EntityManagerFactoryScope;
1313
import org.hibernate.testing.orm.junit.Jpa;
1414
import org.hibernate.testing.orm.junit.Setting;
15-
import org.junit.jupiter.api.Assertions;
1615
import org.junit.jupiter.api.Test;
1716

1817
import jakarta.persistence.ColumnResult;
1918
import jakarta.persistence.Entity;
20-
import jakarta.persistence.GeneratedValue;
2119
import jakarta.persistence.Id;
2220
import jakarta.persistence.NamedNativeQuery;
2321
import jakarta.persistence.SqlResultSetMapping;
@@ -26,20 +24,15 @@
2624
* @author Nathan Xu
2725
*/
2826
@Jpa(
29-
annotatedClasses = NamedNativeQueryTest.Sample.class,
27+
annotatedClasses = NamedNativeQueryWithCountColumnTest.Sample.class,
3028
properties = @Setting(name = AvailableSettings.GLOBALLY_QUOTED_IDENTIFIERS, value = "true")
3129
)
3230
@TestForIssue(jiraKey = "HHH-15070")
33-
class NamedNativeQueryTest {
31+
class NamedNativeQueryWithCountColumnTest {
3432

3533
@Test
36-
void test(EntityManagerFactoryScope scope) {
37-
scope.inTransaction( em ->
38-
Assertions.assertDoesNotThrow(
39-
() -> em.createNamedQuery( "sample.count", Long.class ),
40-
"without fixing, NullPointerException would be thrown"
41-
)
42-
);
34+
void testNoNullPointerExceptionThrown(EntityManagerFactoryScope scope) {
35+
scope.inTransaction( em ->em.createNamedQuery( "sample.count", Long.class ) );
4336
}
4437

4538
@SqlResultSetMapping(
@@ -55,7 +48,6 @@ void test(EntityManagerFactoryScope scope) {
5548
static class Sample {
5649

5750
@Id
58-
@GeneratedValue
5951
Long id;
6052

6153
}

0 commit comments

Comments
 (0)