diff --git a/xstream/src/test/com/thoughtworks/xstream/converters/extended/ISO8601DateConverterTest.java b/xstream/src/test/com/thoughtworks/xstream/converters/extended/ISO8601DateConverterTest.java index 398c10ac2..85d5c0cab 100644 --- a/xstream/src/test/com/thoughtworks/xstream/converters/extended/ISO8601DateConverterTest.java +++ b/xstream/src/test/com/thoughtworks/xstream/converters/extended/ISO8601DateConverterTest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2004, 2005 Joe Walnes. - * Copyright (C) 2006, 2007, 2018 XStream Committers. + * Copyright (C) 2006, 2007, 2018, 2024 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD @@ -16,6 +16,7 @@ import java.util.Calendar; import java.util.Date; +import com.thoughtworks.xstream.core.JVM; import com.thoughtworks.xstream.testutil.TimeZoneChanger; import junit.framework.TestCase; @@ -30,7 +31,7 @@ protected void setUp() throws Exception { super.setUp(); converter = new ISO8601DateConverter(); - // Ensure that this test always run as if it were in the EST timezone. + // Ensure that this test always run as if it were in the EST (Eastern Standard) timezone (UTC-05:00). // This prevents failures when running the tests in different zones. // Note: 'EST' has no relevance - it was just a randomly chosen zone. TimeZoneChanger.change("EST"); @@ -64,7 +65,7 @@ public void testUnmarshallsISOFormatInUTC() throws ParseException { final Date out = (Date)converter.fromString(isoFormat); final Date control = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(simpleFormat); // verify for EST - assertEquals("Sun Feb 14 13:10:30 EST 1993", out.toString()); + assertEquals("Sun Feb 14 13:10:30 " + (JVM.isVersion(23) ? "GMT-05:00" : "EST") + " 1993", out.toString()); assertEquals(control, out); }