PROPPATCH parsing and litmus tests

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PROPPATCH parsing and litmus tests

satish vs
Hello Milton users,

I'm trying to support PROPPATCH for my milton server. I followed this guide : http://milton.io/guide/m2/howtos/how-to-support-proppatch.html and attempting the 3rd option (MultiNamespaceCustomPropertyResource).
So at the moment my get/set implementation get called by milton, and I believe there's something wrong in the property value parsing.

If I set a simple property (using a client like cadaver), the property names/values are parsed correctly.
However, if I use a test tool like litmus (which sets multiple properties in one PROPPATCH request), what I get in setProperty() appears to be incorrectly parsed values. For eg:
Here's the snippet from litmus test :
 ..
 6. propset............... pass
 7. propget............... FAIL (Property {<a href="http://example.com/neon/litmus/}prop9">http://example.com/neon/litmus/}prop9 had value </prop></set>
<set><prop><prop9>value9, expected value9)
..
What I actually get in Milton server :

[MyCustomerPropertyResource] Set property Qname name : {<a href="http://example.com/neon/litmus/}prop9">http://example.com/neon/litmus/}prop9
[MyCustomerPropertyResource] Set property Value : </prop></set>
<set><prop><prop9>value9
[MyCustomerPropertyResource] Get property : {<a href="http://example.com/neon/litmus/}prop9">http://example.com/neon/litmus/}prop9

So instead of "value9" what I get is "</prop></set>
<set><prop><prop9>value9".

Note that, litmus also tests with non-well-formed XML requests, and there is an exception in Milton due to this.

[Fatal Error] :1:6: XML document structures must start and end within the same entity.
2014-10-22 15:45:46 http.webdav.DefaultPropFindRequestFieldParser [WARN] exception parsing request body
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 6; XML document structures must start and end within the same entity.
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at io.milton.http.webdav.DefaultPropFindRequestFieldParser.getRequestedFields(DefaultPropFindRequestFieldParser.java:66)
        at io.milton.http.webdav.MsPropFindRequestFieldParser.getRequestedFields(MsPropFindRequestFieldParser.java:50)
        at io.milton.http.webdav.PropFindHandler.processExistingResource(PropFindHandler.java:124)

On the other hand, the propfind_invalid test and propset/propget tests are in separate requests, and I would expect they're not related.
So I'm not sure why I get incorrect values to set in a setProperty() invocation from Milton. Am I doing something wrong here ? Is the litmus test outdated ?
Appreciate any help. Thanks!

Regards,
Satvas

_______________________________________________
Milton-users mailing list
[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users
Reply | Threaded
Open this post in threaded view
|

Re: PROPPATCH parsing and litmus tests

Sibi Antony
In reply to post dated Oct 22nd. ( New user, can't reply in Mailman.)

There's an obvious bug in the sax handler implementation. Sent a PR in github.
https://github.com/miltonio/milton2/pull/18

- Sibi
_______________________________________________
Milton-users mailing list
[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users