Menu

Doubt regarding Test/Result tag

hiten123
2006-01-30
2013-04-25
  • hiten123

    hiten123 - 2006-01-30

    Hi All,

    I am new to SQLUnit, and wanted to use it for testing stored procedures on Sybase DB. The test I need to perform is execute a stored procedure which inturn invokes several helper stored procedure and in the end either the main stored procedure or one of the helper stored procedure called by the main stored procedure creates a record in output queue transaction table.

    To verify whether the stored procedure successfully completed I need to do a select stmt on the output queue transaction table and check the values of the newly inserted rows.

    I am not sure how to use the result element of the test tag, because the main stored procedure doesn't return any resultset back.

    Please correct me if I have misunderstood the working of SQLUnit.

    Thanks,

    Regards,
    Hiten.

     
    • James Henderson

      James Henderson - 2006-01-30

      Hi Hiten,

      The way that I would set up the test is in two parts:

          <test name="Test 1: execute stored Procedure">
              <sql>
                  <stmt>
                      exec MyTestProc
                  </stmt>
              </sql>
              <result>
                  <resultset id="1" /> <!-- No result set -->
              </result>
          </test>
          <test name="Test 2: Check Output Queue Transaction Table">
              <sql>
                  <stmt>
                      select * from OutputQueueTransactionTable where MyCriteria = MyExpectedValue
                  </stmt>
              </sql>
              <result>
                  <resultset id="1">
                      <row id="1">
                          <!-- Put expected column values here -->
                      </row>
                  </resultset>
              </result>
          </test>

      Hope this helps.

      -jh

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.