Menu

outparam matching question

Bryan
2004-03-19
2004-03-22
  • Bryan

    Bryan - 2004-03-19

    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">&lt;FACILITY_CONTACT_REQUESTS&gt;&lt;/FACILITY_CONTACT_REQUESTS&gt;</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)?

     
    • Sujit Pal

      Sujit Pal - 2004-03-22

      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

       

Log in to post a comment.