Skip to content

Commit d312cf5

Browse files
author
Dennis Labordus
committed
Fixed tests.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent 66c9185 commit d312cf5

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

validator/src/main/java/org/lfenergy/compas/scl/validator/model/ValidationError.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class ValidationError {
4343
example = "/SCL/Substation[1]/VoltageLevel[1]/Bay[5]")
4444
@XmlElement(name = "XPath",
4545
namespace = SCL_VALIDATOR_SERVICE_V1_NS_URI)
46-
private String xPath;
46+
private String xpath;
4747

4848
public String getMessage() {
4949
return message;
@@ -77,11 +77,11 @@ public void setColumnNumber(Integer columnNumber) {
7777
this.columnNumber = columnNumber;
7878
}
7979

80-
public String getXPath() {
81-
return xPath;
80+
public String getXpath() {
81+
return xpath;
8282
}
8383

84-
public void setXPath(String xPath) {
85-
this.xPath = xPath;
84+
public void setXpath(String xPath) {
85+
this.xpath = xPath;
8686
}
8787
}

validator/src/main/java/org/lfenergy/compas/scl/validator/xsd/XSDErrorHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void warning(SAXParseException exception) throws SAXException {
3939

4040
LOGGER.debug("XSD Validation - warning: '{}' (XPath {})",
4141
validationError.getMessage(),
42-
validationError.getXPath());
42+
validationError.getXpath());
4343
}
4444

4545
@Override
@@ -49,7 +49,7 @@ public void error(SAXParseException exception) throws SAXException {
4949

5050
LOGGER.debug("XSD Validation - error: '{}' (XPath {})",
5151
validationError.getMessage(),
52-
validationError.getXPath());
52+
validationError.getXpath());
5353
}
5454

5555
@Override
@@ -59,15 +59,15 @@ public void fatalError(SAXParseException exception) throws SAXException {
5959

6060
LOGGER.debug("XSD Validation - fatal error, stopping: '{}' (XPath {})",
6161
validationError.getMessage(),
62-
validationError.getXPath());
62+
validationError.getXpath());
6363
}
6464

6565
private ValidationError createValidationError(SAXParseException exception) throws SAXException {
6666
var validationError = new ValidationError();
6767
var xsdMessage = exception.getMessage();
6868
validationError.setMessage(getMessage(xsdMessage));
6969
validationError.setRuleName(getRuleName(xsdMessage));
70-
validationError.setXPath(getXPath(getCurrentNode()));
70+
validationError.setXpath(getXPath(getCurrentNode()));
7171
return validationError;
7272
}
7373

validator/src/test/java/org/lfenergy/compas/scl/validator/xsd/XSDErrorHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void fatalError_WhenCalled_ThenNewValidationErrorAddedToList() throws SAXExcepti
9191
private void assertValidationError(List<ValidationError> errorList, String message) throws SAXException {
9292
assertEquals(1, errorList.size());
9393
assertEquals(message, errorList.get(0).getMessage());
94-
assertEquals("/SCL", errorList.get(0).getXPath());
94+
assertEquals("/SCL", errorList.get(0).getXpath());
9595
assertNull(errorList.get(0).getLineNumber());
9696
assertNull(errorList.get(0).getColumnNumber());
9797

validator/src/test/java/org/lfenergy/compas/scl/validator/xsd/XSDValidatorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void validate_WhenCalledWithSclDataWithXsdValidationErrors_ThenErrorsAreRetrieve
4444
var error = errorList.get(2);
4545
assertEquals("Attribute 'name' must appear on element 'BDA'.", error.getMessage());
4646
assertEquals("XSD/cvc-complex-type.4", error.getRuleName());
47-
assertEquals("/SCL/DataTypeTemplates[1]/DAType[1]/BDA[2]", error.getXPath());
47+
assertEquals("/SCL/DataTypeTemplates[1]/DAType[1]/BDA[2]", error.getXpath());
4848
}
4949
}
5050

@@ -64,13 +64,13 @@ void validate_WhenCalledWithSclDataWithCompasXsdValidationErrors_ThenErrorsAreRe
6464
assertEquals("Value 'INVALID' is not facet-valid with respect to enumeration '[SSD, IID, ICD, SCD, CID, " +
6565
"SED, ISD, STD]'. It must be a value from the enumeration.", error.getMessage());
6666
assertEquals("XSD/cvc-enumeration-valid", error.getRuleName());
67-
assertEquals("/SCL/Private[1]/compas:SclFileType[1]", error.getXPath());
67+
assertEquals("/SCL/Private[1]/compas:SclFileType[1]", error.getXpath());
6868

6969
error = errorList.get(2);
7070
assertEquals("Value 'Invalid Label' is not facet-valid with respect to pattern '[A-Za-z][0-9A-Za-z_-]*' " +
7171
"for type 'tCompasLabel'.", error.getMessage());
7272
assertEquals("XSD/cvc-pattern-valid", error.getRuleName());
73-
assertEquals("/SCL/Private[1]/compas:Labels[1]/compas:Label[1]", error.getXPath());
73+
assertEquals("/SCL/Private[1]/compas:Labels[1]/compas:Label[1]", error.getXpath());
7474
}
7575
}
7676

0 commit comments

Comments
 (0)