Command-Line Interface for Unit Testing

As an alternative to using the SQL Developer graphical interface for to running unit tests and suites, and exporting and importing unit test objects, you can use the command line, which is explained in Command-Line Interface for SQL Developer.

When running a unit test from the command-line interface, you can use the following parameters:

The following example runs a unit test named AWARD_BONUS in a Windows environment where SQL Developer is installed under C:\. (Note that test and suite names are case sensitive for the command-line interface.) This example uses the repository connection for user unit_test_repos and runs the test as user fred.

> cd c:\sqldeveloper\sqldeveloper\bin
> sdcli unittest -run -test -name AWARD_BONUS -repo unit_test_repos -db fred

The following example exports a unit test named AWARD_BONUS. It uses the repository connection for user unit_test_repos and stores the exported definitions in the file C:\ut_xml\award_bonus_test.xml.

> sdcli unittest -exp -test -name AWARD_BONUS -repo unit_test_repos -file c:\ut_xml\award_bonus_test.xml

The following example imports object definitions from the file C:\ut_xml\award_bonus_suite.xml. It uses the repository connection for user unit_test_repos.

> sdcli unittest -imp -repo unit_test_repos -file c:\ut_xml\award_bonus_suite.xml

To check the results of any tests or suites that you run from the command line, you can start SQL Developer and view the All Test Runs and All Suite Runs reports (see Unit Test Reports).

Related Topics

SQL Developer: Unit Testing

Command-Line Interface for SQL Developer