Menu

Comparing the result of an SQL Query - Fail.

2005-09-21
2013-04-25
  • P E Stephen

    P E Stephen - 2005-09-21

    Hi this is the test in my test.xml

      <test name="name" failure-message="fail" assert="not-equal">
    <sql><stmt>SELECT c1 FROM table WHERE primary_column = 'abc'</stmt></sql>
        <result>
           <resultset id="1">
              <row id="1">
                <col id="1" name="c1" type="VARCHAR">323</col>
              </row>
           </resultset>
        </result>
      </test>

    suppose the query is returning only one row, and the c1 has the value 22.

    the test should fail, but the comparision is not happening at all.

    can anyone help me in this.

    i am using sqlunit 4.9 on oracle 9.2.0.1

    Thankyou

    P E Stephen
    p.e.stephen@gmail.com

     
    • James Henderson

      James Henderson - 2005-09-21

      Hi Stephen,

      I believe your problem may stem from the assertion attribute within your test tag. 

      Currently, you have assert="not-equal".  Since you have specified an expected value of 323 for c1, and the query returns 22, the two values are not equal.  Therefore the test returns passes.

       
    • David Fishburn

      David Fishburn - 2005-09-21

      What happens if you change:
      <test name="name" failure-message="fail" assert="not-equal">

      To:
      <test name="name">

      Using the defaults?

      Dave

       
    • P E Stephen

      P E Stephen - 2005-09-21

      Hi james

      I have tried with about 14 other assert variables also for the test.
      they can be found in the online help file.

      i'll cross check again.

      but if u come accross any thing else, please let me know

      meanwhile i'll check them again

      Thankyou
      P E Stephen
      p.e.stephen@gmail.com

       
    • P E Stephen

      P E Stephen - 2005-09-21

      I'll check that right now fishburn

      just a min

       
    • P E Stephen

      P E Stephen - 2005-09-21

      Hi Fishburn

      i have deleted the attribute and its working fine.

      thanks a lot

      but a doubt
      whats the default value

      thankx

       
    • P E Stephen

      P E Stephen - 2005-09-21

      ok

      resultsets-equal seems to be the default value

       
    • P E Stephen

      P E Stephen - 2005-09-21

      hi james and fishburn

      sorry, it was my mistake that i typed resultset-equal.
      it should have been resultsets-equal

      i misses a s

      i have used  resultsets-equal and i am getting the output now

      sorry for all the trouble

      but thanx a lot

       

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.