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

Skip to content

Commit 96d3d25

Browse files
authored
Create exception-reporting.md
1 parent 4695d62 commit 96d3d25

1 file changed

Lines changed: 121 additions & 0 deletions

File tree

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Exception handling and reporting
2+
3+
The utPLSQL is responsibly for handling exceptions wherever they occure in the test run. Exceptions are pororted as follows:
4+
5+
* A test package without body faced - each `%test` is reported as failed
6+
* A test package with _invalid body_ - each `%test` is reported as failed
7+
* A test package with _invalid spec_ - *`%test`s are skipped*. Only valid specifications are parsed for annotations.
8+
* A test package that is raising an exception in beforeall - each `%test` is reported as failed
9+
* A test package that is raising an exception in afterall - `%test` are reported normally, warnings are displayed in the summary
10+
11+
Example:
12+
```
13+
Remove rooms by name
14+
Removes a room without content in it
15+
Does not remove room when it has content
16+
Raises exception when null room name given
17+
18+
Warnings:
19+
20+
1) test_remove_rooms_by_name - Afterall procedure failed:
21+
ORA-20001: Test exception
22+
ORA-06512: at "UT3.TEST_REMOVE_ROOMS_BY_NAME", line 35
23+
ORA-06512: at line 6
24+
25+
Finished in ,044902 seconds
26+
3 tests, 0 failed, 0 errored, 0 ignored. 1 warning(s)
27+
```
28+
29+
* A test package that is raising an exception in `%beforeeach` - each `%test` is reported as failed
30+
* A test package that is raising an exception in `%aftereach` - `%test`s are reported normally, warnings are displayed in the summary
31+
32+
Example:
33+
```
34+
Remove rooms by name
35+
Removes a room without content in it
36+
Does not remove room when it has content
37+
Raises exception when null room name given
38+
39+
Warnings:
40+
41+
1) test_remove_rooms_by_name - Aftereach procedure failed:
42+
ORA-20001: Test exception
43+
ORA-06512: at "UT3.TEST_REMOVE_ROOMS_BY_NAME", line 31
44+
ORA-06512: at line 6
45+
46+
2) test_remove_rooms_by_name - Aftereach procedure failed:
47+
ORA-20001: Test exception
48+
ORA-06512: at "UT3.TEST_REMOVE_ROOMS_BY_NAME", line 31
49+
ORA-06512: at line 6
50+
51+
3) test_remove_rooms_by_name - Aftereach procedure failed:
52+
ORA-20001: Test exception
53+
ORA-06512: at "UT3.TEST_REMOVE_ROOMS_BY_NAME", line 31
54+
ORA-06512: at line 6
55+
56+
Finished in ,05071 seconds
57+
3 tests, 0 failed, 0 errored, 0 ignored. 3 warning(s)
58+
```
59+
60+
* A test package that is raising an exception in test - the `%test` is reported as failed
61+
62+
Exampple:
63+
```
64+
Remove rooms by name
65+
Removes a room without content in it (FAILED - 1)
66+
Does not remove room when it has content
67+
Raises exception when null room name given
68+
69+
Failures:
70+
71+
1) remove_empty_room
72+
73+
error: ORA-20001: Test exception
74+
ORA-06512: at "UT3.TEST_REMOVE_ROOMS_BY_NAME", line 48
75+
ORA-06512: at line 6
76+
77+
Finished in ,035726 seconds
78+
3 tests, 0 failed, 1 errored, 0 ignored.
79+
```
80+
81+
* A test package that is raising an exception in `%beforetest` - the `%test` is reported as failed
82+
83+
Example:
84+
````
85+
Remove rooms by name
86+
Removes a room without content in it (FAILED - 1)
87+
Does not remove room when it has content
88+
Raises exception when null room name given
89+
90+
Failures:
91+
92+
1) remove_empty_room
93+
94+
error: ORA-20001: Test exception
95+
ORA-06512: at "UT3.TEST_REMOVE_ROOMS_BY_NAME", line 39
96+
ORA-06512: at line 6
97+
98+
Finished in ,039346 seconds
99+
3 tests, 0 failed, 1 errored, 0 ignored.
100+
````
101+
102+
* A test package that is raising an exception in `%aftertest` - the `%test` is reported as failed
103+
104+
Example:
105+
```
106+
Remove rooms by name
107+
Removes a room without content in it (FAILED - 1)
108+
Does not remove room when it has content
109+
Raises exception when null room name given
110+
111+
Failures:
112+
113+
1) remove_empty_room
114+
115+
error: ORA-20001: Test exception
116+
ORA-06512: at "UT3.TEST_REMOVE_ROOMS_BY_NAME", line 42
117+
ORA-06512: at line 6
118+
119+
Finished in ,045523 seconds
120+
3 tests, 0 failed, 1 errored, 0 ignored.
121+
```

0 commit comments

Comments
 (0)