FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
utPLSQL/examples/developer_examples/RunExampleTestSuite.sql at develop · luffySF/utPLSQL · GitHub
luffySF
/
utPLSQL
Public
forked from
utPLSQL/utPLSQL
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
utPLSQL
/
examples
/
developer_examples
/
RunExampleTestSuite.sql
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (47 loc) · 2.23 KB
Breadcrumbs
utPLSQL
/
examples
/
developer_examples
/
RunExampleTestSuite.sql
Copy path
File metadata and controls
52 lines (47 loc) · 2.23 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--
Shows how to create a test suite in code and call the test runner.
--
No tables are used for this.
--
Suite Management packages are when developed will make this easier.
--
Clear Screen
Set
Serveroutput
On
Size Unlimited format truncated
set
echo off
--
install the example unit test packages
@@
ut_exampletest
.
pks
@@
ut_exampletest
.
pkb
@@
ut_exampletest2
.
pks
@@
ut_exampletest2
.
pkb
declare
l_suite ut_logical_suite;
l_test ut_test;
l_expectation ut_expectation_result;
begin
l_suite :
=
ut_suite(user,
'
ut_exampletest
'
);
l_suite
.
description
:
=
'
Test Suite Name
'
;
l_test :
=
ut_test(user,
'
ut_exampletest
'
,
'
ut_exAmpletest
'
);
l_test
.
description
:
=
'
Example test1
'
;
l_test
.
before_test_list
:
=
ut_executables(ut_executable(user,
'
ut_exampletest
'
,
'
Setup
'
,
ut_utils
.
gc_before_test
));
l_test
.
after_test_list
:
=
ut_executables(ut_executable(user,
'
ut_exampletest
'
,
'
tEardown
'
,
ut_utils
.
gc_after_test
));
l_suite
.
add_item
(l_test);
l_test :
=
ut_test(user,
'
UT_EXAMPLETEST2
'
,
'
ut_exAmpletest
'
);
l_test
.
description
:
=
'
Another example test
'
;
l_test
.
before_test_list
:
=
ut_executables(ut_executable(user,
'
UT_EXAMPLETEST2
'
,
'
SETUP
'
,
ut_utils
.
gc_before_test
));
l_test
.
after_test_list
:
=
ut_executables(ut_executable(user,
'
UT_EXAMPLETEST2
'
,
'
TEARDOWN
'
,
ut_utils
.
gc_after_test
));
l_suite
.
add_item
(l_test);
l_suite
.
do_execute
();
--
No reporter used in this example so outputing the results manually.
for test_idx
in
l_suite
.
items
.first ..
l_suite
.
items
.last loop
l_test :
=
treat(
l_suite
.
items
(test_idx)
as
ut_test);
dbms_output
.
put_line
(
'
---------------------------------------------------
'
);
dbms_output
.
put_line
(
'
Test:
'
||
l_test
.
item
.form_name);
dbms_output
.
put_line
(
'
Result:
'
||
ut_utils
.
test_result_to_char
(
l_test
.
result
));
dbms_output
.
put_line
(
'
expectation Results:
'
);
for i
in
1
..
l_test
.
failed_expectations
.count loop
l_expectation :
=
l_test
.
failed_expectations
(i);
dbms_output
.
put_line
(i
||
'
- result:
'
||
ut_utils
.
test_result_to_char
(
l_expectation
.
result
));
dbms_output
.
put_line
(i
||
'
- Message:
'
||
l_expectation
.
message
);
end loop;
end loop;
dbms_output
.
put_line
(
'
---------------------------------------------------
'
);
end;
/
drop package ut_exampletest;
drop package ut_exampletest2;
Back
|
FazBrowse Home
|
New Git URL