-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathutresult.html
More file actions
200 lines (166 loc) · 6.87 KB
/
utresult.html
File metadata and controls
200 lines (166 loc) · 6.87 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- WARNING! This file is generated. -->
<!-- To alter documentation, edit files in src directory -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>utResult Package</title>
<link rel="stylesheet" href="utplsql.css" type="text/css" />
<meta name="keywords" content="utPLSQL, PL\SQL, Unit Testing, Framework, Oracle" />
<meta name="description" content="Unit Testing PL\SQL" />
<meta name="title" content="utResult Package" />
<meta name="author" content="Steven Feuerstein, Chris Rimmer, Patrick Barel and the utPLSQL Project" />
<meta name="copyright" content="(C) 2000-2005, 2014-2016 Steven Feuerstein, Chris Rimmer, Patrick Barel and the utPLSQL Project" />
</head>
<body>
<div class="purple_bar"><a href="index.html"><img src="utplsql.jpg" alt="utPLSQL logo" /></a></div>
<p>[ <a href="index.html">Home</a>
| <a href="started.html">Getting Started</a>
| <a href="buildpack.html">Build Test Packages</a>
| <a href="examples.html">Examples</a>
| <a href="userguide.html">User Guide</a>
| <a href="release.html">Release Notes</a>
| <a href="map.html">Document Map</a> ]</p>
<p><a href="utconfig.html">< Previous Section: utConfig Package</a> | <a href="utassert.html">Next Section: utAssert Package ></a></p>
<!-- Begin utPLSQL Body -->
<!-- $Id$ -->
<h1>utResult Package</h1>
<p>This package contains the following procedures and functions:</p>
<table cellspacing="5">
<tr>
<td>
<a href="#Init">utResult.init</a>
</td>
<td>
<a href="#Init">Initialize the results data</a>
</td>
</tr>
<tr>
<td>
<a href="#ShowResults">utResult.show</a>
<br /><a href="#ShowResults">utResult.showone</a>
<br /><a href="#ShowResults">utResult.showlast</a>
</td>
<td>
<a href="#ShowResults">Show results</a>
</td>
</tr>
<tr>
<td>
<a href="#SuccessFailure">utResult.success</a>
<br /><a href="#SuccessFailure">utResult.failure</a>
</td>
<td>
<a href="#SuccessFailure">Show the success or failure of the last test</a>
</td>
</tr>
<tr>
<td>
<a href="#Iterate">utResult.firstresult</a>
<br /><a href="#Iterate">utResult.nextresult</a>
<br /><a href="#Iterate">utResult.nthresult</a>
<br /><a href="#Iterate">utResult.resultcount</a>
</td>
<td>
<a href="#Iterate">Iterate through the results array</a>
</td>
</tr>
<tr>
<td>
<a href="#Successes">utResult.include_successes</a><br />
<a href="#Successes">utResult.ignore_successes</a>
</td>
<td>
<a href="#Successes">Control the display of passed tests</a>
</td>
</tr>
</table>
<p>
The utResult package offers an API to the information
sent by the various utAssert assertion routines after a test is run. If
you employ the utPLSQL.test and utPLSQL.testsuite to run your tests, then
the results will be displayed by calling the utResult.show procedure.
</p>
<p>
So, generally, you do not have to do anything to see or evaluate the results of
a test (or suite of tests). The information will be displayed on your screen
using DBMS_OUTPUT, or elsewhere if you use a custom output reporter. You might,
however, want to access this information in another environment (say, Oracle
Forms or Java, etc.). You might also want to build your own assertion logic or
test engine. In either of these cases, you will want to use the programs in the
utResult package.
</p>
<h2><a name="Init"></a>Initialize</h2>
<p>Initialize the utResult data, setting it all back to NULL:</p>
<pre>
PROCEDURE utResult.init;
</pre>
<h2><a name="ShowResults"></a>Show Results</h2>
<p>Show the results of your test with one of the following three procedures.</p>
<pre>
PROCEDURE utResult.show (reset_in IN BOOLEAN := FALSE);
PROCEDURE utResult.showone (indx_in in pls_integer);
PROCEDURE utResult.showlast;
</pre>
<p>
Use the <b>show</b> procedure to display the full set of results stored
in the utResult array. If you pass TRUE for its single argument, the results
informatino will be initialized.
</p>
<p>Use the <b>showone</b> procedure to show the Nth result.</p>
<p>Use the <b>showlast</b> procedure to show the results of the last test run.</p>
<h2><a name="SuccessFailure"></a>Retrieve Test Status</h2>
<p>
The success and failure functions return the status of the most recently
executed test.
</p>
<pre>
FUNCTION utResult.success RETURN BOOLEAN;
FUNCTION utResult.failure RETURN BOOLEAN;
</pre>
<h2><a name="Iterate"></a>Scan Results Array</h2>
<p>
The utPLSQL.show procedure iterates through the contents of the utResult
array and displays the information found there. You can write the same
kind of logic by calling a combination of the following programs:
</p>
<pre>
PROCEDURE utResult.firstresult;
FUNCTION utResult.nextresult RETURN utResult.result_rt;
PROCEDURE utResult.nextresult (
name_out OUT VARCHAR2,
msg_out OUT VARCHAR2,
case_indx_out OUT PLS_INTEGER
);
FUNCTION utResult.nthresult (indx_in IN PLS_INTEGER)
RETURN utResult.result_rt;
PROCEDURE utResult.nthresult (
indx_in IN PLS_INTEGER,
name_out OUT VARCHAR2,
msg_out OUT VARCHAR2,
case_indx_out OUT PLS_INTEGER
);
FUNCTION utResult.resultcount RETURN PLS_INTEGER;
</pre>
<h2><a name = "Successes"></a>Control the Display of Success Messages</h2>
<p>
The following procedures turn on or off the display of success messages. In other words,
when turned on (as is the default) a message will be displayed for each successful assertion.
The specifications are as follows:
</p>
<pre>
procedure include_successes;
procedure ignore_successes;
</pre>
<!-- End utPLSQL Body -->
<p><a href="utconfig.html">< Previous Section: utConfig Package</a> | <a href="utassert.html">Next Section: utAssert Package ></a></p>
<div class="purple_bar"><a href="index.html"><img src="utplsql.jpg" alt="utPLSQL logo" /></a></div>
<p>
<a href="http://validator.w3.org/check?uri=referer">
<img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" />
</a>
</p>
<p class="copyright">Copyright © 2000-2005, 2014-2016 <a href="mailto:steven@stevenfeuerstein.com">Steven Feuerstein</a>, <a href="mailto:c@24.org.uk">Chris Rimmer</a>, <a href="mailto:pbarel@vda.nl">Patrick Barel</a> and the utPLSQL Project. All rights reserved</p>
</body>
</html>