Home > SQL Developer: Unit Testing > Unit Test Library
The unit testing library enables you to store actions that you can reuse in the definitions of multiple unit tests. These user-defined actions are displayed under the Library node in the Unit Test navigator (which is explained in SQL Developer User Interface for Unit Testing). You can store the following kinds of actions in the library, in the following categories:
Dynamic value queries
Startup actions
Teardown actions
Validation actions
Most categories have subcategories. For example, the Startup Actions node has subnodes for Table or Row Copy and User PL/SQL Code. You can add an entry to the library in the following ways:
Expand the Library hierarchy to display the relevant lowest-level node (such as User PL/SQL Code under Startups); right-click and select Add [action-type]; specify a name for the action; click the name of the newly created action; and complete the specification.
Use the Publish to Library option when specifying the action when you are creating a unit test: enter a name for the action and click Publish. (The action will be added under the appropriate category and subcategory in the Library display in the Unit Test navigator.)
To use an action from the library when you are creating a unit test, select it from the list under Library on the appropriate page in the Unit Testing: Create Unit Test wizard or when you are editing a unit test. When you select an action from the library, you have the following options for incorporating it into the process (startup, teardown, or validation):
Copy: Uses a copy of the action, which you can then edit (for example, to modify the WHERE clause in a User PL/SQL Code procedure). If the action is later changed in the library, it is not automatically re-copied into the process.
Subscribe: Uses the action as stored in the library. (You cannot edit the action in the process if you use the Subscribe option.) If the action is later changed in the library, the changed version is automatically used in the process.
Related Topics