I have problems to use ResultSets with MSSQL Server.
No have example tests to this and test fail because system receive only the first resultset.
Can anyone help-me?
Follow the example of my Procedure and Test XML.
I´m debugging the java code to find problem, but whether anyone know that.
Tks
PROCEDURE
-----------------
CREATE PROCEDURE pr_test
BEGIN
SELECT
'Abc' AS field1,
'Def' AS field2
SELECT
0 AS code,
'Ghi' AS field1
'Jkl' AS field2
END
GO
TEST XML
------------------
<?xml version="1.0"?>
<!DOCTYPE sqlunit SYSTEM "file:docs/sqlunit.dtd" [
<!ENTITY con SYSTEM "test/xpto/connection.xml">
]>
<sqlunit>
<!-- ***************************** ** //-->
<!-- Connection set-up information //-->
<!-- ***************************** ** //-->
&con;
<test name="TestResultSets">
<sql>
<stmt>
----------------------------------------------------
-- Exec proc
----------------------------------------------------
EXEC pr_test
</stmt>
</sql>
<result>
<resultset id="1">
<row id="1">
<col id="01" name="field1" type="VARCHAR">Abc</col>
<col id="02" name="field2" type="VARCHAR">Def</col>
</row>
</resultset>
<resultset id="2">
<row id="1">
<col id="01" name="code" type="INTEGER">3</col>
<col id="02" name="field1" type="VARCHAR">Ghi</col>
<col id="03" name="field2" type="VARCHAR">jkl</col>
</row>
</resultset>
</result>
</test>
</sqlunit>
I found the cause of problem with Resultsets.
In File: sqlunit/sqlunit/src/net/sourceforge/sqlunit/handlers/SqlHandler.java
In Method: isMoreResultsAvailable
System ever return False value, but it is the code to return if the system continue read the Resultsets or stop to list them.
I only include validation to not return ever False.
Can anyone explain why this method ever return False? Have any error situation in more then one Resultset?
Follow three files to correct them.
-- Correction Patch
1 - multipleResultSets.patch
-- New Unit Tests to Problem
2 - TestSQLUnit_TestMultipleResultsets.xml
3 - SQLUnit_TestMultipleResultsets.sql
Procedure to Unit Tests of bug correction
Test to verify problem
Patch to correct bug