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

Skip to content

Commit 8f8d257

Browse files
committed
Extra tests and cleanup of old code.
1 parent 52c0307 commit 8f8d257

4 files changed

Lines changed: 38 additions & 28 deletions

File tree

source/core/ut_suite_cache_manager.pkb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -290,24 +290,6 @@ create or replace package body ut_suite_cache_manager is
290290
return expand_paths(group_paths_by_schema(a_paths));
291291
end;
292292

293-
function get_cached_suite_rows(
294-
a_object_owner varchar2,
295-
a_path varchar2 := null,
296-
a_object_name varchar2 := null,
297-
a_procedure_name varchar2 := null,
298-
a_random_seed positive := null,
299-
a_tags ut_varchar2_rows := null
300-
) return ut_suite_cache_rows is
301-
l_tags ut_varchar2_rows := coalesce(a_tags,ut_varchar2_rows());
302-
l_object_owner varchar2(250) := ut_utils.qualified_sql_name(a_object_owner);
303-
l_object_name varchar2(250) := ut_utils.qualified_sql_name(a_object_name);
304-
l_procedure_name varchar2(250) := ut_utils.qualified_sql_name(a_procedure_name);
305-
l_schema_paths ut_path_items;
306-
begin
307-
l_schema_paths := ut_path_items(ut_path_item(l_object_owner,l_object_name,l_procedure_name,a_path));
308-
return get_cached_suite_rows(l_schema_paths,a_random_seed,l_tags);
309-
end;
310-
311293
function get_cached_suite_rows(
312294
a_schema_paths ut_path_items,
313295
a_random_seed positive := null,

source/core/ut_suite_cache_manager.pks

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,13 @@ create or replace package ut_suite_cache_manager authid definer is
4646
* Not to be used publicly. Used internally for building suites at runtime.
4747
*/
4848
function get_cached_suite_rows(
49-
a_object_owner varchar2,
50-
a_path varchar2 := null,
51-
a_object_name varchar2 := null,
52-
a_procedure_name varchar2 := null,
49+
a_schema_paths ut_path_items,
5350
a_random_seed positive := null,
5451
a_tags ut_varchar2_rows := null
5552
) return ut_suite_cache_rows;
5653

5754
function get_schema_paths(a_paths in ut_varchar2_list) return ut_path_items;
5855

59-
function get_cached_suite_rows(
60-
a_schema_paths ut_path_items,
61-
a_random_seed positive := null,
62-
a_tags ut_varchar2_rows := null
63-
) return ut_suite_cache_rows;
64-
6556
/*
6657
* Retrieves suite item info rows from cache.
6758
* Returned data is not filtered by user access rights.

test/ut3_user/api/test_ut_runner.pkb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,38 @@ end;';
344344
ut.expect(l_actual).to_equal(l_expected);
345345
end;
346346

347+
procedure test_get_suites_info_by_path is
348+
l_expected sys_refcursor;
349+
l_actual sys_refcursor;
350+
begin
351+
--Arrange
352+
open l_expected for
353+
select
354+
'UT3_USER' object_owner, 'DUMMY_TEST_PACKAGE' object_name, 'DUMMY_TEST_PACKAGE' item_name,
355+
'dummy_test_suite' item_description, 'UT_SUITE' item_type, 2 item_line_no,
356+
'some.path.dummy_test_package' path, 0 disabled_flag, null disabled_reason,null tags
357+
from dual union all
358+
select
359+
'UT3_USER' object_owner, 'DUMMY_TEST_PACKAGE' object_name, 'SOME_DUMMY_TEST_PROCEDURE' item_name,
360+
'dummy_test' item_description, 'UT_TEST' item_type, 6 item_line_no,
361+
'some.path.dummy_test_package.some_dummy_test_procedure' path, 0 disabled_flag, null disabled_reason,null tags
362+
from dual union all
363+
select
364+
'UT3_USER' object_owner, 'PATH' object_name, 'PATH' item_name,
365+
null item_description, 'UT_LOGICAL_SUITE' item_type, null item_line_no,
366+
'some.path' path, 0 disabled_flag, null disabled_reason, null tags
367+
from dual union all
368+
select
369+
'UT3_USER' object_owner, 'SOME' object_name, 'SOME' item_name,
370+
null item_description, 'UT_LOGICAL_SUITE' item_type, null item_line_no,
371+
'some' path, 0 disabled_flag, null disabled_reason, null tags
372+
from dual;
373+
--Act
374+
open l_actual for select * from table(ut3_develop.ut_runner.get_suites_info('ut3_user:some.path.dummy_test_package'));
375+
--Assert
376+
ut.expect(l_actual).to_equal(l_expected);
377+
end;
378+
347379
procedure test_get_reporters_list is
348380
l_expected sys_refcursor;
349381
l_actual sys_refcursor;

test/ut3_user/api/test_ut_runner.pks

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ create or replace package test_ut_runner is
6565
--%aftertest(cleanup_cache)
6666
procedure test_get_suites_info_twotag;
6767

68+
--%test(get_suites_info returns a cursor containing records for a newly created test with passed path)
69+
--%beforetest(setup_cache_objects)
70+
--%aftertest(cleanup_cache)
71+
procedure test_get_suites_info_by_path;
72+
6873
--%test(get_reporters_list returns a cursor containing all built-in reporters and information about output-reporter)
6974
--%beforetest(setup_cache_objects)
7075
--%aftertest(cleanup_cache)

0 commit comments

Comments
 (0)