You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/core/types/ut_path_item.tpb
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -15,27 +15,30 @@ create or replace type body ut_path_item as
15
15
See the License for the specific language governing permissions and
16
16
limitations under the License.
17
17
*/
18
-
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2) return self as result is
18
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2, originated_path varchar2) return self as result is
19
19
begin
20
20
self.schema_name := schema_name;
21
21
self.object_name := object_name;
22
22
self.procedure_name := procedure_name;
23
+
self.originated_path := originated_path;
23
24
return;
24
25
end;
25
26
26
-
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2,suite_path varchar2) return self as result is
27
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2,suite_path varchar2, originated_path varchar2) return self as result is
27
28
begin
28
29
self.schema_name := schema_name;
29
30
self.suite_path := suite_path;
31
+
self.originated_path := originated_path;
30
32
return;
31
33
end;
32
34
33
-
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2,suite_path varchar2) return self as result is
35
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2,suite_path varchar2, originated_path varchar2) return self as result is
Copy file name to clipboardExpand all lines: source/core/types/ut_path_item.tps
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,13 @@ create or replace type ut_path_item as object (
15
15
See the License for the specific language governing permissions and
16
16
limitations under the License.
17
17
*/
18
-
schema_name varchar2(4000),
19
-
object_name varchar2(250),
20
-
procedure_name varchar2(250),
21
-
suite_path varchar2(4000),
22
-
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2) return self as result,
23
-
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2,suite_path varchar2) return self as result,
24
-
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2,suite_path varchar2) return self as result
18
+
schema_name varchar2(4000),
19
+
object_name varchar2(250),
20
+
procedure_name varchar2(250),
21
+
suite_path varchar2(4000),
22
+
originated_path varchar2(4000),
23
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2, originated_path varchar2) return self as result,
24
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, suite_path varchar2, originated_path varchar2) return self as result,
25
+
constructor function ut_path_item(self in out nocopy ut_path_item, schema_name varchar2, object_name varchar2,procedure_name varchar2,suite_path varchar2, originated_path varchar2) return self as result
@@ -359,41 +361,50 @@ create or replace package body ut_suite_cache_manager is
359
361
l_schema_paths ut_path_items:= ut_path_items();
360
362
begin
361
363
with paths_to_expand as (
362
-
select /*+ no_parallel */ min(path) as suite_path,sp.schema_name as schema_name,nvl(sp.object_name,c.object_name) as object_name,sp.procedure_name as procedure_name
363
-
from ut_suite_cache c,
364
-
table(a_schema_paths) sp
365
-
where c.object_owner = upper(sp.schema_name)
366
-
and c.object_name like nvl(replace(upper(sp.object_name),'*','%'),c.object_name)
367
-
and c.name like nvl(replace(upper(sp.procedure_name),'*','%'), c.name)
368
-
and sp.suite_path is null
369
-
group by sp.schema_name,nvl(sp.object_name,c.object_name),sp.procedure_name
364
+
select /*+ no_parallel */ min(path) as suite_path,sp.schema_name as schema_name,nvl(sp.object_name,c.object_name) as object_name,
365
+
sp.procedure_name as procedure_name,sp.originated_path
366
+
from table(a_schema_paths) sp left outer join ut_suite_cache c
367
+
on ( c.object_owner = upper(sp.schema_name)
368
+
and c.object_name like replace(upper(sp.object_name),'*','%')
369
+
and c.name like nvl(replace(upper(sp.procedure_name),'*','%'), c.name))
370
+
where sp.suite_path is null
371
+
and sp.object_name is not null
372
+
group by sp.schema_name,nvl(sp.object_name,c.object_name),sp.procedure_name,sp.originated_path
370
373
union all
371
-
select /*+ no_parallel */ c.path as suite_path,sp.schema_name,sp.object_name,sp.procedure_name as procedure_name
372
-
from
373
-
ut_suite_cache c,
374
-
table(a_schema_paths) sp
375
-
where c.object_owner = upper(sp.schema_name)
376
-
and sp.suite_path is not null
377
-
and instr(sp.suite_path,'*') > 0
378
-
and c.path like replace(sp.suite_path,'*','%')
374
+
select /*+ no_parallel */ c.path as suite_path,sp.schema_name,sp.object_name,sp.procedure_name as procedure_name,sp.originated_path
375
+
from
376
+
table(a_schema_paths) sp left outer join ut_suite_cache c on
377
+
( c.object_owner = upper(sp.schema_name)
378
+
and sp.suite_path is not null
379
+
and instr(sp.suite_path,'*') > 0)
380
+
where c.path like replace(sp.suite_path,'*','%')
379
381
union all
380
-
select /*+ no_parallel */ sp.suite_path as suite_path,sp.schema_name,sp.object_name,sp.procedure_name as procedure_name
381
-
from table(a_schema_paths) sp
382
+
select /*+ no_parallel */ sp.suite_path as suite_path,sp.schema_name,sp.object_name,sp.procedure_name as procedure_name,sp.originated_path
383
+
from table(a_schema_paths) sp
382
384
where sp.suite_path is not null
383
-
and instr(sp.suite_path,'*') = 0
385
+
and instr(sp.suite_path,'*') = 0
386
+
union all
387
+
select /*+ no_parallel */ sp.suite_path as suite_path,sp.schema_name,sp.object_name,sp.procedure_name as procedure_name,sp.originated_path
388
+
from table(a_schema_paths) sp
389
+
where sp.suite_path is null and sp.object_name is null
select /*+ no_parallel */ c.* from table(l_unfiltered_rows) c;
346
+
select /*+ no_parallel */ c.* from table(a_unfiltered_rows) c;
360
347
else
361
348
open l_result for
362
-
select /*+ no_parallel */ c.* from table(l_unfiltered_rows) c
349
+
select /*+ no_parallel */ c.* from table(a_unfiltered_rows) c
363
350
where sys_context( 'userenv', 'current_user' ) = upper(c.object_owner)
364
351
union all
365
-
select /*+ no_parallel */ c.* from table(l_unfiltered_rows) c
352
+
select /*+ no_parallel */ c.* from table(a_unfiltered_rows) c
366
353
where sys_context( 'userenv', 'current_user' ) != upper(c.object_owner)
367
354
and ( exists
368
355
( select 1
@@ -371,13 +358,61 @@ create or replace package body ut_suite_manager is
371
358
and a.owner = c.object_owner
372
359
and a.object_type = 'PACKAGE'
373
360
)
374
-
or c.self_type = 'UT_LOGICAL_SUITE');
375
-
376
-
end if;
377
-
return l_result;
378
-
361
+
or c.self_type = 'UT_LOGICAL_SUITE');
362
+
end if;
379
363
return l_result;
380
364
end;
365
+
366
+
procedure reconcile_paths_and_suites(
367
+
a_schema_paths ut_path_items,
368
+
a_filtered_rows t_cached_suites_cursor
369
+
) is
370
+
l_rows_tmp tt_cached_suites:= tt_cached_suites();
371
+
l_rows tt_cached_suites := tt_cached_suites();
372
+
l_limit number := 5000;
373
+
begin
374
+
loop
375
+
fetch a_filtered_rows bulk collect into l_rows_tmp limit l_limit;
376
+
l_rows := l_rows multiset union l_rows_tmp;
377
+
exit when a_filtered_rows%NOTFOUND;
378
+
end loop;
379
+
close a_filtered_rows;
380
+
381
+
for i in ( select /*+ no_parallel */sp.schema_name,sp.object_name,sp.procedure_name,
382
+
sp.suite_path,sp.originated_path,sc.path
383
+
from table(a_schema_paths) sp left outer join
384
+
table(l_rows) sc on
385
+
(( upper(sp.schema_name) = upper(sc.object_owner) and upper(sp.object_name) = upper(sc.object_name)
386
+
and nvl(upper(sp.procedure_name),sc.name) = sc.name )
387
+
or (sc.path = sp.suite_path))
388
+
where sc.path is null)
389
+
loop
390
+
if i.suite_path is not null then
391
+
raise_application_error(ut_utils.gc_suite_package_not_found,'No suite packages found for path '||i.schema_name||':'||i.suite_path|| '.');
392
+
elsif i.procedure_name is not null then
393
+
raise_application_error(ut_utils.gc_suite_package_not_found,'Suite test '||i.schema_name||'.'||i.object_name|| '.'||i.procedure_name||' does not exist');
394
+
elsif i.object_name is not null then
395
+
raise_application_error(ut_utils.gc_suite_package_not_found,'Suite package '||i.schema_name||'.'||i.object_name|| ' does not exist');
0 commit comments