Stefano Maestri [
http://community.jboss.org/people/maeste] created the discussion
"Parsing and validation"
To view the discussion, visit:
http://community.jboss.org/message/573836#573836
--------------------------------------------------------------
Writing negative unit test cases for Metadata Parsers I realized we are not Throwing
exception in case of mandatory element missing.
We are not validating xml file too, so even if these elements are defined as mandatory
from xsd parser just try to parse them and in a lot of cases it got success. The result is
(for example) a DataSource without driver class defined that is totally bad.
We should of course avoid these situations, and xsd validation is not a solution IMHO
since our metadata could be build not only from xml but also from annotation and maybe in
future updated from a management console.
It's not a little (even if it's not very big) work since all metadata have to be
revisited and updated to verify and validate input data in constructor throw exception and
so on. Maybe it would better to switch from current constructors strategy to a builder
pattern for metadata providing validation of inputs, but I have to think about that.
IMHO it's a top priority task.
Opinions?
S.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/573836#573836]
Start a new discussion in IronJacamar Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]