Skip to content

Commit 2329188

Browse files
Toby Hammettjrenaat
authored andcommitted
HHH-14256 - Add test cases
1 parent ebd7a9e commit 2329188

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/type/InstantTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public static List<Object[]> data() {
105105
.add( 1904, 12, 31, 23, 0, 0, 0, ZONE_PARIS )
106106
.add( 1905, 1, 1, 0, 0, 0, 0, ZONE_PARIS )
107107
.add( 1905, 1, 1, 1, 0, 0, 0, ZONE_PARIS )
108+
// => HHH-14256: Instants with negative years
109+
.add(-1, 1, 1, 0, 0, 0, 0, ZoneId.of("UTC"))
108110
.build();
109111
}
110112

hibernate-core/src/test/java/org/hibernate/orm/test/type/LocalDateTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ public static List<Object[]> data() {
8787
.add( 2018, 3, 25, ZONE_PARIS )
8888
.add( 2018, 9, 30, ZONE_AUCKLAND )
8989
.add( 2018, 8, 12, ZONE_SANTIAGO ) // DST start: 00:00 => 01:00
90+
// => HHH-14256: Dates with negative years
91+
.add(-1, 1, 1, ZONE_PARIS)
9092
.build();
9193
}
9294

hibernate-core/src/test/java/org/hibernate/orm/test/type/LocalDateTimeTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ public static List<Object[]> data() {
9898
// This does not work, but it's unrelated to HHH-13379; see HHH-13515
9999
//.add( 2018, 9, 30, 2, 0, 0, 0, ZONE_AUCKLAND )
100100
.add( 2018, 9, 30, 3, 0, 0, 0, ZONE_AUCKLAND )
101+
// => HHH-14256: Dates with negative years
102+
.add( -1, 1, 1, 0, 0, 0, 0, ZONE_PARIS )
101103
.build();
102104
}
103105

hibernate-core/src/test/java/org/hibernate/orm/test/type/OffsetDateTimeTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ public static List<Object[]> data() {
138138
.add( 1905, 1, 1, 0, 0, 0, 0, "-01:00", ZONE_PARIS )
139139
.add( 1905, 1, 1, 0, 0, 0, 0, "+00:00", ZONE_PARIS )
140140
.add( 1905, 1, 1, 0, 0, 0, 0, "+01:00", ZONE_PARIS )
141+
// => HHH-14256: Dates with negative years
142+
.add(-1, 1, 1, 0, 0, 0, 0, "+00:00", ZONE_PARIS)
141143
.build();
142144
}
143145

hibernate-core/src/test/java/org/hibernate/orm/test/type/ZonedDateTimeTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ public static List<Object[]> data() {
150150
.add( 1905, 1, 1, 0, 0, 0, 0, "-01:00", ZONE_PARIS )
151151
.add( 1905, 1, 1, 0, 0, 0, 0, "+00:00", ZONE_PARIS )
152152
.add( 1905, 1, 1, 0, 0, 0, 0, "+01:00", ZONE_PARIS )
153+
// => HHH-14256: Dates with negative years
154+
.add(-1, 1, 1, 0, 0, 0, 0, "+00:00", ZONE_PARIS)
153155
.build();
154156
}
155157

0 commit comments

Comments
 (0)