I just started using the unit test frame work in SQL Developer 3 EA 1 and I need some help defining a test case involving parent - child tables that are manipulated using a plsql API. The API for the child table requires the key of a record in the parent table. The parent record, and its key, is created by a test case startup process. The key is retrieved using a dynamic value query in the test implementation. It appears the dynamic value query is executed before the test case startup processes have been executed. Is this expected behaviour? My expectation is the startup processes are executed before the dynamic values query.
Also, is it possible to use values from the startup processes as parameter values of the test case other than using a dynamic value query?
Test case summary:
2 Startup processes: The first deletes all data from parent and child tables. The second inserts in a record into the parent table.
Zero Teardown processes.
Test implementation: Dynamic value query that selects the key from the parent table and defines literals for the remaining parameters of the test case.
1 Process validation: Test whether a record has been inserted into the childe table with the expected values.
Hi Alistair -
We execute the dynamic query to control how many times the test (start up, test case, validation, tear down) cycle executes.
To get the behavior you want, put the test in a test suite and have the test suite start up do the table initialization for you.
SQL Developer Team