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: examples/RunExampleTestSuiteWithCustomDBMSOutputReporter.sql
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
1
--Shows how to create a test suite with the default reporter which is dbms_output
2
2
--No tables are used for this.
3
3
--Suite Management packages are when developed will make this easier.
4
-
Clear Screen
5
-
Set Serveroutput On Size Unlimited format truncated --http://stackoverflow.com/questions/2584492/how-to-prevent-dbms-output-put-line-from-trimming-leading-whitespace
Copy file name to clipboardExpand all lines: examples/ut_custom_reporter.tpb
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -26,12 +26,6 @@ create or replace type body ut_custom_reporter is
26
26
lvl := lvl + 1;
27
27
end;
28
28
29
-
overriding member procedure end_suite(self in out nocopy ut_custom_reporter, a_suite_name in varchar2, a_suite_execution_result in ut_execution_result) as
30
-
begin
31
-
lvl := lvl - 1;
32
-
(self as ut_dbms_output_suite_reporter).end_suite(a_suite_name,a_suite_execution_result);
33
-
end;
34
-
35
29
overriding member procedure begin_test(self in out nocopy ut_custom_reporter, a_test_name in varchar2, a_test_call_params in ut_test_call_params) as
36
30
begin
37
31
(self as ut_dbms_output_suite_reporter).begin_test(a_test_name,a_test_call_params);
@@ -43,6 +37,12 @@ create or replace type body ut_custom_reporter is
43
37
lvl := lvl - 1;
44
38
(self as ut_dbms_output_suite_reporter).end_test(a_test_name, a_test_call_params, a_execution_result, a_assert_list);
45
39
end;
40
+
41
+
overriding member procedure end_suite(self in out nocopy ut_custom_reporter, a_suite_name in varchar2, a_suite_execution_result in ut_execution_result) as
42
+
begin
43
+
lvl := lvl - 1;
44
+
(self as ut_dbms_output_suite_reporter).end_suite(a_suite_name,a_suite_execution_result);
Copy file name to clipboardExpand all lines: examples/ut_custom_reporter.tps
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ create or replace type ut_custom_reporter under ut_dbms_output_suite_reporter
8
8
member function tab(self in ut_custom_reporter) return varchar2,
9
9
overriding member procedure print(msg varchar2),
10
10
overriding member procedure begin_suite(self in out nocopy ut_custom_reporter, a_suite_name in varchar2),
11
-
overriding member procedure end_suite(self in out nocopy ut_custom_reporter, a_suite_name in varchar2, a_suite_execution_result in ut_execution_result),
12
11
overriding member procedure begin_test(self in out nocopy ut_custom_reporter, a_test_name in varchar2, a_test_call_params in ut_test_call_params),
13
-
overriding member procedure end_test(self in out nocopy ut_custom_reporter, a_test_name in varchar2, a_test_call_params in ut_test_call_params, a_execution_result in ut_execution_result, a_assert_list in ut_assert_list)
12
+
overriding member procedure end_test(self in out nocopy ut_custom_reporter, a_test_name in varchar2, a_test_call_params in ut_test_call_params, a_execution_result in ut_execution_result, a_assert_list in ut_assert_list),
13
+
overriding member procedure end_suite(self in out nocopy ut_custom_reporter, a_suite_name in varchar2, a_suite_execution_result in ut_execution_result)
Copy file name to clipboardExpand all lines: source/types/ut_test.tpb
+8-23Lines changed: 8 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -14,29 +14,15 @@ create or replace type body ut_test is
14
14
15
15
member function is_valid(self in ut_test) return boolean is
16
16
begin
17
-
if call_params.test_procedure is null then
18
-
return false;
19
-
end if;
20
-
21
-
if not ut_metadata.resolvable(call_params.owner_name, call_params.object_name, call_params.test_procedure) then
22
-
return false;
23
-
end if;
24
-
25
-
if call_params.setup_procedure is not null and
26
-
not ut_metadata.resolvable(call_params.owner_name, call_params.object_name, call_params.setup_procedure) then
27
-
return false;
28
-
end if;
29
-
30
-
if call_params.teardown_procedure is not null and
31
-
not ut_metadata.resolvable(call_params.owner_name, call_params.object_name, call_params.teardown_procedure) then
32
-
return false;
33
-
end if;
34
-
35
-
return true;
17
+
return call_params.test_procedure is not null and ut_metadata.resolvable(call_params.owner_name, call_params.object_name, call_params.test_procedure) and (call_params.setup_procedure is null OR ut_metadata.resolvable(call_params.owner_name, call_params.object_name, call_params.setup_procedure)) and (call_params.teardown_procedure is null OR ut_metadata.resolvable(call_params.owner_name, call_params.object_name, call_params.teardown_procedure));
36
18
end is_valid;
37
19
38
20
overriding member procedure execute(self in out nocopy ut_test, a_reporter ut_suite_reporter) is
39
-
params_valid boolean;
21
+
reporter ut_suite_reporter := a_reporter;
22
+
begin
23
+
reporter := execute(reporter);
24
+
end;
25
+
overriding member function execute(self in out nocopy ut_test, a_reporter ut_suite_reporter) return ut_suite_reporter is
40
26
reporter ut_suite_reporter := a_reporter;
41
27
begin
42
28
if reporter is not null then
@@ -49,10 +35,8 @@ create or replace type body ut_test is
49
35
$end
50
36
51
37
self.execution_result := ut_execution_result();
52
-
53
-
self.call_params.validate_params(params_valid);
54
38
55
-
if params_valid then
39
+
if self.call_params.validate_params() then
56
40
self.call_params.setup;
57
41
begin
58
42
self.call_params.run_test;
@@ -97,6 +81,7 @@ create or replace type body ut_test is
97
81
,a_execution_result => self.execution_result
98
82
,a_assert_list => self.assert_results);
99
83
end if;
84
+
return reporter;
100
85
end;
101
86
102
87
overriding member procedure execute(self in out nocopy ut_test) is
0 commit comments