You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by GitBox <gi...@apache.org> on 2021/01/15 17:12:56 UTC

[GitHub] [myfaces] volosied commented on pull request #144: Support Range of Versions During Validations

volosied commented on pull request #144:
URL: https://github.com/apache/myfaces/pull/144#issuecomment-761067715


   I'm not sure of a way to add a Unit Test. 
   
   Current stack trace shows --
   ```
   Jan 15, 2021 12:04:51 PM org.apache.myfaces.config.ConfigFilesXmlValidationUtils$ValidationErrorHandler error
   SEVERE: cvc-enumeration-valid: Value '3.0' is not facet-valid with respect to enumeration '[1.2, 2.0, 2.1, 2.2, 2.3]'. It must be a value from the enumeration.
   org.xml.sax.SAXParseException; lineNumber: 23; columnNumber: 17; cvc-enumeration-valid: Value '3.0' is not facet-valid with respect to enumeration '[1.2, 2.0, 2.1, 2.2, 2.3]'. It must be a value from the enumeration.
   	at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
   	....
   	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
   	at java.xml/com.sun.org.apache.xerces.internal.jaxp.validation.StreamValidatorHelper.validate(StreamValidatorHelper.java:176)
   	at java.xml/com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:115)
   	at java.xml/javax.xml.validation.Validator.validate(Validator.java:124)
   	at org.apache.myfaces.config.ConfigFilesXmlValidationUtils.validateFacesConfigFile(ConfigFilesXmlValidationUtils.java:248)
   	at org.apache.myfaces.config.ConfigFilesXmlValidationUtilsTestCase.testJSF30Config(ConfigFilesXmlValidationUtilsTestCase.java:84)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   .....
   ```
   
   I was thinking that the `testJSF30Config` should throw an exception, but that doesn't actually occur. 
   
   The error handle just logs the exception instead of re-throwing the exception as in the [fatalError method. ](https://github.com/apache/myfaces/blob/084d3c8d7c21e4c964c1a13b430563bc4bfb7aed/impl/src/main/java/org/apache/myfaces/config/ConfigFilesXmlValidationUtils.java#L226-L228)
   
   https://github.com/apache/myfaces/blob/084d3c8d7c21e4c964c1a13b430563bc4bfb7aed/impl/src/main/java/org/apache/myfaces/config/ConfigFilesXmlValidationUtils.java#L231-L236
   
   Not sure if error handing should changed or not?  
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org