New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCK Challenge -- Incorrect requirement around combination of 'length' and 'minLength' facets #82
Comments
Note that I don't think these tests can be 'fixed' in a patch release. Changing them to a positive test would break anyone who currently passes them, and changing them to test some other invalid relationship between length and minLength would be a new test. |
Note that the data in the most recent TCK run for jaxb-ri at https://ci.eclipse.org/jaxb-impl/job/jaxb-jakarta-ri-tck/18/ indicates the test passes because of the Xerces or JDK bug. From IDREF_length006_525_IDREF_length006_525.jtr
Looking up the use of the message code that produced the '[ERROR] length-minLength-maxLength.1.1 ...' logging leads to the code corrected by XERCES-1729 and the Java SE ports of it. The "value of length '-1'" bit indicates that the code was reading the 'length' from the base IDREFs type, which doesn't configure length, so the value is -1. Reading that value when it wasn't defined is the XERCES-1729 bug. |
I believe these tests should be excluded in TCKs for EE <=10 and changed to not expect failure for EE 11 (given EE 11 requires SE 21+) |
Thanks, @lukasj! |
+1000 |
@lukasj since this TCK challenge is accepted could you please close this issue as per TCK Process:
If you do intend to release updated TCKs that could be worth keeping this open a bit longer as ^ is a bit ambiguous. |
right, someone has to do the work and actually exclude the test... I've just haven't found a way how to do it yet. Do you know? |
Do we have a CI job yet for running the TCK (build) make files? If not, I think a user workaround of updating the
Is https://ci.eclipse.org/jaxb where such jobs should be setup? |
Guru has them under platform CI, I think. Let's wait for him. |
@gurunrao can you build the tck 4.0.1 from master, please? Thx |
As per #83 (comment) feedback from @gurunrao, I should be able to build it via https://ci.eclipse.org/jakartaee-tck/job/10/job/eftl-jaxb-tck-build-run-100 and will do so now to stage the |
https://www.eclipse.org/downloads/download.php?file=/ee4j/jakartaee-tck/jakartaee10/staged/eftl/jakarta-xml-binding-tck-4.0.1.zip is the staged TCK that implementations can test against for validation. |
WildFly passed against the staged https://www.eclipse.org/downloads/download.php?file=/ee4j/jakartaee-tck/jakartaee10/staged/eftl/jakarta-xml-binding-tck-4.0.1.zip TCK and we got the expected number of tests run Previously we passed 24,624 tests but failed the two excluded tests. Thank @lukasj + @gurunrao! @lukasj would you like me to create the https://github.com/jakartaee/specifications/issues for promoting the staged TCK? |
@scottmarlow feel free to do so, thanks! |
https://deploy-preview-668--jakartaee-specifications.netlify.app/specifications/xml-binding/4.0/ shows the web page preview for the I created the pull request directly as I think that usually triggers the action more than creating a https://github.com/jakartaee/specifications/issues |
I was away from computers due to holiday on Monday, Thanks @scottmarlow for the release. |
Summary
Two TCK tests are requiring behavior related to the relationship between 'length' and 'minLength' facets on a simple type that go beyond what XML Schema requires. They expect the JAXB implementation to reject compilation of xsds that are valid. Implementors could pass these tests for many years due to bugs in Xerces or Java SE's internal adaption of xerces, but since January 2022 Xerces and the various SE releases have been rolling out fixes for that bug and the tests will not pass using the latest Xerces or SE releases.
The Challenge
The two tests in question are negative tests that expect the implementation to fail to compile the test xsd. The tests both use an equivalent xsd.
The xsd is as follows:
https://github.com/jakartaee/jaxb-tck/blob/master/xml_schema/tests/xml_schema/msData/datatypes/Facets/Schemas/IDREFS_length006.xsd
The xsd used is :
https://github.com/jakartaee/jaxb-tck/blob/master/xml_schema/tests/xml_schema/msData/datatypes/Facets/Schemas/IDREFS_length006.xsd
The xsd content is the same as the previous one so I won't repost it.
Both are based on and restrict the IDREFs type:
http://www.w3.org/2001/XMLSchema
In effect the test xsds add to the base type restriction that the list minLength is 1 an additional restriction that the list length must be 5. The xsds also repeat the base type's restriction that minLength = 1.
The tests expect compilation to fail. Perhaps this was because at some point the thinking was combining 'length' and 'minLength' was invalid. I don't know. But the XML Schema 2: Datatypes document lists the requirements around 'length' facets:
https://www.w3.org/TR/xmlschema-2/#rf-facets
Neither of the TCK xsds shown above violate these constraints, so there is no reason they should fail to compile.
Background Info -- the Xerces/Java SE bug
Until recently JAXB implementations may not have been aware that the test was making an invalid assertion because of a bug in Xerces and Java SE that caused compilation of the test xsds to fail (and thus the negative tests to pass):
https://issues.apache.org/jira/browse/XERCESJ-1729
This was fixed in Xerces 2.12.2, released in January 2022. Following that OpenJDK began porting the Xerces 2.12.2 fixes into Java SE (for SE 19):
https://bugs.openjdk.org/browse/JDK-8282280
Backports to other SE branches were done; the complete list is shown in JDK-8282280. For the LTS SE streams it was resolved in October 2022 in SE 11.0.17 (https://bugs.openjdk.org/browse/JDK-8290810) and in SE 17.0.5 (https://bugs.openjdk.org/browse/JDK-8290508).
As test environments move to more recent Xerces or Java SE releases I expect they will start to fail these tests.
The text was updated successfully, but these errors were encountered: