Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Failing tests in untouched hybrid-project #265

Closed
hutchkintoot opened this issue Aug 11, 2014 · 3 comments
Closed

Failing tests in untouched hybrid-project #265

hutchkintoot opened this issue Aug 11, 2014 · 3 comments

Comments

@hutchkintoot
Copy link

Hi

I just created a new hybrid-project using dev-branch and marklogic-version 7 to test out the unit-test functionality.

I get one failing test when i run the auto-generated tests via the browser.

in /roxy/lib/request.xqy on line 162,

in req:get("dt", (), "type=xs:dateTime")

variables:
name = "dt"
default = ()
options = "type=xs:dateTime"
type = "xs:dateTime"
max-count = ()
allow-empty = fn:true()
value = "2014-08-11T12:07:45.192734 02:00"
v = ()
in /roxy/lib/request.xqy on line 91,

in req:get("dt", "type=xs:dateTime")

variables:
name = "dt"
options = "type=xs:dateTime"
in /app/controllers/test-request.xqy on line 68,

in xdmp:function(fn:QName("http://marklogic.com/roxy/controller/test-request", "test1"), "/app/controllers/test-request.xqy")()

in /roxy/router.xqy on line 51,

in router:route()

in /roxy/query-router.xqy on line 20,

in

It looks like the problem is due to the fact that the value is not a valid string-representation of an xs:dateTime. It lacks the + sign between the fractions of a second and time-zone indicator.

Regards,
Johan

@grtjn
Copy link
Contributor

grtjn commented Aug 26, 2014

Not sure it is the same, but I recall having seen something similar a while ago. That was caused by JavaScript code that started returning date objects that contained a timezone, where one wasn't expected. That might be a hint..

@paxtonhare
Copy link
Contributor

I just tried to reproduce this on a mac and windows box with the latest code from the dev branch but it worked fine. Can you provide some more details? Which version of Roxy? Which exact version of MarkLogic? Which operating system?

Thanks.

@grtjn
Copy link
Contributor

grtjn commented Feb 23, 2015

It goes wrong when fn:current-dateTime() returns a dateTime containing a timezone. More accurately when it is a + timezone. One of the tests does a http request including the date, but the + is not uri-encoded. A + in a uri gets translated to space, hence the error with the space before the timezone..

Luckily I'm in a + timezone, and was able to reproduce the error..

paxtonhare added a commit that referenced this issue Mar 10, 2015
Fixed #265: uri-encoded date in request-lib tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants