Re: [PR] Fix time zone issue in Velocity952TestCase [veloc ity-engine]

michael-o (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.velocity.devel
Message-ID <PR_kwDOAN72MM6Al3uA-976f72e7-d033-4636-800a-31aa73c9519f@gitbox.apache.org>
michael-o commented on PR #55:
URL: https://github.com/apache/velocity-engine/pull/55#issuecomment-2454274557

   > The easiest way to reproduce the issue is to run the test on a machine that is not in the GMT+1 time zone (Central European Time).
   > 
   > For example if I run the test in Seattle, it fails with the following error: Velocity952TestCase.testEnd2End:93->BaseTestCase.assertEvalEquals:207->BaseTestCase.assertEvalEquals:216 expected:<[36]00000> but was:<[-288]00000>.
   > 
   > Alternatively, you can simulate running the test in another time zone by adding the following to the velocity-engine-core pom.xml file, under /project/build/plugins/plugin[6]/configuration/systemProperties:
   > 
   > ```
   > <property>
   >     <name>user.timezone</name>
   >     <value>America/Los_Angeles</value>
   > </property>
   > ```
   > 
   > That will reproduce the issue.
   > 
   > The root cause is: the java.util.TimeZone.getDefault(..) method returns the default time zone of the JVM. See https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/TimeZone.html#getDefault(). The value depends on where the machine running the tests is located.
   
   Checking...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.