You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Sandro Boehme (JIRA)" <ji...@apache.org> on 2016/11/16 20:31:59 UTC
[jira] [Resolved] (SLING-6292) jcr.js.nodetypes tests fail when run
in a different timezone
[ https://issues.apache.org/jira/browse/SLING-6292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sandro Boehme resolved SLING-6292.
----------------------------------
Resolution: Fixed
Hey [~rombert], Berlin is the epicenter of Sling at one time of the year - shouldn't that be enough to expect everybody to use this timezone? ;-)
Thanks for reporting so specific and also for the pom changes!
I fixed the comparison to always use UTC.
> jcr.js.nodetypes tests fail when run in a different timezone
> ------------------------------------------------------------
>
> Key: SLING-6292
> URL: https://issues.apache.org/jira/browse/SLING-6292
> Project: Sling
> Issue Type: Bug
> Components: Extensions
> Reporter: Robert Munteanu
> Assignee: Sandro Boehme
> Labels: sling-IT
>
> The NodeTypes module JSON comparison tests expect the formatted date to be in the '+01:00' time zone, most likely were developed in the Europe/Berlin timezone :-)
> Of course, this fails when run in other timezones, for instance on Jenkins which has the timezone set to Etc/GMT or anywhere else in the world.
> [~sandro] - I think you're the best person to look into this, would be great to fix as it would remove two failed jobs on Jenkins.
> A sample test failure is:
> {noformat}Tests run: 13, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.113 sec <<< FAILURE! - in org.apache.sling.jcr.js.nodetypes.PropertyDefGenerationTest
> testCompleteDatePropertyDefinition(org.apache.sling.jcr.js.nodetypes.PropertyDefGenerationTest) Time elapsed: 0.037 sec <<< FAILURE!
> org.junit.ComparisonFailure: Actual JSON: {"ntWithPropertyDefs": {"declaredPropertyDefinitions": [{
> "name": "datePropertyDef",
> "autoCreated": true,
> "mandatory": true,
> "protected": true,
> "onParentVersion": "VERSION",
> "defaultValues": [{
> "date": "2012-02-01T00:00:00.000Z",
> "type": "Date"
> }],
> "requiredType": "Date",
> "valueConstraints": ["2012-04-01T00:00:00Z"],
> "multiple": true
> }]}}
> Expected JSON: { "ntWithPropertyDefs": { "declaredPropertyDefinitions": [ { "defaultValues": [ { "date": "2012-02-01T00:00:00.000+01:00", "type": "Date" } ], "requiredType": "Date", "valueConstraints": [ "2012-04-01T00:00:00Z" ], "multiple": true, "autoCreated": true, "mandatory": true, "protected": true, "onParentVersion": "VERSION", "name": "datePropertyDef" } ] }}: objects differed at key [ntWithPropertyDefs];: objects differed at key [declaredPropertyDefinitions];: arrays first differed at element [0];: objects differed at key [defaultValues];: arrays first differed at element [0];: objects differed at key [date]; expected:<...2-02-01T00:00:00.000[+01:00]> but was:<...2-02-01T00:00:00.000[Z]>
> at org.junit.Assert.assertEquals(Assert.java:115)
> at org.apache.sling.jcr.js.nodetypes.test.JSONAssert.assertEquals(JSONAssert.java:173)
> at org.apache.sling.jcr.js.nodetypes.test.JSONAssert.assertEquals(JSONAssert.java:99)
> at org.apache.sling.jcr.js.nodetypes.test.JSONAssert.assertEquals(JSONAssert.java:170)
> at org.apache.sling.jcr.js.nodetypes.test.JSONAssert.assertEquals(JSONAssert.java:99)
> at org.apache.sling.jcr.js.nodetypes.test.JSONAssert.assertEquals(JSONAssert.java:170)
> at org.apache.sling.jcr.js.nodetypes.test.JSONAssert.assertEquals(JSONAssert.java:167)
> at org.apache.sling.jcr.js.nodetypes.mock.MockNodeTypeGenerator.assertEqualsWithServletResult(MockNodeTypeGenerator.java:143)
> at org.apache.sling.jcr.js.nodetypes.PropertyDefGenerationTest.testCompletePropertyDefinition(PropertyDefGenerationTest.java:123)
> at org.apache.sling.jcr.js.nodetypes.PropertyDefGenerationTest.testCompleteDatePropertyDefinition(PropertyDefGenerationTest.java:70){noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)