XQTS and XQSuite tests expecting a specific XPath exception to be thrown may fail due to those exceptions being wrapped and re-thrown with an exception of another type.
In one instance err:XPTY0004 was wrapped in a generic org.exist.xquery.XPathException (in #4081)
Exceptions to not be wrapped so that we can test for those errors.
To Reproduce
needs reproducible test, for now you can check out #4081 and modify the test annotation of sync:bad-options-5 to expect %test:assertError("err:XPTY0004")
Here is one example of such a failure in XQTS (there are many more):
<testcase classname="org.exist.xqts.runner.JUnitResultsSerializerActor$XQTSJUnitTest" name="UnaryLookup-018" time="0.0">
<failure message="Expected: 'Error(XPST0003)', but query returned an error: QueryError(ERROR,exerr:ERROR org.exist.xquery.XPathException: err:XPST0003 unexpected token: 1.0 [at line 1, column 54]
)" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: Expected: 'Error(XPST0003)', but query returned an error: QueryError(ERROR,exerr:ERROR org.exist.xquery.XPathException: err:XPST0003 unexpected token: 1.0 [at line 1, column 54] [...]"
/></testcase>
Describe the bug
XQTS and XQSuite tests expecting a specific XPath exception to be thrown may fail due to those exceptions being wrapped and re-thrown with an exception of another type.
In one instance
err:XPTY0004
was wrapped in a genericorg.exist.xquery.XPathException
(in #4081)https://github.com/eXist-db/exist/blob/2682f3b6e9a8275804640c4606a38d54eaef2d17/extensions/modules/file/src/test/xquery/modules/file/sync.xqm#L132-L144
Expected behavior
Exceptions to not be wrapped so that we can test for those errors.
To Reproduce
needs reproducible test, for now you can check out #4081 and modify the test annotation of
sync:bad-options-5
to expect%test:assertError("err:XPTY0004")
Here is one example of such a failure in XQTS (there are many more):
I found a relatively trivial way to reproduce it
Context (please always complete the following information):
Additional context
conf.xml
? none