Home > SQL Developer: Unit Testing > Command-Line Interface for ...
In addition to running unit tests and suites, and exporting and importing unit test objects, within the SQL Developer graphical interface, you can use the ututil
batch file (Windows) or shell script (Linux) on the operating system command line. ututil
is located in the sqldeveloper\sqldeveloper\bin
folder or sqldeveloper/sqldeveloper/bin
directory under the location where you installed SQL Developer.
ututil.bat
or ututil.sh
accepts these commands: run
to run a test or suite, exp
to perform an export operation, and imp
to perform an import operation. For detailed information about the syntax and options, start by running ututil
without any parameters at the system command prompt. For example:
C:\Program Files\sqldeveloper\sqldeveloper\bin>ututil ututil -run ? ututil -exp ? ututil -imp ?
Then enter the command for information about the command that you want to use. For example: ututil -run ?
The ututil -run
command includes the following parameters:
-db <connection name>
specifies the database connection associated with the database user to be used for running the unit test.
-repo <connection name>
specifies the database connection associated with the unit testing repository to be used for running the unit test.
{-log <0,1,2,3>}
specifies the logging level, where:
0 = No logging (the default).
1 = Report the status.
2 = Report the status and error message.
3 = Report the status, error message, and return ID value.
{-return <return id>}
specifies the return ID value, which is used as the primary key in the results table, and which will allow automation tools to query the results from the database.
The following example runs a unit test named AWARD_BONUS in a Windows environment where SQL Developer is installed under Program Files. (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:\Program Files\sqldeveloper\sqldeveloper\bin > ututil -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
.
> ututil -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.
> ututil -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