Skip to content

Commit bfd1a9a

Browse files
author
Jacek Gębal
committed
Adding an extra test to extend coverage.
1 parent e6f768e commit bfd1a9a

3 files changed

Lines changed: 24 additions & 4 deletions

File tree

source/core/types/ut_executable_test.tpb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ create or replace noneditionable type body ut_executable_test as
7474
return remap_no_data_found(
7575
coalesce(
7676
get_exception_no(a_exception_var),
77+
get_exception_no(a_item.object_name||'.'||a_exception_var),
7778
get_exception_no(a_item.object_owner||'.'||a_exception_var),
7879
get_exception_no(a_item.object_owner||'.'||a_item.object_name||'.'||a_exception_var)
7980
)
@@ -93,6 +94,7 @@ create or replace noneditionable type body ut_executable_test as
9394
begin
9495
return coalesce(
9596
verify_name(a_exception_var),
97+
verify_name(a_item.object_name||'.'||a_exception_var),
9698
verify_name(a_item.object_owner||'.'||a_exception_var),
9799
verify_name(a_item.object_owner||'.'||a_item.object_name||'.'||a_exception_var)
98100
);

test/ut3_tester/core/annotations/test_annot_throws_exception.pkb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ is
152152
--%throws(e_uninitialized_exception_variable)
153153
procedure referencing_uninitialized_exception;
154154

155+
--%test(Failure report shows all expected exceptions)
156+
--%throws(c_local_error_no,e_some_local_exception,e_uninitialized_exception_variable)
157+
procedure not_throwing_expected_exceptions;
158+
155159
end;
156160
]';
157161

@@ -297,6 +301,11 @@ is
297301
begin
298302
raise e_uninitialized_exception_variable;
299303
end;
304+
305+
procedure not_throwing_expected_exceptions is
306+
begin
307+
raise_application_error(-20143, ''Test error'');
308+
end;
300309
end;
301310
';
302311

@@ -497,5 +506,11 @@ is
497506
ut.expect(l_actual).not_to_match('referencing_uninitialized_exception');
498507
end;
499508

509+
procedure not_throwing_expected_exceptions is
510+
begin
511+
ut.expect(g_tests_results).to_match('not_throwing_expected_exceptions');
512+
ut.expect(g_tests_results).to_match('Actual: -20143 was expected to be one of: \(annotated_package_with_throws.e_some_local_exception, annotated_package_with_throws.e_uninitialized_exception_variable, -20211\)');
513+
end;
514+
500515
end;
501516
/

test/ut3_tester/core/annotations/test_annot_throws_exception.pks

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ is
4040
--%test(Detects a valid exception number within many invalid ones)
4141
procedure one_valid_exception_number;
4242

43-
--%test(Gives failure when a exception is expected and nothing is thrown)
43+
--%test(Gives failure when an exception is expected and nothing is thrown)
4444
procedure nothing_thrown;
4545

4646
--%test(Single exception defined as a constant number in package)
@@ -49,13 +49,13 @@ is
4949
--%test(Gives success when one of annotated exception using constant is thrown)
5050
procedure list_of_exc_constant;
5151

52-
--%test(Gives failure when the raised exception is different that the annotated one using variable)
52+
--%test(Gives failure when the raised exception is different than the annotated one using variable)
5353
procedure fail_not_match_exc;
5454

55-
--%test(Success when one of exception from mixed list of number and constant is thrown)
55+
--%test(Success when one of exception from a mixed list of number and constant is thrown)
5656
procedure mixed_exc_list;
5757

58-
--%test(Success when match exception even if other variable on list dont exists)
58+
--%test(Success when match exception even if another variable on list doesn't exists)
5959
procedure mixed_list_notexi;
6060

6161
--%test(Success resolve and match named exception defined in pragma exception init)
@@ -81,6 +81,9 @@ is
8181

8282
--%test(Uninitialized exception variable can be used successfully in a test)
8383
procedure referencing_uninitialized_exception;
84+
85+
--%test(a Failure report shows all expected exceptions)
86+
procedure not_throwing_expected_exceptions;
8487

8588
--%context(referencing exceptions when running from another schema)
8689

0 commit comments

Comments
 (0)