PLUTO - PL/SQL Unit Testing for Oracle
PLUTO is a light-weight PL/SQL-based unit testing framework for Oracle. The framework is loosely based on the popluar JUnit framework for Java development. PLUTO takes advantage of Oracle's Object-Oriented development features and offers a base object from which custom unit test objects can be derived.
The core of PLUTO is consists of just two objects: one nested table that is used by the PLUTO_OBJ to pass around testing procedure names and then the PLUTO_OBJ itself.
PLUTO provides one primary 'public' procedure: run_tests. This procedure looks at your object's inheritance chain and pulls out all of the procedures that are named like 'STARTUP%', 'SHUTDOWN%', 'SETUP%', 'TEARDOWN%', 'TEST%'. It then runs these as you'd probably expect:
all startup procedures are executed only once at the start of the run
all shutdown procedures are executed only once at the end of the run
all setup procedures are executed once before each test procedure runs
all teardown procedures are executed once after each test procedure runs
all test procedures are executed once
For an example on how to write your tests, check out the examples/
directory.
Installation is easy, just navigate to the base directory of this uncompressed archive and run:
sqlplus @install.sql
The user that you install PLUTO as should have a few privledges, specificially 'create session' and 'create type'.
SQL> create user pluto identified by pluto;
User created.
SQL> grant create session to pluto;
Grant succeeded.
SQL> grant create type to pluto;
Grant succeeded.
That should do the trick.
If you want to run the test suite, you'll need a few more privledges.
SQL> grant create table to pluto;
Grant succeeded.
SQL> alter user pluto quota unlimited on users;
User altered.
All source in this distribution has been released under the GPL Version 2 and the Artistic License.
This code is distributed as-is with no warranty, actual or implied.
This software does not come with any official support; however, bug reports, suggestions, and patches are welcome.
Josh McAdams Contact via gmail.com address: joshua.mcadams+pluto