[xquery-talk] Re: XQuery-based Java Unit tests?

Hans-Juergen Rennau hrennau at yahoo.de
Wed Mar 9 14:21:15 PST 2011


Michael, David,

thank you very much for your comments.

David, what concerns  the testing of XDM values, I first did not see the 
connection to the Java scenario, but finally I did see it: Java systems 
producing XML documents usually also process them, and it goes without saying 
that such processing is a good candidate for XQuery called from Java; and as 
XQuery produces by definition XDM values, we do have a need to tackle XDM values 
in unit tests. 


Michael, your report on the testing via XPath assertions against the query 
result is interesting and comes very close to what I imagined. I have not yet 
understood if the tool launching the tests and evaluating the results according 
to the test configuration you showed is an official W3C testing tool, an 
internal Saxonica tool, or perhaps neither of them. 


You wrote:
"Your situation, of testing XML documents, is essentially the same 
problem except that the query is always "." and the variability is in 
the source document it applies to...."

But I think that the query is not "." - rather, the queries in my case are 
simply the queries expressing those assertions. So it is a 1:1 situation what 
concerns the processing, the only difference is in the interpretation: an error 
in your case means the XPath evaluator failed, in mine it means the input 
document is not as expected.

Final note: I wonder if there is a rationale behind confining assertions to 
XPath expressions, rather than the more general alternative - XQuery 
expressions.

-- Hans-Juergen





More information about the talk mailing list