@@ -650,9 +650,6 @@ public void test03_Dates() throws SQLException {
650
650
651
651
@ Test
652
652
public void test04_Timestamps () throws SQLException {
653
- assumeFalse (
654
- "Timestamp type is not supported on POSTGRESQL dialect" ,
655
- dialect .dialect == Dialect .POSTGRESQL );
656
653
List <String > expectedValues = new ArrayList <>();
657
654
expectedValues .add ("2008-01-01 10:00:00" );
658
655
expectedValues .add ("2000-01-01 00:00:00" );
@@ -711,8 +708,16 @@ public void test04_Timestamps() throws SQLException {
711
708
Types .TIMESTAMP ,
712
709
Types .TIMESTAMP ,
713
710
Types .ARRAY ),
714
- ImmutableList .of (
715
- "INT64" , "INT64" , "DATE" , "TIMESTAMP" , "TIMESTAMP" , "ARRAY<INT64>" ),
711
+ dialect .dialect == Dialect .POSTGRESQL
712
+ ? ImmutableList .of (
713
+ "bigint" ,
714
+ "bigint" ,
715
+ "date" ,
716
+ "timestamp with time zone" ,
717
+ "timestamp with time zone" ,
718
+ "bigint[]" )
719
+ : ImmutableList .of (
720
+ "INT64" , "INT64" , "DATE" , "TIMESTAMP" , "TIMESTAMP" , "ARRAY<INT64>" ),
716
721
ImmutableList .of (
717
722
Long .class ,
718
723
Long .class ,
@@ -743,10 +748,7 @@ public void test04_Timestamps() throws SQLException {
743
748
Timestamp inDefaultTZ = rs .getTimestamp (4 );
744
749
assertEquals (testTimestamp .getTime (), inDefaultTZ .getTime ());
745
750
// Then get it in the test timezone.
746
- if (testCalendar != null
747
- && !System .getProperty ("java.vm.name" , "" ).toLowerCase ().contains ("graalvm" )
748
- && !System .getProperty ("java.vendor" , "" ).toLowerCase ().contains ("graalvm" )
749
- && !System .getProperty ("java.vendor" , "" ).toLowerCase ().contains ("oracle" )) {
751
+ if (testCalendar != null ) {
750
752
Timestamp inOtherTZ = rs .getTimestamp (4 , testCalendar );
751
753
assertEquals (
752
754
"Timezone: "
@@ -759,7 +761,8 @@ public void test04_Timestamps() throws SQLException {
759
761
+ System .getProperty ("java.vm.name" )
760
762
+ ", vendor="
761
763
+ System .getProperty ("java.vendor" ),
762
- testTimestamp .getTime () + testCalendar .getTimeZone ().getRawOffset (),
764
+ testTimestamp .getTime ()
765
+ + testCalendar .getTimeZone ().getOffset (inDefaultTZ .getTime ()),
763
766
inOtherTZ .getTime ());
764
767
}
765
768
@@ -768,9 +771,7 @@ public void test04_Timestamps() throws SQLException {
768
771
inDefaultTZ = rs .getTimestamp (5 );
769
772
if (testCalendar == null ) {
770
773
assertEquals (testTimestamp .getTime (), inDefaultTZ .getTime ());
771
- } else if (!System .getProperty ("java.vm.name" , "" ).toLowerCase ().contains ("graalvm" )
772
- && !System .getProperty ("java.vendor" , "" ).toLowerCase ().contains ("graalvm" )
773
- && !System .getProperty ("java.vendor" , "" ).toLowerCase ().contains ("oracle" )) {
774
+ } else {
774
775
assertEquals (
775
776
"Timezone: "
776
777
+ testCalendar
@@ -782,7 +783,8 @@ public void test04_Timestamps() throws SQLException {
782
783
+ System .getProperty ("java.vm.name" )
783
784
+ ", vendor="
784
785
+ System .getProperty ("java.vendor" ),
785
- testTimestamp .getTime () - testCalendar .getTimeZone ().getRawOffset (),
786
+ testTimestamp .getTime ()
787
+ - testCalendar .getTimeZone ().getOffset (inDefaultTZ .getTime ()),
786
788
inDefaultTZ .getTime ());
787
789
}
788
790
// Then get it in the test timezone.
0 commit comments