Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 15dbdea

Browse files
committed
Merge branch 'develop' into feature/refactoing_assert_to_expectation
2 parents 8a2267b + adf0aaa commit 15dbdea

3 files changed

Lines changed: 31 additions & 13 deletions

File tree

docs/userguide/install.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ The following tools that support the SQL*Plus commands can be used to run the in
8585
- [SQLcl](http://www.oracle.com/technetwork/developer-tools/sqlcl/overview/index.html)
8686
- [Oracle SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html)
8787

88+
# Additional requirements
89+
90+
In order to use Code Coverage functionality of utPLSQL users executing the tests must have the CREATE privilege on the PLSQL code that the coverage is gathered on.
91+
This is a requirement of [DBMS_PROFILER package](https://docs.oracle.com/cd/E18283_01/appdev.112/e16760/d_profil.htm#i999476).
92+
93+
In practice, user running tests for PLSQL code that he does not own, needs to have CREATE ANY PROCEDURE/CREATE ANY TRIGGER privileges.
94+
Running code coverage on objects that the user does not own will not produce any coverage information without those privileges.
8895

8996
# Uninstalling utPLSQL
9097

source/core/ut_output_buffer.pkb

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,32 @@ create or replace package body ut_output_buffer is
5555
end;
5656

5757
function get_lines(a_reporter_id varchar2, a_timeout_sec naturaln := gc_max_wait_sec) return ut_varchar2_rows pipelined is
58-
pragma autonomous_transaction;
59-
l_results ut_varchar2_rows;
58+
l_buffer_data ut_varchar2_rows;
6059
l_wait_wait_time number(10,1) := 0;
6160
l_finished boolean := false;
62-
begin
63-
loop
61+
function get_data_from_buffer return ut_varchar2_rows is
62+
l_results ut_varchar2_rows;
63+
pragma autonomous_transaction;
64+
begin
6465
delete from (
6566
select *
6667
from ut_output_buffer_tmp where reporter_id = a_reporter_id order by message_id
6768
)
6869
returning text bulk collect into l_results;
69-
70+
commit;
71+
return l_results;
72+
end;
73+
begin
74+
loop
75+
l_buffer_data := get_data_from_buffer();
7076
--nothing fetched from output, wait and try again
71-
if l_results.count = 0 then
77+
if l_buffer_data.count = 0 then
7278
dbms_lock.sleep(gc_sleep_time);
7379
l_wait_wait_time := l_wait_wait_time + gc_sleep_time;
7480
else
75-
commit;
76-
for i in 1 .. l_results.count loop
77-
if l_results(i) is not null then
78-
pipe row(l_results(i));
81+
for i in 1 .. l_buffer_data.count loop
82+
if l_buffer_data(i) is not null then
83+
pipe row(l_buffer_data(i));
7984
else
8085
l_finished := true;
8186
exit;

source/core/ut_suite_manager.pkb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ create or replace package body ut_suite_manager is
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
1717
*/
18-
18+
1919
type t_schema_info is record (changed_at date, obj_cnt integer);
2020

2121
type tt_schema_suites is table of ut_logical_suite index by varchar2(4000 char);
@@ -63,11 +63,17 @@ create or replace package body ut_suite_manager is
6363

6464
l_suite_rollback integer;
6565
l_suite_rollback_annotation varchar2(4000);
66-
66+
e_insufficient_priv exception;
67+
pragma exception_init(e_insufficient_priv,-01031);
6768
begin
6869
l_owner_name := a_owner_name;
6970
l_object_name := a_object_name;
70-
ut_metadata.do_resolve(a_owner => l_owner_name, a_object => l_object_name);
71+
begin
72+
ut_metadata.do_resolve(a_owner => l_owner_name, a_object => l_object_name);
73+
exception
74+
when e_insufficient_priv then
75+
return null;
76+
end;
7177
l_annotation_data := ut_annotations.get_package_annotations(a_owner_name => l_owner_name, a_name => l_object_name);
7278

7379
if l_annotation_data.package_annotations.exists('suite') then

0 commit comments

Comments
 (0)