I am using sqlunit-3.7 with Sybase. I wanted to use it to test my stored procedures. In generating the tests for stored procs using TUI, I found out that the transaction mode is set to off so my procs couldnt be called as their mode is set to unchained. I changed the TUI code to set transaction mode to on instead and it worked.
However when I used v3.8 it gave a different problem. Rather than giving an error for transaction more it just returned a resultset with:
<result>
<updatecount>1</updatecount>
</result>
rather than the row of data that I got with 3.7.
Any clues whats happening here?
Thanks,
Omer
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Did TUI return the resultset with updatecount? Or did you attempt to run a test and the result you mention is the result you got. I am more inclined to suspect the latter, because the code for callhandler has been changed in this release as a result of some refactoring I did. The TUI tool has not changed, but it does use the SQLUnit core code, so that may also be a problem.
If you can post the result you get with 3.7 versus the result you are getting with 3.8, it may give me a pointer to what went wrong with my changes. Also if you can, the code for the stored procedure you are using.
Thanks
Sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2004-07-23
Hi Sujit,
Sorry for the delayed response to this. I had been busy setting up rest of my testing framework so was working with 3.7 for the while. The problem mentioned is produced with the TUI tool while generating the test not running it. The output for 3.7 is:
I can't post the code for the stored proc because of contractual limitations. It would be cumbersome in anycase as it depends on a huge schema lying underneath. Please let me know if there is something particular about the procedure, knowing which would help.
I hope this can be fixed soon so that I can move on to the new version with other problems fixed.
Thanks very much.
Omer
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You could try to use the call tag, which should never return an updatecount, something like:
<sql>
<stmt>{call mrs_sp_web_lim_hdr_get(?,?,?,?,?)}</stmt>
</sql>
<result>
I will test this out and let you know more on Monday next week.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2004-07-26
Hi Sujit,
Thanks. It seems to be working with:
{call mrs_sp_web_lim_hdr_get(?,?,?,?,?)}
Omer
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The new TUITool code does not set transaction-mode to anything so it defaults to on. I should probably put in hooks to control it through the properties file.
To invoke the new TUITool, you will need the new code thats in CVS as of this morning.
I checked the code for SqlHandler at version 3.7 versus version 3.8 and dont see any reason for the different behaviors. In both cases, if ps.execute() returns false, then it will get the updatecount. I will check some more and let you know.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am using sqlunit-3.7 with Sybase. I wanted to use it to test my stored procedures. In generating the tests for stored procs using TUI, I found out that the transaction mode is set to off so my procs couldnt be called as their mode is set to unchained. I changed the TUI code to set transaction mode to on instead and it worked.
However when I used v3.8 it gave a different problem. Rather than giving an error for transaction more it just returned a resultset with:
<result>
<updatecount>1</updatecount>
</result>
rather than the row of data that I got with 3.7.
Any clues whats happening here?
Thanks,
Omer
Hi Omer,
Did TUI return the resultset with updatecount? Or did you attempt to run a test and the result you mention is the result you got. I am more inclined to suspect the latter, because the code for callhandler has been changed in this release as a result of some refactoring I did. The TUI tool has not changed, but it does use the SQLUnit core code, so that may also be a problem.
If you can post the result you get with 3.7 versus the result you are getting with 3.8, it may give me a pointer to what went wrong with my changes. Also if you can, the code for the stored procedure you are using.
Thanks
Sujit
Hi Sujit,
Sorry for the delayed response to this. I had been busy setting up rest of my testing framework so was working with 3.7 for the while. The problem mentioned is produced with the TUI tool while generating the test not running it. The output for 3.7 is:
<test name="Checking it">
<call>
<stmt>mrs_sp_web_lim_hdr_get ?,?,?,?,?</stmt>
<param id="1" type="NUMERIC" inout="in" is-null="false">2256</param>
<param id="2" type="NUMERIC" inout="in" is-null="true">NULL</param>
<param id="3" type="CHAR" inout="in" is-null="true">NULL</param>
<param id="4" type="DATE" inout="in" is-null="true">NULL</param>
<param id="5" type="CHAR" inout="in" is-null="false">'N'</param>
</call>
<result>
<resultset id="1">
<row id="1">
<col id="1" type="INTEGER">2256</col>
<col id="2" type="INTEGER">2256</col>
<col id="3" type="NUMERIC">333</col>
<col id="4" type="CHAR">R </col>
<col id="5" type="SMALLINT">9</col>
<col id="6" type="VARCHAR">Other Regional</col>
<col id="7" type="VARCHAR">11 Apr 2002</col>
<col id="8" type="VARCHAR">11 Apr 2002</col>
</row>
</resultset>
</result>
</test>
The output for 3.8 is:
<test name="Checking it">
<sql>
<stmt>mrs_sp_web_lim_hdr_get ?,?,?,?,?</stmt>
<param id="1" type="NUMERIC" inout="in" is-null="false">2256</param>
<param id="2" type="NUMERIC" inout="in" is-null="true">NULL</param>
<param id="3" type="CHAR" inout="in" is-null="true">NULL</param>
<param id="4" type="DATE" inout="in" is-null="true">NULL</param>
<param id="5" type="CHAR" inout="in" is-null="false">'N'</param>
</sql>
<result>
<updatecount>1</updatecount>
</result>
</test>
I can't post the code for the stored proc because of contractual limitations. It would be cumbersome in anycase as it depends on a huge schema lying underneath. Please let me know if there is something particular about the procedure, knowing which would help.
I hope this can be fixed soon so that I can move on to the new version with other problems fixed.
Thanks very much.
Omer
Hi Omer,
You could try to use the call tag, which should never return an updatecount, something like:
<sql>
<stmt>{call mrs_sp_web_lim_hdr_get(?,?,?,?,?)}</stmt>
</sql>
<result>
I will test this out and let you know more on Monday next week.
-sujit
Hi Sujit,
Thanks. It seems to be working with:
{call mrs_sp_web_lim_hdr_get(?,?,?,?,?)}
Omer
The new TUITool code does not set transaction-mode to anything so it defaults to on. I should probably put in hooks to control it through the properties file.
To invoke the new TUITool, you will need the new code thats in CVS as of this morning.
I checked the code for SqlHandler at version 3.7 versus version 3.8 and dont see any reason for the different behaviors. In both cases, if ps.execute() returns false, then it will get the updatecount. I will check some more and let you know.
-sujit