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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
addressed comments
fixed additional recent tests
  • Loading branch information
Pazus committed Jul 1, 2017
commit f2ca323ad13c530df22e7410e4beaff3e68ec7b5
2 changes: 1 addition & 1 deletion source/core/ut_suite_manager.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ create or replace package body ut_suite_manager is
l_suite_name := l_annotation_data.package_annotations('suite').text;
end if;

if l_annotation_data.package_annotations.exists('suitepath') and trim(l_annotation_data.package_annotations('suitepath').text) is not null then
if l_annotation_data.package_annotations.exists('suitepath') and l_annotation_data.package_annotations('suitepath').text is not null then
l_suite_path := l_annotation_data.package_annotations('suitepath').text || '.' || lower(l_object_name);
end if;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ END;';
l_parsing_result := ut_annotations.parse_package_annotations(l_source);

--Assert
l_ann_param := null;
l_ann_param.val := 'Name of suite';
l_expected.package_annotations('suite').params := cast( null as ut_annotations.tt_annotation_params);

l_ann_param := null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ set termout on

declare
l_objects_to_run ut_suite_items;
l_suite ut_suite;
begin
--act
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with$dollar'));

--Assert
ut.expect(l_objects_to_run.count).to_equal(1);

l_suite := treat(l_objects_to_run(1) as ut_suite);
ut.expect(l_suite.name).to_equal('tst_package_with$dollar');

if ut_expectation_processor.get_status = ut_utils.tr_success then
:test_result := ut_utils.tr_success;
Expand Down
7 changes: 7 additions & 0 deletions tests/ut_suite_manager/ut_suite_manager.PackageWithHash.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ set termout on

declare
l_objects_to_run ut_suite_items;
l_suite ut_suite;
begin

--act
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with#hash'));

--Assert
ut.expect(l_objects_to_run.count).to_equal(1);

l_suite := treat(l_objects_to_run(1) as ut_suite);
ut.expect(l_suite.name).to_equal('tst_package_with#hash');

if ut_expectation_processor.get_status = ut_utils.tr_success then
:test_result := ut_utils.tr_success;
end if;
Expand Down
15 changes: 14 additions & 1 deletion tests/ut_suite_manager/ut_suite_manager.TestWithDollarSign.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,30 @@ end;

create or replace package body tst_package_with_dollar_test as
procedure test$1 is begin ut.expect(1).to_equal(1); end;
procedure test$2 is begin ut.expect(1).to_equal(1); end;
end;
/

set termout on

declare
l_objects_to_run ut_suite_items;
l_suite ut_suite;
l_test ut_test;
begin
--act
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with_dollar_test.test$1'));

--Assert
ut.expect(l_objects_to_run.count).to_equal(1);

l_suite := treat(l_objects_to_run(1) as ut_suite);

ut.expect(l_suite.name).to_equal('tst_package_with_dollar_test');
ut.expect(l_suite.items.count).to_equal(1);

l_test := treat(l_suite.items(1) as ut_test);

ut.expect(l_test.name).to_equal('test$1');

if ut_expectation_processor.get_status = ut_utils.tr_success then
:test_result := ut_utils.tr_success;
Expand Down
15 changes: 14 additions & 1 deletion tests/ut_suite_manager/ut_suite_manager.TestWithHashSign.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,31 @@ end;

create or replace package body tst_package_with_hash_test as
procedure test#1 is begin ut.expect(1).to_equal(1); end;
procedure test#2 is begin ut.expect(1).to_equal(1); end;
end;
/

set termout on

declare
l_objects_to_run ut_suite_items;
l_suite ut_suite;
l_test ut_test;
begin

--act
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with_hash_test.test#1'));

--Assert
ut.expect(l_objects_to_run.count).to_equal(1);

l_suite := treat(l_objects_to_run(1) as ut_suite);

ut.expect(l_suite.name).to_equal('tst_package_with_hash_test');
ut.expect(l_suite.items.count).to_equal(1);

l_test := treat(l_suite.items(1) as ut_test);

ut.expect(l_test.name).to_equal('test#1');

if ut_expectation_processor.get_status = ut_utils.tr_success then
:test_result := ut_utils.tr_success;
Expand Down
12 changes: 10 additions & 2 deletions tests/ut_suite_manager/ut_suite_manager.emptySuitePath.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,31 @@ create or replace package tst_empty_suite_path as
--%suitepath

--%test
procedure test#1;
procedure test1;
end;
/

create or replace package body tst_empty_suite_path as
procedure test#1 is begin ut.expect(1).to_equal(1); end;
procedure test1 is begin ut.expect(1).to_equal(1); end;
end;
/

set termout on

declare
l_objects_to_run ut_suite_items;
l_suite ut_suite;
begin

--act
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_empty_suite_path'));

--Assert
ut.expect(l_objects_to_run.count).to_equal(1);

l_suite := treat(l_objects_to_run(1) as ut_suite);

ut.expect(l_suite.name).to_equal('tst_empty_suite_path');

if ut_expectation_processor.get_status = ut_utils.tr_success then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how will this test ever fail, as there is no expectation executed before status is checked.

:test_result := ut_utils.tr_success;
Expand Down