Open homebeaver opened 2 years ago
war bereits issue 618!!!
/**
* Issue #618-swingx: JXMonthView displays problems with non-default
* timezones.
*
* Here: test that the first displayed date is offset by offset diff of
* timezones. Configure the monthView with a fixed timezone to clear up the
* mist ...
*
* This did fail on the server on 31mar2008, us/pacific timezone, en_US
* locale. Trying to sim the context then.
*
* Failed again at Tue Sep 30 10:12:31 PDT 2008, en_US locale. Next
* (testTimeZoneChangeOffsetFirstDisplayedDate) failed at the same time,
*/
@Test
public void testTimeZoneChangeToday() {
...
String server = "server locale: " + Locale.getDefault()
+ "\n server timezone: " + localCal.getTimeZone()
+ "\n server local time: " + localCal.getTime();
String timeZones = "first timeZone " + tz
+ "\n first timezone offset / min " + oldOffset / (1000 * 60)
+ "\n second timezone " + tzOther
+ "\n second timezone offset / min " + newOffset / (1000 * 60);
String monthViewProps = "monthView locale: " + monthView.getLocale()
+ "\n monthView anchor " + anchor
+ "\n monthView firstDisplayed " + monthView.getFirstDisplayedDay();
LOG.info("\n "+server + "\n "+timeZones + "\n "+monthViewProps); // print exected
assertEquals( // JXMonthViewTest.java:2042
"first displayed must be offset by real offset "
+ "\n ********** spurious failure - so try extensiv debug output:"
+ "\n " + server
+ "\n " + timeZones
+ "\n " + monthViewProps,
(realOffset) / (1000 * 60),
(monthView.getFirstDisplayedDay().getTime() - firstDisplayed.getTime()) / (1000 * 60));
monthView anchor Tue Nov 30 20:42:59 CET 2021 // is monthView anchor Tue Nov 30 20:52:25 CET 2021 // expected
siehe https://github.com/homebeaver/SwingSet3/actions/runs/1522343606
Error: Tests run: 144, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 2.312 s <<< FAILURE! - in org.jdesktop.swingx.JXMonthViewTest Error: testTimeZoneChangeOffsetFirstDisplayedDate(org.jdesktop.swingx.JXMonthViewTest) Time elapsed: 0.006 s <<< FAILURE! junit.framework.AssertionFailedError: first displayed must be offset by real offset expected:<-10800000> but was:<2581200000> at org.jdesktop.swingx.JXMonthViewTest.testTimeZoneChangeOffsetFirstDisplayedDate(JXMonthViewTest.java:2126)
Error: testTimeZoneChangeToday(org.jdesktop.swingx.JXMonthViewTest) Time elapsed: 0.026 s <<< FAILURE! junit.framework.AssertionFailedError:
first displayed must be offset by real offset
********** spurious failure - so try extensiv debug output:
server locale: en
server timezone: sun.util.calendar.ZoneInfo[id="Etc/UTC",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
server local time: Tue Nov 30 18:29:35 UTC 2021
first timeZone sun.util.calendar.ZoneInfo[id="GMT+04:00",offset=14400000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
first timezone offset / min 240
second timezone sun.util.calendar.ZoneInfo[id="GMT+07:00",offset=25200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
second timezone offset / min 420
monthView locale: en
monthView anchor Tue Nov 30 18:29:35 UTC 2021
monthView firstDisplayed Tue Nov 30 17:00:00 UTC 2021 expected:<-180> but was:<43020>
at org.jdesktop.swingx.JXMonthViewTest.testTimeZoneChangeToday(JXMonthViewTest.java:2042)
testTimeZoneChangeOffsetFirstDisplayedDate
siehe https://github.com/homebeaver/SwingSet3/actions/runs/1522343606
Error: Failures: Error: JXMonthViewTest.testTimeZoneChangeOffsetFirstDisplayedDate:2126 first displayed must be offset by real offset expected:<-10800000> but was:<2581200000> Error: JXMonthViewTest.testTimeZoneChangeToday:2042 first displayed must be offset by real offset ** spurious failure - so try extensiv debug output: server locale: en server timezone: sun.util.calendar.ZoneInfo[id="Etc/UTC",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null] server local time: Tue Nov 30 18:29:35 UTC 2021 first timeZone sun.util.calendar.ZoneInfo[id="GMT+04:00",offset=14400000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null] first timezone offset / min 240 second timezone sun.util.calendar.ZoneInfo[id="GMT+07:00",offset=25200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null] second timezone offset / min 420 monthView locale: en monthView anchor Tue Nov 30 18:29:35 UTC 2021 monthView firstDisplayed Tue Nov 30 17:00:00 UTC 2021 expected:<-180> but was:<43020>
windows: