Cannot execute stored procedures - advise appreciated!

424 views
Skip to first unread message

Sandra Wheeler

unread,
Feb 8, 2012, 9:57:15 PM2/8/12
to dbfit
Hello!

I'm new to dbFit and FitNesse and while I have managed to get simple
tests working in an Oracle 10g environment (connecting to db, querying
db, simple parameters) I have not been able to run the Execute
Procedure successfully. This functionality is the primary goal for us
in using dbFit so this has been somewhat disappointing.

I have tried the syntax described this post
http://groups.google.com/group/dbfit/browse_thread/thread/018c8c879edcd2eb.
No matter what I try, I receive a NullPointerException error along
with 'cannot find parameter'.

Additionally, I get an additional error if the return type is a
boolean, that it is not supported. I saw a post from quite some time
ago where a chap was asking for the boolean type to be added to dbfit
for Oracle. Was this done?

I'd appreciate some advice from users who have this functionality
working, even some code snippets that work would be helpful.

For example: the function FORMAT_IP_ADDRESS_FOR_SORTING is stored in
the database as part of a package. It takes an input parameter and
returns the formatted string. From the documentation, my code is:

!|Execute Procedure|COMMON_RULES_MGR.FORMAT_IP_ADDRESS_FOR_SORTING|
|reformat_ip|?|
|010.001.002.003|10.1.2.3|

The stack trace I get on this is:
Execute Procedure

java.lang.NullPointerException at
dbfit.fixture.ExecuteProcedure.doTable(ExecuteProcedure.java:114) at
fitlibrary.traverse.AlienTraverseHandler.doTable(AlienTraverseHandler.java:
18) at
fitlibrary.traverse.workflow.DoTraverse.interpretWholeTable(DoTraverse.java:
98) at fitlibrary.DoFixture.interpretWholeTable(DoFixture.java:63) at
fitlibrary.suite.InFlowPageRunner.run(InFlowPageRunner.java:39) at
fitlibrary.DoFixture.interpretTables(DoFixture.java:40) at
dbfit.DatabaseTest.interpretTables(DatabaseTest.java:24) at
fit.Fixture.doTables(Fixture.java:75) at
fit.FitServer.process(FitServer.java:76) at
fit.FitServer.run(FitServer.java:52) at
fit.FitServer.main(FitServer.java:43)

COMMON_RULES_MGR.FORMAT_IP_ADDRESS_FOR_SORTING
reformat_ip

java.sql.SQLException: Cannot find parameter for column 0
name="reformat_ip" at
dbfit.fixture.ExecuteProcedure.initParameters(ExecuteProcedure.java:
179) at
dbfit.fixture.ExecuteProcedure.executeStatementForEachRow(ExecuteProcedure.java:
154) at dbfit.fixture.ExecuteProcedure.doRows(ExecuteProcedure.java:
127) at fit.Fixture.doTable(Fixture.java:162) at
dbfit.fixture.ExecuteProcedure.doTable(ExecuteProcedure.java:112) at
fitlibrary.traverse.AlienTraverseHandler.doTable(AlienTraverseHandler.java:
18) at
fitlibrary.traverse.workflow.DoTraverse.interpretWholeTable(DoTraverse.java:
98) at fitlibrary.DoFixture.interpretWholeTable(DoFixture.java:63) at
fitlibrary.suite.InFlowPageRunner.run(InFlowPageRunner.java:39) at
fitlibrary.DoFixture.interpretTables(DoFixture.java:40) at
dbfit.DatabaseTest.interpretTables(DatabaseTest.java:24) at
fit.Fixture.doTables(Fixture.java:75) at
fit.FitServer.process(FitServer.java:76) at
fit.FitServer.run(FitServer.java:52) at
fit.FitServer.main(FitServer.java:43)

?
010.001.002.003 10.1.2.3


Regards,

Sandra

MatMan

unread,
Feb 9, 2012, 7:04:50 PM2/9/12
to dbfit
Take a look at the Acceotance tests for Oracle. There's a link on the
front page.

Darek Mankowski

unread,
Feb 10, 2012, 5:49:55 PM2/10/12
to dbfit
Hi Sandra,

I just checked some code I used in the past and it is still working. I
can give 2 examples: a function and a procedure (both parts of a
package). First is the declaration in Oracle, then how I called it
from DBFit. It seems to be the same format you use.
Regards,
Darek

FUNCTION get_request_status_by_id (
p_request_id request.request_id
%TYPE)
RETURN VARCHAR2;

PROCEDURE get_requests_by_id (
p_request_id IN request.request_id%TYPE,
p_request_info_cur OUT request_info_curtype,
p_error_txt OUT VARCHAR2 -- NULL if no
errors.
);

!|Execute Procedure|pkg_ws_processing.get_request_status_by_id|
|p_request_id|?|
|-106|OK|

!|Execute Procedure|pkg_ws_queries.get_requests_by_id|
|p_request_id|p_request_info_cur?|p_error_txt?|
|-106|>>v_cursor|NULL|


On Feb 8, 9:57 pm, Sandra Wheeler <wheele...@gmail.com> wrote:
> Hello!
>
> I'm new to dbFit and FitNesse and while I have managed to get simple
> tests working in an Oracle 10g environment (connecting to db, querying
> db, simple parameters) I have not been able to run the Execute
> Procedure successfully. This functionality is the primary goal for us
> in using dbFit so this has been somewhat disappointing.
>
> I have tried the syntax described this posthttp://groups.google.com/group/dbfit/browse_thread/thread/018c8c879ed....
> dbfit.fixture.ExecuteProcedure.executeStatementForEachRow(ExecuteProcedure.­java:
Reply all
Reply to author
Forward
0 new messages