I need to test a packaged procedure's output, according to a specific value in a database table. So, I created a test which:
It seems that the database value is never commited and so the packaged procedure returns always the same value. Here is the test:
!path lib/*.jar
!|dbfit.OracleTest|
!|ConnectUsingFile|DBConnections/DBConnection.properties|
|set option|fixed length string parsing|true|
|Update|my_table|
|col_value=|col_name|
|NULL|val|
|Commit|
!|Execute Procedure|pckg.proc|
|birth_date_|gender_|first_name_|last_name_|?|
|NULL|F|Rita|Rita|>>ref_cur1|
|Update|my_table|
|col_value=|col_name|
|N|val|
|Commit|
!|Execute Procedure|pckg.proc|
|birth_date_|gender_|first_name_|last_name_|?|
|NULL|F|Rita|Rita|>>ref_cur2|
!2.4. Compare expected values and actual values
!|Query|<<ref_cur1|
|j_status|
|-32|
!|Query|<<ref_cur2|
|j_status|
|-39|
|Rollback|
The problem is that it always return the same status, according to the value of the database column before the test starts. If it is NULL from the beginning, then both return values are -39 and if it is 'N' from the beginning, then both return values are -32.
Any ideas on how to persist the changes?
Well I got the answer and it is that I have to change the
|Update|my_table|
part to be
!|Execute|update my_table set .....|
and then I don't need
|Commit|