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

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b1f6323
Initial, incomplete version of reporter
PhilippSalvisberg Dec 17, 2018
e83eeaf
added grants ans synonyms for ut_sqldev_reporter
PhilippSalvisberg Dec 17, 2018
99c1d31
rename ut_sqldev_reporter to ut_realtime_reporter
PhilippSalvisberg Dec 27, 2018
6531e08
add initial test suite for ut_realtime_reporter
PhilippSalvisberg Dec 28, 2018
28a1a73
install test_realtime_reporter
PhilippSalvisberg Dec 28, 2018
010b8fd
add ut_realtime_reporter to list of core reporters
PhilippSalvisberg Dec 28, 2018
9e79e6f
use print_xml_fragment for pretty printing
PhilippSalvisberg Dec 28, 2018
4b29c56
changed formatting and comments
PhilippSalvisberg Dec 28, 2018
2f22a89
new XML report format, using XML attributes for id only
PhilippSalvisberg Dec 28, 2018
d45c88c
extended unit test, reasonable coverage, helps understanding the repo…
PhilippSalvisberg Dec 28, 2018
b37b188
enable drop of test packages
PhilippSalvisberg Dec 28, 2018
8c1c561
remove hard-coded owner ut3_tester
PhilippSalvisberg Dec 28, 2018
bcf1606
make complete event a.s.a.p. visible in consuming session
PhilippSalvisberg Dec 28, 2018
d4b09c7
fix incompatibility to 12.1
PhilippSalvisberg Dec 29, 2018
c2cc292
Fixed typos in comments and made comments more precise.
PhilippSalvisberg Dec 29, 2018
0c6a0ad
get_description synchronized with type specification.
PhilippSalvisberg Dec 29, 2018
7134f13
use print_end_node to close tags
PhilippSalvisberg Dec 29, 2018
2577566
removed duplicate line feed
PhilippSalvisberg Dec 29, 2018
1672248
removed duplicate line feed
PhilippSalvisberg Dec 29, 2018
42cf8ee
change description of the tests to reflect the requirements as sugges…
PhilippSalvisberg Dec 29, 2018
6512cf8
replace granular self.print_text_lines calls with a few self.print_te…
PhilippSalvisberg Dec 29, 2018
c1273af
added text_xmltype_list collection type for test_realtime_reporter
PhilippSalvisberg Dec 29, 2018
b05760d
install new collection type test_xmltype_list for test_realtime_reporter
PhilippSalvisberg Dec 29, 2018
93e4ea8
add xml_header attribute, used for each produced document
PhilippSalvisberg Dec 29, 2018
290ca30
replace hard-coded id attribute with name and value for an optional a…
PhilippSalvisberg Dec 29, 2018
e570e48
produce an XML document for each event resulting in a new output stru…
PhilippSalvisberg Dec 29, 2018
17ed198
changed name and description to match new output structure
PhilippSalvisberg Dec 29, 2018
eef5938
test 26 event-based XML documents produced by the revised reporter
PhilippSalvisberg Dec 29, 2018
eba2e9e
change comment to reflect new role of the member procedure
PhilippSalvisberg Dec 30, 2018
8f5b736
Added `item_type` attribute to output buffer.
jgebal Dec 30, 2018
e02d238
Added `item_type` attribute to output reporters.
jgebal Dec 30, 2018
fc0f0e9
Fixed failing examples.
jgebal Dec 30, 2018
fb96511
create object type and collection type for test_realtime_reporter
PhilippSalvisberg Dec 31, 2018
957e5c9
produce 1 row per event document using new output buffer
PhilippSalvisberg Dec 31, 2018
f992193
renamed package persistent variable
PhilippSalvisberg Dec 31, 2018
576b8ea
Fix crash due to null value.
PhilippSalvisberg Dec 31, 2018
73669eb
Fixed issues with nested runs
PhilippSalvisberg Jan 1, 2019
cc3a7e4
Extracted duplicated code from pipelined functions into `get_report_o…
jgebal Jan 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Extracted duplicated code from pipelined functions into `get_report_o…
…utputs` iterator function.
  • Loading branch information
jgebal committed Jan 1, 2019
commit cc3a7e4e23f0b4885c8db00706878e609189f4b1
126 changes: 47 additions & 79 deletions source/api/ut.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ create or replace package body ut is
g_nls_date_format varchar2(4000);
gc_fail_on_errors constant boolean := false;

g_result_line_no binary_integer;
g_result_lines ut_varchar2_list := ut_varchar2_list();

function version return varchar2 is
begin
return ut_runner.version();
Expand Down Expand Up @@ -164,6 +167,31 @@ create or replace package body ut is
rollback;
end;

function get_report_outputs( a_cursor sys_refcursor ) return varchar2 is
l_clob clob;
l_item_type varchar2(32767);
l_result varchar2(4000);
begin
if g_result_line_no is null then
fetch a_cursor into l_clob, l_item_type;
if a_cursor%notfound then
close a_cursor;
g_result_line_no := null;
g_result_lines := ut_varchar2_list();
raise_if_packages_invalidated();
raise no_data_found;
end if;
g_result_lines := ut_utils.clob_to_table(l_clob, ut_utils.gc_max_storage_varchar2_len);
g_result_line_no := g_result_lines.first;
end if;

if g_result_line_no is not null then
l_result := g_result_lines(g_result_line_no);
g_result_line_no := g_result_lines.next(g_result_line_no);
end if;
return l_result;
end;

function run(
a_reporter ut_reporter_base := null,
a_color_console integer := 0,
Expand All @@ -175,10 +203,7 @@ create or replace package body ut is
a_client_character_set varchar2 := null
) return ut_varchar2_rows pipelined is
l_reporter ut_reporter_base := a_reporter;
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
l_results sys_refcursor;
begin
run_autonomous(
ut_varchar2_list(),
Expand All @@ -192,18 +217,11 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_results := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_data into l_clob, l_item_type;
exit when l_data%notfound;
l_lines := ut_utils.clob_to_table(l_clob, ut_utils.gc_max_storage_varchar2_len);
for i in 1 .. l_lines.count loop
pipe row(l_lines(i));
end loop;
pipe row( get_report_outputs( l_results ) );
end loop;
close l_data;
end if;
raise_if_packages_invalidated();
return;
end;

Expand All @@ -218,10 +236,7 @@ create or replace package body ut is
a_client_character_set varchar2 := null
) return ut_varchar2_rows pipelined is
l_reporter ut_reporter_base := a_reporter;
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
l_results sys_refcursor;
begin
run_autonomous(
ut_varchar2_list(),
Expand All @@ -235,18 +250,11 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_results := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_data into l_clob, l_item_type;
exit when l_data%notfound;
l_lines := ut_utils.clob_to_table(l_clob, ut_utils.gc_max_storage_varchar2_len);
for i in 1 .. l_lines.count loop
pipe row(l_lines(i));
end loop;
pipe row( get_report_outputs( l_results ) );
end loop;
close l_data;
end if;
raise_if_packages_invalidated();
return;
end;

Expand All @@ -262,10 +270,7 @@ create or replace package body ut is
a_client_character_set varchar2 := null
) return ut_varchar2_rows pipelined is
l_reporter ut_reporter_base := a_reporter;
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
l_results sys_refcursor;
begin
run_autonomous(
a_paths,
Expand All @@ -279,18 +284,11 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_results := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_data into l_clob, l_item_type;
exit when l_data%notfound;
l_lines := ut_utils.clob_to_table(l_clob, ut_utils.gc_max_storage_varchar2_len);
for i in 1 .. l_lines.count loop
pipe row(l_lines(i));
end loop;
pipe row( get_report_outputs( l_results ) );
end loop;
close l_data;
end if;
raise_if_packages_invalidated();
return;
end;

Expand All @@ -306,10 +304,7 @@ create or replace package body ut is
a_client_character_set varchar2 := null
) return ut_varchar2_rows pipelined is
l_reporter ut_reporter_base := a_reporter;
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
l_results sys_refcursor;
begin
run_autonomous(
a_paths,
Expand All @@ -323,18 +318,11 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_results := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_data into l_clob, l_item_type;
exit when l_data%notfound;
l_lines := ut_utils.clob_to_table(l_clob, ut_utils.gc_max_storage_varchar2_len);
for i in 1 .. l_lines.count loop
pipe row(l_lines(i));
end loop;
pipe row( get_report_outputs( l_results ) );
end loop;
close l_data;
end if;
raise_if_packages_invalidated();
return;
end;

Expand All @@ -349,11 +337,8 @@ create or replace package body ut is
a_exclude_objects ut_varchar2_list := null,
a_client_character_set varchar2 := null
) return ut_varchar2_rows pipelined is
l_reporter ut_reporter_base := a_reporter;
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
l_reporter ut_reporter_base := a_reporter;
l_results sys_refcursor;
begin
run_autonomous(
ut_varchar2_list(a_path),
Expand All @@ -367,18 +352,11 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_results := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_data into l_clob, l_item_type;
exit when l_data%notfound;
l_lines := ut_utils.clob_to_table(l_clob, ut_utils.gc_max_storage_varchar2_len);
for i in 1 .. l_lines.count loop
pipe row(l_lines(i));
end loop;
pipe row( get_report_outputs( l_results ) );
end loop;
close l_data;
end if;
raise_if_packages_invalidated();
return;
end;

Expand All @@ -394,10 +372,7 @@ create or replace package body ut is
a_client_character_set varchar2 := null
) return ut_varchar2_rows pipelined is
l_reporter ut_reporter_base := a_reporter;
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
l_results sys_refcursor;
begin
run_autonomous(
ut_varchar2_list(a_path),
Expand All @@ -411,18 +386,11 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_results := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_data into l_clob, l_item_type;
exit when l_data%notfound;
l_lines := ut_utils.clob_to_table(l_clob, ut_utils.gc_max_storage_varchar2_len);
for i in 1 .. l_lines.count loop
pipe row(l_lines(i));
end loop;
pipe row( get_report_outputs( l_results ) );
end loop;
close l_data;
end if;
raise_if_packages_invalidated();
return;
end;

Expand Down