How to install utPLSQL on Oracle 23ai

utPLSQL is one of the best tools for performing unit tests on applications built on Oracle databases. Today, I want to check if the tool's installation will go smoothly on the latest Oracle 23ai Release.

--------------------------------------------------------------------------------
'Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free'
--------------------------------------------------------------------------------

The following instructions will guide us step by step through the installation of utPLSQL.

DOWNLOADING THE INSTALLATION FILE

You can download the installation file from GitHub. The latest version of the tool can be found at https://github.com/utPLSQL/utPLSQL/releases.
Download the utPLSQL.zip file and extract it to your chosen location on the disk.

Open CMD and change directory to SOURCE

>Cd C:\_monika\utPLSQL\source

Next, log in to the database XEPDB1 using SQL*Plus as the SYS user with SYSDBA privileges:

>sqlplus sys/sys@localhost:PORT/xepdb1 as sysdba



and now we can proceed with the tool's installation:

SQL> @install_headless_with_trigger.sql utp3 utp3 users


The installation parameters are the username, password, and tablespace.


After the installation is complete, we can try logging in as the utp3 user and run a test.
The username and password will be the ones provided during the installation. In the example: utp3/utp3.


Now we can run our first test. Let's check if 2 + 2 equals 4.

-------------------------------------------------------------------------
-- UT001
-------------------------------------------------------------------------
-- test blok anonimowy
declare
nEquation       number;
nExpectedResult number;

  begin 
  nEquation := 2+2;
  nExpectedResult := 4;

    -- porownanie wartosci z wartoscia oczekiwana
    ut.expect(nEquation).to_equal(nExpectedResult);
  end;
  /

SUCCESS

  Actual: 4 (number) was expected to equal: 4 (number)


PL/SQL procedure successfully completed.

Success! 2 + 2 equals 4. We are ready to start creating our first unit tests using utPLSQL!

Stay tuned for more posts with tips and tricks for utPLSQL coming soon :)


Komentarze