Hi All,
I'm trying to test the function (SQLUnit 5.0, Oracle 10g)
--- Oracle PL/SQL code ---
function getMetadataFieldsInfo(p_ObjectType varchar2)
return FieldInfoCursor is
ret FieldInfoCursor;
l FieldInfoType;
begin
if p_ObjectType is not null then
open ret for
select 'aaa' cFldName, 'ddd' cFldType, 1 isReference from dual;
end if;
return ret;
end;
-----
Result looks somewhat strange:
----------
[sqlunit] *** Running SQLUnit file: C:\Documents and Settings\Yaroslav\workspace\Migrator\sripts\packages\MIGRATOR_MAPPING\getmetadatafieldsinfo.xml
[sqlunit] Getting connection(1)
[sqlunit] Setting up test...
[sqlunit] Running test[1]: STAGE.gasdiststat input (0ms)
[sqlunit] org.jdom.Element.addContent(Lorg/jdom/Element;)Lorg/jdom/Element;
[sqlunit] Tearing down test...
[sqlunit] sqlunit-ant: SQLUnit Tests Failed: In file: C:....
-------------
It looks like the string
... [sqlunit] org.jdom.Element.addContent(Lorg/jdom/Element;)Lorg/jdom/Element;...
subsitutes the actual output from the function (the same problem arises during any test failure - the string org.jdom.Element.addContent... arises instead of failure report).
What is the right syntax for testing REF CURSOR output?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This seems to be the same problem as the one with the <result echo="true" />, but I cannot reproduce this, perhaps my test case is too simplistic. Can you provide the test in that thread?
Thanks
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
I'm trying to test the function (SQLUnit 5.0, Oracle 10g)
--- Oracle PL/SQL code ---
function getMetadataFieldsInfo(p_ObjectType varchar2)
return FieldInfoCursor is
ret FieldInfoCursor;
l FieldInfoType;
begin
if p_ObjectType is not null then
open ret for
select 'aaa' cFldName, 'ddd' cFldType, 1 isReference from dual;
end if;
return ret;
end;
-----
Test code:
-----
<connection reconnect-on-failure="on"
extern="sqlunit-connection.properties" connection-id="1" />
<test name="STAGE.gasdiststat input">
<call connection-id="1">
<stmt>{?=call getmetadatafieldsinfo(?)}</stmt>
<param id="1" type="CURSOR" inout="out" name="res" is-null="true"/>
<param id="2" type="VARCHAR" inout="in" name="p_objecttype">STAGE.gasdiststat</param>
</call>
<result echo="false">
<outparam id="1" type="CURSOR">
<resultset id="1" partial="false" rowcount="1"/>
</outparam>
</result>
</test>
------
Result looks somewhat strange:
----------
[sqlunit] *** Running SQLUnit file: C:\Documents and Settings\Yaroslav\workspace\Migrator\sripts\packages\MIGRATOR_MAPPING\getmetadatafieldsinfo.xml
[sqlunit] Getting connection(1)
[sqlunit] Setting up test...
[sqlunit] Running test[1]: STAGE.gasdiststat input (0ms)
[sqlunit] org.jdom.Element.addContent(Lorg/jdom/Element;)Lorg/jdom/Element;
[sqlunit] Tearing down test...
[sqlunit] sqlunit-ant: SQLUnit Tests Failed: In file: C:....
-------------
It looks like the string
... [sqlunit] org.jdom.Element.addContent(Lorg/jdom/Element;)Lorg/jdom/Element;...
subsitutes the actual output from the function (the same problem arises during any test failure - the string org.jdom.Element.addContent... arises instead of failure report).
What is the right syntax for testing REF CURSOR output?
The problem does not appear with SQLUnit version 4.9
This seems to be the same problem as the one with the <result echo="true" />, but I cannot reproduce this, perhaps my test case is too simplistic. Can you provide the test in that thread?
Thanks
-sujit