-
Notifications
You must be signed in to change notification settings - Fork 3
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
Compare XML with a specific Path #96
Comments
I've coded this enhancement though wanted to discuss the interface. The implementation / coding is cleaner / concise if procedure parameter defaults are used. Doing so means the one procedure can cater for no path, a common path, or different paths. Proposed procedure interface:
Example call with no path:
Example call with common path:
Example call with different paths:
|
I find this approach very good! This reduces the quantity of code, and the maintainability is better. By having default as /, it will take into account the whole document isn't it? The only thing is that the API section in the wiki should explain this clearly. |
I've coded so that the QUERY_XML is called only if a value has been provided for PATH1 / PATH2. This will be more efficient ( IF...ELSE vs CALL ) when no path values have been given.
Yes, existing code could be changed to make use of this approach. For example, procedures for asserts with message could be removed. |
The messages are used for a description of the assertion. They provide a message in the report, and this helps to identify an error, when multiple assertions are called in a test. More information about the assertions can be found there: https://github.com/angoca/db2unit/wiki/Custom-assert Once the new assertions are included, the Cheat Sheet should reflect this. |
Sorry, but I didn't express myself very well. I meant to say that asserts with no message could be removed by providing a NULL default for the MESSAGE parameter. Though an issue with providing parameter defaults in that you have to use
This one procedure could support a call with no message:
As well as a call with a message:
It can also support a call with message and no paths though would require using
Alternatively the MESSAGE parameter could be kept at the beginning which would need procedure calls to change to use
|
Probably, the complete XML document does not need to be compare, but just a part of it.
The assertion should provide a path in the document
For a common path:
For a different path:
The text was updated successfully, but these errors were encountered: