Skip to main content

Unresolved utPLSQL setup and cleanup references

ZPA rule for PL/SQL and Oracle SQL · UnresolvedUtPlSqlSetupCleanupReference

utPLSQL runs the procedures named in setup and cleanup annotations (%beforeall(proc), %aftereach(proc)...) as package procedure calls without arguments. When the name does not resolve to such a procedure, the setup or cleanup does not run, though the package compiles.

This rule reports a setup or cleanup reference that resolves to no public procedure of the analyzed package specifications, or to one that cannot be called without arguments, or to more than one. A package that is not in the analyzed project may exist in the database: a reference to it is not reported.

Examples​

Noncompliant Code Example
create package crate_test as
--%suite
--%beforeall(load_crates) -- Noncompliant

--%test(Creates a crate)
procedure creates_crate;
end;
Compliant Solution
create package crate_test as
--%suite
--%beforeall(load_crates)

--%test(Creates a crate)
procedure creates_crate;
procedure load_crates;
end;