-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
tests(Java): run test against actual schema files #592
base: master
Are you sure you want to change the base?
Conversation
This change modifies the Java Unit tests to use the schemas in this repository to validate the examples, instead of those bundled in the `cyclonedx-java-core` artifact. Closes CycloneDX#256 Signed-off-by: Piotr P. Karwasz <piotr.github@karwasz.org>
ee77f65
to
08e3851
Compare
tools/src/test/java/org/cyclonedx/schema/JsonSchemaVerificationTest.java
Show resolved
Hide resolved
this seams to hit not the entirety of #592 . I had the tests run in an air-gapped offline environment, to see weather it actually uses the shipped schema files, and does not load some from the web.
|
Nice catch! Fixed in fd405f4 |
Signed-off-by: Piotr P. Karwasz <piotr.github@karwasz.org>
fd405f4
to
c935467
Compare
thank you so much for this, @ppkarwasz. 👍 |
The XML test did not access the SPDX schema from the network, but we just want to make sure that this will not happen in the future. Signed-off-by: Piotr P. Karwasz <piotr.github@karwasz.org>
@Nicolas-Peiffer , could I ask you for a review? |
The XML Catalog can replace specifying the location of specification/tools/src/test/java/org/cyclonedx/schema/XmlSchemaVerificationTest.java Lines 50 to 52 in dc4a2ab
However, I am not sure if we should do it, because it makes the Unit test less "unit". |
they are functional tests, not unit test. (they don't care why something is [in]valid, as long it is) |
In that case I can update the tests to use the XML Catalog for lookups. Are there any problems if I bump the Java version of the module to Java 9? That version introduced out-of-the-box support for XML Catalogs. |
not at all. As far as I see it: |
This change modifies the Java Unit tests to use the schemas in this repository to validate the examples, instead of those bundled in the
cyclonedx-java-core
artifact.Closes #256