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

Skip to content

Commit 22398ce

Browse files
committed
added old syntax
1 parent a3f604e commit 22398ce

4 files changed

Lines changed: 35 additions & 1 deletion

source/core/ut_suite_manager.pkb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ create or replace package body ut_suite_manager is
5555

5656
if l_annotation_data.package_annotations.exists('displayname') then
5757
l_suite_name := ut_annotations.get_annotation_param(l_annotation_data.package_annotations('displayname'), 1);
58+
elsif l_annotation_data.package_annotations('suite').count>0 then
59+
l_suite_name := ut_annotations.get_annotation_param(l_annotation_data.package_annotations('suite'), 1);
5860
end if;
5961

6062
if l_annotation_data.package_annotations.exists('suitepath') then
@@ -129,6 +131,8 @@ create or replace package body ut_suite_manager is
129131

130132
if l_proc_annotations.exists('displayname') then
131133
l_displayname := ut_annotations.get_annotation_param(l_proc_annotations('displayname'), 1);
134+
elsif l_proc_annotations('test').count>0 then
135+
l_displayname := ut_annotations.get_annotation_param(l_proc_annotations('test'), 1);
132136
end if;
133137

134138
if l_proc_annotations.exists('rollback') then

tests/helpers/test_package_1.pck

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ create or replace package test_package_1 is
1212
procedure global_teardown;
1313

1414
--%test
15+
--%displayname(Test1 from test package 1)
1516
procedure test1;
1617

17-
--%test
18+
--%test(Test2 from test package 1)
1819
--%beforetest(test2_setup)
1920
--%aftertest(test2_teardown)
2021
procedure test2;

tests/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByName.sql

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ begin
2222

2323
ut.expect(l_test1_suite.name).to_equal('test_package_1');
2424
ut.expect(l_test1_suite.items.count).to_equal(3);
25+
ut.expect(l_test1_suite.before_each is not null).to_be_true;
26+
27+
ut.expect(l_test1_suite.items(1).name).to_equal('test1');
28+
ut.expect(l_test1_suite.items(1).description).to_equal('Test1 from test package 1');
29+
ut.expect(treat(l_test1_suite.items(1) as ut_test).before_test.is_defined).to_be_false;
30+
ut.expect(treat(l_test1_suite.items(1) as ut_test).after_test.is_defined).to_be_false;
31+
ut.expect(treat(l_test1_suite.items(1) as ut_test).ignore_flag).to_equal(0);
32+
33+
ut.expect(l_test1_suite.items(2).name).to_equal('test2');
34+
ut.expect(l_test1_suite.items(2).description).to_equal('Test2 from test package 1');
35+
ut.expect(treat(l_test1_suite.items(2) as ut_test).before_test.is_defined).to_be_true;
36+
ut.expect(treat(l_test1_suite.items(2) as ut_test).after_test.is_defined).to_be_true;
37+
ut.expect(treat(l_test1_suite.items(2) as ut_test).ignore_flag).to_equal(0);
38+
39+
-- temporary behavior.
40+
-- decided that when executed by package, not path, only that package has to execute
2541
l_test2_suite := treat(l_test1_suite.items(3) as ut_suite);
2642

2743
ut.expect(l_test2_suite.name).to_equal('test_package_2');
@@ -30,6 +46,18 @@ begin
3046

3147
if ut_assert_processor.get_aggregate_asserts_result = ut_utils.tr_success then
3248
:test_result := ut_utils.tr_success;
49+
else
50+
declare
51+
l_results ut_assert_results;
52+
begin
53+
l_results := ut_assert_processor.get_asserts_results;
54+
for i in 1..l_results.count loop
55+
if l_results(i).result > ut_utils.tr_success then
56+
dbms_output.put_line(l_results(i).get_result_clob);
57+
end if;
58+
end loop;
59+
end;
60+
3361
end if;
3462

3563
end;

tests/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageProcedureByPath.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ begin
2626
l_test_proc := treat(l_test1_suite.items(1) as ut_test);
2727

2828
ut.expect(l_test_proc.name).to_equal('test2');
29+
ut.expect(l_test_proc.description).to_equal('Test2 from test package 1');
2930
ut.expect(l_test_proc.before_test is not null).to_be_true;
3031
ut.expect(l_test_proc.after_test is not null).to_be_true;
3132

0 commit comments

Comments
 (0)