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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 30 commits
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
114 changes: 72 additions & 42 deletions source/api/ut.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,10 @@ 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_lines sys_refcursor;
l_line varchar2(4000);
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
begin
run_autonomous(
ut_varchar2_list(),
Expand All @@ -190,13 +192,16 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_lines := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_lines into l_line;
exit when l_lines%notfound;
pipe row(l_line);
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;
end loop;
close l_lines;
close l_data;
end if;
raise_if_packages_invalidated();
return;
Expand All @@ -213,8 +218,10 @@ 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_lines sys_refcursor;
l_line varchar2(4000);
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
begin
run_autonomous(
ut_varchar2_list(),
Expand All @@ -228,13 +235,16 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_lines := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_lines into l_line;
exit when l_lines%notfound;
pipe row(l_line);
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;
end loop;
close l_lines;
close l_data;
end if;
raise_if_packages_invalidated();
return;
Expand All @@ -252,8 +262,10 @@ 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_lines sys_refcursor;
l_line varchar2(4000);
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
begin
run_autonomous(
a_paths,
Expand All @@ -267,13 +279,16 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_lines := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_lines into l_line;
exit when l_lines%notfound;
pipe row(l_line);
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;
end loop;
close l_lines;
close l_data;
end if;
raise_if_packages_invalidated();
return;
Expand All @@ -291,8 +306,10 @@ 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_lines sys_refcursor;
l_line varchar2(4000);
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
begin
run_autonomous(
a_paths,
Expand All @@ -306,13 +323,16 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_lines := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_lines into l_line;
exit when l_lines%notfound;
pipe row(l_line);
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;
end loop;
close l_lines;
close l_data;
end if;
raise_if_packages_invalidated();
return;
Expand All @@ -330,8 +350,10 @@ 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_lines sys_refcursor;
l_line varchar2(4000);
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
begin
run_autonomous(
ut_varchar2_list(a_path),
Expand All @@ -345,13 +367,16 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_lines := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_lines into l_line;
exit when l_lines%notfound;
pipe row(l_line);
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;
end loop;
close l_lines;
close l_data;
end if;
raise_if_packages_invalidated();
return;
Expand All @@ -369,8 +394,10 @@ 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_lines sys_refcursor;
l_line varchar2(4000);
l_data sys_refcursor;
l_clob clob;
l_item_type varchar2(32767);
l_lines ut_varchar2_list;
begin
run_autonomous(
ut_varchar2_list(a_path),
Expand All @@ -384,13 +411,16 @@ create or replace package body ut is
a_client_character_set
);
if l_reporter is of (ut_output_reporter_base) then
l_lines := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
l_data := treat(l_reporter as ut_output_reporter_base).get_lines_cursor();
loop
fetch l_lines into l_line;
exit when l_lines%notfound;
pipe row(l_line);
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;
end loop;
close l_lines;
close l_data;
end if;
raise_if_packages_invalidated();
return;
Expand Down
7 changes: 4 additions & 3 deletions source/core/output_buffers/ut_output_buffer_base.tps
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ create or replace type ut_output_buffer_base authid definer as object(
output_id raw(32),
member procedure init(self in out nocopy ut_output_buffer_base),
not instantiable member procedure close(self in ut_output_buffer_base),
not instantiable member procedure send_line(self in ut_output_buffer_base, a_text varchar2),
not instantiable member procedure send_lines(self in ut_output_buffer_base, a_text_list ut_varchar2_rows),
not instantiable member function get_lines(a_initial_timeout natural := null, a_timeout_sec natural := null) return ut_varchar2_rows pipelined,
not instantiable member procedure send_line(self in ut_output_buffer_base, a_text varchar2, a_item_type varchar2 := null),
not instantiable member procedure send_lines(self in ut_output_buffer_base, a_text_list ut_varchar2_rows, a_item_type varchar2 := null),
not instantiable member procedure send_clob(self in ut_output_buffer_base, a_text clob, a_item_type varchar2 := null),
not instantiable member function get_lines(a_initial_timeout natural := null, a_timeout_sec natural := null) return ut_output_data_rows pipelined,
not instantiable member function get_lines_cursor(a_initial_timeout natural := null, a_timeout_sec natural := null) return sys_refcursor,
not instantiable member procedure lines_to_dbms_output(self in ut_output_buffer_base, a_initial_timeout natural := null, a_timeout_sec natural := null)
) not final not instantiable
Expand Down
5 changes: 4 additions & 1 deletion source/core/output_buffers/ut_output_buffer_tmp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ create table ut_output_buffer_tmp$(
*/
output_id raw(32) not null,
message_id number(38,0) not null,
text varchar2(4000),
text clob,
item_type varchar2(1000),
is_finished number(1,0) default 0 not null,
constraint ut_output_buffer_tmp_pk primary key(output_id, message_id),
constraint ut_output_buffer_tmp_ck check(is_finished = 0 and text is not null or is_finished = 1 and text is null),
constraint ut_output_buffer_fk1 foreign key (output_id) references ut_output_buffer_info_tmp$(output_id)
) organization index overflow nologging initrans 100
lob(text) store as securefile ut_output_text(retention none)
;

-- This is needed to be EBR ready as editioning view can only be created by edition enabled user
Expand Down Expand Up @@ -58,6 +60,7 @@ limitations under the License.
select output_id
,message_id
,text
,item_type
,is_finished
from ut_output_buffer_tmp$';

Expand Down
21 changes: 21 additions & 0 deletions source/core/output_buffers/ut_output_data_row.tps
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
create or replace type ut_output_data_row as object (
/*
utPLSQL - Version 3
Copyright 2016 - 2018 utPLSQL Project

Licensed under the Apache License, Version 2.0 (the "License"):
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
text clob,
item_type varchar2(1000)
)
/
19 changes: 19 additions & 0 deletions source/core/output_buffers/ut_output_data_rows.tps
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
create or replace type ut_output_data_rows as
/*
utPLSQL - Version 3
Copyright 2016 - 2018 utPLSQL Project

Licensed under the Apache License, Version 2.0 (the "License"):
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
table of ut_output_data_row
/
Loading