We have some of our stored procedures/functions returning xml as the outparam. What would be the best way to verify the output? We can return them as a CLOB or a VARCHAR (would actually prefer the CLOB). My result tag looks like this:
You would need to write a matcher only if you wanted to actually verify that the result was "less" than an exact string match. In the case you describe, you may want to test that 0 (or a certain number of) faculty contact requests were returned from the query, regardless of the names of the faculty contacts.
I havent tested this, but let me know if it does not work, I can write some test cases for this scenario and we can go from there.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We have some of our stored procedures/functions returning xml as the outparam. What would be the best way to verify the output? We can return them as a CLOB or a VARCHAR (would actually prefer the CLOB). My result tag looks like this:
<result>
<outparam id="1" type="VARCHAR"><FACILITY_CONTACT_REQUESTS></FACILITY_CONTACT_REQUESTS></outparam>
</result>
I would like to be able to compare XML docs. Should I maybe be writing my own Matcher class? Has anybody else done something like this (XML Results)?
Hi Bryan,
This should work as is. If you use CLOB, then you would have to specify an external file or an md5 digest, like so:
<result>
..<outparam id="1" type="CLOB">file:someexternalfile.xml</outparam>
</result>
or
<result>
..<outparam id="1" type="CLOB">md5:digest_of_the_contents</outparam>
</result>
You would need to write a matcher only if you wanted to actually verify that the result was "less" than an exact string match. In the case you describe, you may want to test that 0 (or a certain number of) faculty contact requests were returned from the query, regardless of the names of the faculty contacts.
I havent tested this, but let me know if it does not work, I can write some test cases for this scenario and we can go from there.
-sujit