From 7e8b6eb84ba1390f88d4bd1d2ac0eaebf7310285 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 08:43:49 +0000 Subject: [PATCH 1/7] Bump quarkus.platform.version from 2.12.2.Final to 2.12.3.Final Bumps `quarkus.platform.version` from 2.12.2.Final to 2.12.3.Final. Updates `quarkus-universe-bom` from 2.12.2.Final to 2.12.3.Final - [Release notes](https://github.com/quarkusio/quarkus-platform/releases) - [Commits](https://github.com/quarkusio/quarkus-platform/compare/2.12.2.Final...2.12.3.Final) Updates `quarkus-maven-plugin` from 2.12.2.Final to 2.12.3.Final --- updated-dependencies: - dependency-name: io.quarkus:quarkus-universe-bom dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.quarkus:quarkus-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 015aac8..d5b3b0c 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ SPDX-License-Identifier: Apache-2.0 0.0.4 0.9.3 - 2.12.2.Final + 2.12.3.Final 2.0.1 0.9.1 From f4c2d28d779284f6e94dbd798ab187fd6aa9916a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 06:34:50 +0000 Subject: [PATCH 2/7] Bump slf4j.version from 2.0.1 to 2.0.2 Bumps `slf4j.version` from 2.0.1 to 2.0.2. Updates `slf4j-api` from 2.0.1 to 2.0.2 - [Release notes](https://github.com/qos-ch/slf4j/releases) - [Commits](https://github.com/qos-ch/slf4j/commits) Updates `slf4j-simple` from 2.0.1 to 2.0.2 - [Release notes](https://github.com/qos-ch/slf4j/releases) - [Commits](https://github.com/qos-ch/slf4j/commits) --- updated-dependencies: - dependency-name: org.slf4j:slf4j-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.slf4j:slf4j-simple dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d5b3b0c..645d52b 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ SPDX-License-Identifier: Apache-2.0 0.9.3 2.12.3.Final - 2.0.1 + 2.0.2 0.9.1 From fdb01357e3ad3c56ac82721ab7cd49fdda1bf139 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:09:48 +0000 Subject: [PATCH 3/7] Bump slf4j.version from 2.0.2 to 2.0.3 Bumps `slf4j.version` from 2.0.2 to 2.0.3. Updates `slf4j-api` from 2.0.2 to 2.0.3 - [Release notes](https://github.com/qos-ch/slf4j/releases) - [Commits](https://github.com/qos-ch/slf4j/compare/v_2.0.2...v_2.0.3) Updates `slf4j-simple` from 2.0.2 to 2.0.3 - [Release notes](https://github.com/qos-ch/slf4j/releases) - [Commits](https://github.com/qos-ch/slf4j/compare/v_2.0.2...v_2.0.3) --- updated-dependencies: - dependency-name: org.slf4j:slf4j-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.slf4j:slf4j-simple dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 645d52b..d01057c 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ SPDX-License-Identifier: Apache-2.0 0.9.3 2.12.3.Final - 2.0.2 + 2.0.3 0.9.1 From eec7748586eb71ec8c8f90fb2f769b75f02b5832 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:17:35 +0000 Subject: [PATCH 4/7] Bump quarkus.platform.version from 2.12.3.Final to 2.13.0.Final Bumps `quarkus.platform.version` from 2.12.3.Final to 2.13.0.Final. Updates `quarkus-universe-bom` from 2.12.3.Final to 2.13.0.Final - [Release notes](https://github.com/quarkusio/quarkus-platform/releases) - [Commits](https://github.com/quarkusio/quarkus-platform/compare/2.12.3.Final...2.13.0.Final) Updates `quarkus-maven-plugin` from 2.12.3.Final to 2.13.0.Final --- updated-dependencies: - dependency-name: io.quarkus:quarkus-universe-bom dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.quarkus:quarkus-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d01057c..2ed57be 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ SPDX-License-Identifier: Apache-2.0 0.0.4 0.9.3 - 2.12.3.Final + 2.13.0.Final 2.0.3 0.9.1 From e6a9cc786f835033f107d263d9151769bfb06151 Mon Sep 17 00:00:00 2001 From: Dennis Labordus Date: Thu, 29 Sep 2022 10:39:43 +0200 Subject: [PATCH 5/7] Fixed URI of Test Resource. Signed-off-by: Dennis Labordus --- .../scl/validator/rest/v1/SclValidatorServerEndpointTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/test/java/org/lfenergy/compas/scl/validator/rest/v1/SclValidatorServerEndpointTest.java b/app/src/test/java/org/lfenergy/compas/scl/validator/rest/v1/SclValidatorServerEndpointTest.java index e27d885..83fe697 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/validator/rest/v1/SclValidatorServerEndpointTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/validator/rest/v1/SclValidatorServerEndpointTest.java @@ -38,7 +38,7 @@ class SclValidatorServerEndpointTest { @InjectMock private SclValidatorService sclValidatorService; - @TestHTTPResource("/compas-scl-validator/validate-ws/v1/SCD") + @TestHTTPResource("/validate-ws/v1/SCD") private URI uri; @Test From 7d05ca2402d12beb35a00c6c66630dc5074e8fd6 Mon Sep 17 00:00:00 2001 From: Dennis Labordus Date: Thu, 29 Sep 2022 15:38:05 +0200 Subject: [PATCH 6/7] Added Compas XSD to XSD validator to validate Compas Elements. Signed-off-by: Dennis Labordus --- .../scl/validator/xsd/XSDValidator.java | 7 +- .../scl/validator/xsd/XSDValidatorTest.java | 26 +++++ .../example-with-compas-validation-errors.scd | 108 ++++++++++++++++++ 3 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 validator/src/test/resources/scl/validation/example-with-compas-validation-errors.scd diff --git a/validator/src/main/java/org/lfenergy/compas/scl/validator/xsd/XSDValidator.java b/validator/src/main/java/org/lfenergy/compas/scl/validator/xsd/XSDValidator.java index 9a5344c..d2e6302 100644 --- a/validator/src/main/java/org/lfenergy/compas/scl/validator/xsd/XSDValidator.java +++ b/validator/src/main/java/org/lfenergy/compas/scl/validator/xsd/XSDValidator.java @@ -12,6 +12,7 @@ import org.xml.sax.SAXException; import javax.xml.XMLConstants; +import javax.xml.transform.Source; import javax.xml.transform.sax.SAXSource; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.SchemaFactory; @@ -35,10 +36,12 @@ public XSDValidator(List errorList, String sclData) { var sclVersion = info.getSclVersion(); try { + var sclXsd = new StreamSource(getClass().getClassLoader().getResourceAsStream("xsd/SCL" + sclVersion + "/SCL.xsd")); + var compasXsd = new StreamSource(getClass().getClassLoader().getResourceAsStream("xsd/SCL_CoMPAS.xsd")); + var factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); factory.setResourceResolver(new ResourceResolver(sclVersion)); - var schema = factory.newSchema( - new StreamSource(getClass().getClassLoader().getResourceAsStream("xsd/SCL" + sclVersion + "/SCL.xsd"))); + var schema = factory.newSchema(new Source[]{sclXsd, compasXsd}); validator = schema.newValidator(); validator.setErrorHandler(new XSDErrorHandler(errorList)); } catch (SAXException exception) { diff --git a/validator/src/test/java/org/lfenergy/compas/scl/validator/xsd/XSDValidatorTest.java b/validator/src/test/java/org/lfenergy/compas/scl/validator/xsd/XSDValidatorTest.java index 199b1fb..6f53466 100644 --- a/validator/src/test/java/org/lfenergy/compas/scl/validator/xsd/XSDValidatorTest.java +++ b/validator/src/test/java/org/lfenergy/compas/scl/validator/xsd/XSDValidatorTest.java @@ -46,6 +46,32 @@ void validate_WhenCalledWithSclDataWithXsdValidationErrors_ThenErrorsAreRetrieve } } + @Test + void validate_WhenCalledWithSclDataWithCompasXsdValidationErrors_ThenErrorsAreRetrieved() throws IOException { + var errorList = new ArrayList(); + try (var inputStream = getClass() + .getResourceAsStream("/scl/validation/example-with-compas-validation-errors.scd")) { + var data = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8); + new XSDValidator(errorList, data).validate(); + + assertEquals(4, errorList.size()); + + var error = errorList.get(0); + assertEquals("Value 'INVALID' is not facet-valid with respect to enumeration '[SSD, IID, ICD, SCD, CID, " + + "SED, ISD, STD]'. It must be a value from the enumeration.", error.getMessage()); + assertEquals("XSD/cvc-enumeration-valid", error.getRuleName()); + assertEquals(10, error.getLineNumber()); + assertEquals(57, error.getColumnNumber()); + + error = errorList.get(2); + assertEquals("Value 'Invalid Label' is not facet-valid with respect to pattern '[A-Za-z][0-9A-Za-z_-]*' " + + "for type 'tCompasLabel'.", error.getMessage()); + assertEquals("XSD/cvc-pattern-valid", error.getRuleName()); + assertEquals(12, error.getLineNumber()); + assertEquals(55, error.getColumnNumber()); + } + } + @Test void validate_WhenCalledWithSclDataContainingInvalidVersion_ThenExceptionIsThrown() throws IOException { var errorList = new ArrayList(); diff --git a/validator/src/test/resources/scl/validation/example-with-compas-validation-errors.scd b/validator/src/test/resources/scl/validation/example-with-compas-validation-errors.scd new file mode 100644 index 0000000..84824ea --- /dev/null +++ b/validator/src/test/resources/scl/validation/example-with-compas-validation-errors.scd @@ -0,0 +1,108 @@ + + + + + + + + MiniGrid + INVALID + + Invalid Label + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IEC 61850-7-3:2007B + + + + + + + + + + + + + + + + + + + IEC 61850-8-1:2003 + + + + + IEC 61850-8-1:2003 + + + + + IEC 61850-8-1:2003 + + + Completed + Cancelled + New adjustments + AnotherValue + + + Va + Vb + Vc + Aa + Ab + Ac + Vab + Vbc + Vca + AnotherValue + + + \ No newline at end of file From 01f7e4fa294eb68df393200e8b184bec04b872ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 08:38:48 +0000 Subject: [PATCH 7/7] Bump tycho-eclipserun-plugin from 2.7.5 to 3.0.0 Bumps tycho-eclipserun-plugin from 2.7.5 to 3.0.0. --- updated-dependencies: - dependency-name: org.eclipse.tycho.extras:tycho-eclipserun-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- riseclipse/riseclipse-p2-to-m2/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riseclipse/riseclipse-p2-to-m2/pom.xml b/riseclipse/riseclipse-p2-to-m2/pom.xml index b1d9bed..bffc04d 100644 --- a/riseclipse/riseclipse-p2-to-m2/pom.xml +++ b/riseclipse/riseclipse-p2-to-m2/pom.xml @@ -29,7 +29,7 @@ SPDX-License-Identifier: Apache-2.0 org.eclipse.tycho.extras tycho-eclipserun-plugin - 2.7.5 + 3.0.0 ${project.build.directory}/maven/tmp/cbi JavaSE-17