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

Skip to content

Commit 64cd100

Browse files
committed
Merge branch 'release/v3.0.2'
### Documentation #399 Documentation now refers to [migration](https://github.com/utPLSQL/utPLSQL-v2-v3-migration) project #386 Documentation now refers to a valid object name: `ut_file_mapping` #362 Install and Uninstall scripts are now much more readable #361 Install guide now provides snippet on how to download latest release on Windows ### Installation #396 Added override user/password/tablespace for install_headless #384 Installation is now smooth even if profiler tables already exist ### Internal improvements #388 Improved reporting from RunTest #363 Fixed publishing of release documentation history ### Improvements and fixes #407 Fixed rare issue with `ORA-22813: operand value exceeds system limits` #403 Stack trace is now properly parsed on all machines #397 The `--%disabled` annotation on suite level is now reporting all tests as disabled #395 Coverage reporting is now properly filtering test packages on that use suitepath #390 Line of code for failed expectation is now also shown for unit tests owned by other users #380 Line no of failed test is now properly reported when using `ut.fail` #375 Annotation parameter list can now have spaces before/after brackets #373 Warnings in documentation reporter are now properly numbered #372 Documentation reporter is now providing a timing information for each test #370 by xUnit reporter now displays name of the package/procedure if suite/test has no description #369 Fixed errors with multi-byte characters in conversion from/to clob
2 parents 85e2b7c + eafaef7 commit 64cd100

64 files changed

Lines changed: 1423 additions & 861 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ env:
4040
- ORACLE_PWD="oracle"
4141
matrix:
4242
- ORACLE_VERSION="11g-xe-r2" CONNECTION_STR='127.0.0.1:1521/XE' DOCKER_OPTIONS='--shm-size=1g'
43-
- ORACLE_VERSION="12c-se-r1" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1'
44-
- ORACLE_VERSION="12c-se2-r2-v2" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
43+
- ORACLE_VERSION="12c-se2-r1-v2" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
44+
- ORACLE_VERSION="12c-se-r2-v4" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
4545

4646
cache:
4747
pip: true
@@ -55,6 +55,7 @@ install:
5555
- sudo mkdir -p /dev/pdbs
5656
- sudo chmod -R 777 /dev/pdbs
5757
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/start_db.sh; fi
58+
- df -h
5859

5960
before_script:
6061
#The update_project_version is done before deployment to validate that the change of project files does not break installation

.travis/install.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ pwd
88
set feedback off
99
set verify off
1010
11-
@../source/create_utplsql_owner.sql $UT3_OWNER $UT3_OWNER_PASSWORD $UT3_TABLESPACE
11+
--@../source/create_utplsql_owner.sql $UT3_OWNER $UT3_OWNER_PASSWORD $UT3_TABLESPACE
12+
@../source/install_headless.sql
13+
14+
set feedback on
15+
--change the deafult password
16+
alter user $UT3_OWNER identified by $UT3_OWNER_PASSWORD;
1217
--needed for Mystats script to work
1318
grant select any dictionary to $UT3_OWNER;
1419
--Needed for testing a coverage outside ut3_owner.
15-
grant create any procedure, execute any procedure to $UT3_OWNER;
20+
grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER;
1621
22+
set feedback off
1723
@../source/create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE
1824
1925
cd ..
@@ -23,10 +29,10 @@ cd ..
2329
--@ut_debug_enable.sql
2430
--cd ..
2531
26-
cd source
27-
@install.sql $UT3_OWNER
28-
@create_synonyms_and_grants_for_user.sql $UT3_OWNER $UT3_USER
29-
cd ..
32+
--cd source
33+
--@install.sql $UT3_OWNER
34+
--@create_synonyms_and_grants_for_user.sql $UT3_OWNER $UT3_USER
35+
--cd ..
3036
3137
cd development
3238
conn $UT3_OWNER/$UT3_OWNER_PASSWORD@//$CONNECTION_STR

.travis/push_docs_to_gh_pages.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
8585
fi
8686
#If build running on a TAG - it's a new release - need to add it to documentation
8787
if [ -n "${TRAVIS_TAG}" ]; then
88-
latest_release=" - [${TRAVIS_TAG} documentation](${UTPLSQL_VERSION}/) - Created $now"
89-
sed -i '7s@.*@'"Latest release ${latest_release}"'@' index.md
88+
latest_release=" [${TRAVIS_TAG} documentation](${UTPLSQL_VERSION}/) - Created $now"
89+
sed -i '7s@.*@'" - Latest release: ${latest_release}"'@' index.md
90+
#add entry to the end of file - ## Released Version Doc History
91+
echo "- ${latest_release}">>index.md
9092
fi
9193
#replace 4th line in log
9294
sed -i '8s@.*@'"${latest}"'@' index.md

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v3.0.1
1+
v3.0.2

docs/about/authors.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11

2-
### Version 3 Major Contributors
2+
### utPLSQL v3 Major Contributors
33

44
**Listed Alphabetically**
55

6-
| Name | GitHub account
7-
| ------------ | --------------
8-
| David Pyke | [Shoelace](https://github.com/Shoelace)
9-
| Jacek Gebal | [jgebal](https://github.com/jgebal)
10-
| Pavel Kaplya | [Pazus](https://github.com/Pazus)
11-
| Robert Love | [rlove](https://github.com/rlove)
6+
| Name | GitHub account
7+
| ---------------- | --------------
8+
| David Pyke | [Shoelace](https://github.com/Shoelace)
9+
| Jacek Gebal | [jgebal](https://github.com/jgebal)
10+
| Pavel Kaplya | [Pazus](https://github.com/Pazus)
11+
| Robert Love | [rlove](https://github.com/rlove)
12+
| Vinicius Avellar | [viniciusam](https://github.com/viniciusam/)
1213

1314

15+
16+
Many thanks to all the [contributors](https://github.com/utPLSQL/utPLSQL/graphs/contributors)
17+
1418
### Special thanks to prior major contributors
1519

1620
- Steven Feuerstein - Original Author

docs/userguide/coverage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ begin
127127
'usr',
128128
ut_coverage_html_reporter(),
129129
a_source_file_mappings =>
130-
ut_coverage_file_mappings(
131-
ut_coverage_file_mapping(
130+
ut_file_mappings(
131+
ut_file_mapping(
132132
file_name => 'sources/hr/award_bonus.prc',
133133
object_owner => 'USR',
134134
object_name => 'AWARD_BONUS',
135135
object_type => 'PROCEDURE'
136136
),
137-
ut_coverage_file_mapping(
137+
ut_file_mapping(
138138
file_name => 'sources/hr/betwnstr.fnc',
139139
object_owner => 'USR',
140140
object_name => 'BETWNSTR',

docs/userguide/expectations.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Validation of the code under test (the tested logic of procedure/function etc.) is performed by comparing the actual data against the expected data.
44
To achieve that, we use a combination of expectation and matcher to perform the check on the data.
55

6-
Example of unit test procedure body.
6+
Example of a unit test procedure body.
77
```sql
88
begin
99
ut.expect( 'the tested value' ).to_( equal('the expected value') );
@@ -12,7 +12,7 @@ end;
1212

1313
Expectation is a set of the expected value(s), actual values(s) and the matcher(s) to run on those values.
1414

15-
Matcher is defining the comparison operation to be performed on expected and actual values.
15+
Matcher defines the comparison operation to be performed on expected and actual values.
1616
Pseudo-code:
1717
```
1818
ut.expect( a_actual {data-type} ).to_( {matcher} );
@@ -26,7 +26,7 @@ All matchers have shortcuts like:
2626
```
2727

2828
# Matchers
29-
utPLSQL provides following matchers to perform checks on the expected and actual values.
29+
utPLSQL provides the following matchers to perform checks on the expected and actual values.
3030

3131
- `be_between`
3232
- `be_empty`
@@ -57,7 +57,7 @@ end;
5757
```
5858

5959
## be_empty
60-
Unary matcher that validates if the provided data-set is empty.
60+
Unary matcher that validates if the provided dataset is empty.
6161

6262
Usage:
6363
```sql
@@ -86,7 +86,7 @@ end;
8686
```
8787

8888
## be_greater_or_equal
89-
Allows to check if the actual value is greater or equal than the expected.
89+
Checks if the actual value is greater or equal than the expected.
9090

9191
Usage:
9292
```sql
@@ -98,7 +98,7 @@ end;
9898
```
9999

100100
## be_greater_than
101-
Allows to check if the actual value is greater than the expected.
101+
Checks if the actual value is greater than the expected.
102102

103103
Usage:
104104
```sql
@@ -110,7 +110,7 @@ end;
110110
```
111111

112112
## be_less_or_equal
113-
Allows to check if the actual value is less or equal than the expected.
113+
Checks if the actual value is less or equal than the expected.
114114

115115
Usage:
116116
```sql
@@ -122,7 +122,7 @@ end;
122122
```
123123

124124
## be_less_than
125-
Allows to check if the actual value is less than the expected.
125+
Checks if the actual value is less than the expected.
126126

127127
Usage:
128128
```sql
@@ -148,7 +148,7 @@ begin
148148
end;
149149
```
150150

151-
Parameters `a_mask` and `a_escape_char` represent a valid parameters of the [Oracle like function](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF52142)
151+
Parameters `a_mask` and `a_escape_char` represent valid parameters of the [Oracle LIKE condition](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF52142)
152152

153153

154154
## be_not_null
@@ -178,7 +178,7 @@ end;
178178
```
179179

180180
## be_true
181-
Unary matcher that validates if the provided value is false.
181+
Unary matcher that validates if the provided value is true.
182182
- `boolean`
183183

184184
Usage:
@@ -192,10 +192,9 @@ end;
192192

193193
## equal
194194

195-
The equal matcher is a very restrictive matcher. It only returns true, if compared data-types are the same.
196-
That means, that comparing varchar2 to a number will fail even if the varchar2 contains the same number.
197-
This matcher is designed to capture changes of data-type, so that if you expect your variable to be number and is now something else,
198-
the test will fail and give you early indication of potential problem.
195+
The equal matcher is a very restrictive matcher. It only returns true if the compared data-types are the same.
196+
That means that comparing varchar2 to a number will fail even if the varchar2 contains the same number.
197+
This matcher is designed to capture changes of data-type, so that if you expect your variable to be a number and it is now some other type, the test will fail and give you early indication of a potential problem.
199198

200199
Usage:
201200
```sql
@@ -210,16 +209,17 @@ begin
210209
ut.expect( a_actual => y ).to_( equal( a_expected => x, a_nulls_are_equal => true ) );
211210
end;
212211
```
213-
The `a_nulls_are_equal` parameter decides on the behavior of `null=null` comparison (**this comparison by default is true!**)
212+
The `a_nulls_are_equal` parameter controls the behavior of a `null=null` comparison (**this comparison by default is true!**)
214213

215214
### Comparing cursors
216215

217-
The `equal` matcher accepts additional parameter `a_exclude varchar2` or `a_exclude ut_varchar2_list`, when used to compare `cursor` data.
218-
Those parameters allow passing a list of column names to exclude from data comparison. The list can be a comma separated `varchar2` list or a `ut_varchar2_list` collection.
219-
The column names accepted by parameter are **case sensitive** and cannot be quoted.
220-
If `a_exclude` parameter is not specified, all columns are included.
216+
The `equal` matcher accepts an additional parameter `a_exclude varchar2` or `a_exclude ut_varchar2_list`, when used to compare `cursor` data.
217+
218+
These parameters enable a list of column names to be passed for exclusion from the data comparison. The list can be a comma separated `varchar2` list or a `ut_varchar2_list` collection.
219+
The column names accepted by the parameter are **case sensitive** and cannot be quoted.
220+
If the `a_exclude` parameter is not specified, all columns are included.
221221
If a column to be excluded does not exist, the column cannot be excluded and it's name is simply ignored.
222-
It is useful when testing cursors containing data that is beyond our control (like default or trigger/procedure generated sysdate values on columns).
222+
This is useful when testing cursors containing data that is beyond our control (like default or trigger/procedure generated sysdate values on columns).
223223

224224
```sql
225225
procedure test_cursors_skip_columns is
@@ -236,22 +236,22 @@ end;
236236

237237
There is a great article by Tim Hall on [using the TABLE Operator with Locally Defined Types in PL/SQL](https://oracle-base.com/articles/12c/using-the-table-operator-with-locally-defined-types-in-plsql-12cr1).
238238
If you are on Oracle 12c, you can benefit from this feature to make comparison of PLSQL records and tables super-simple in utPLSQL.
239-
You can use the feature described in article to convert PLSQL records and collection types to cursors. Complex cursor data can then be compared in utPLQL.
239+
You can use the feature described in the article to convert PLSQL records and collection types to cursors. Complex cursor data can then be compared in utPLQL.
240240

241241

242242
### Comparing cursor data containing DATE fields
243243

244244
**Important note**
245245

246-
utPLSQL uses XMLType internally to represent rows of the cursor data. This is by far most flexible and allows comparison of cursors containing LONG, CLOB, BLOB, user defined types and even nested cursors.
246+
utPLSQL uses XMLType internally to represent rows of the cursor data. This is by far the most flexible method and allows comparison of cursors containing LONG, CLOB, BLOB, user defined types and even nested cursors.
247247
Due to the way Oracle handles DATE data type when converting from cursor data to XML, utPLSQL has no control over the DATE formatting.
248-
The NLS_DATE_FORMAT setting from the moment the cursor was opened decides ont the formatting of dates used for cursor data comparison.
249-
By default, Oracle NLS_DATE_FORMAT is timeless, so data of DATE datatype, will be compared ignoring the time part of it.
248+
The NLS_DATE_FORMAT setting from the moment the cursor was opened determines the formatting of dates used for cursor data comparison.
249+
By default, Oracle NLS_DATE_FORMAT is timeless, so data of DATE datatype, will be compared ignoring the time component.
250250

251251
You should use procedures `ut.set_nls`, `ut.reset_nls` around cursors that you want to compare in your tests.
252-
This way, the DATE data in cursors will get properly formatted for comparison using date-time format.
252+
This way, the DATE data in cursors will be properly formatted for comparison using date-time format.
253253

254-
The example below makes use of `ut.set_nls`, `ut.reset_nls`, so that date in `l_expected` and `l_actual` is compared using date-time formatting.
254+
The example below makes use of `ut.set_nls`, `ut.reset_nls`, so that the date in `l_expected` and `l_actual` is compared using date-time formatting.
255255
```sql
256256
create table events (
257257
description varchar2(4000),
@@ -323,7 +323,7 @@ drop package test_get_events;
323323

324324
### Comparing user defined types and collections
325325

326-
The `anydata` data type is used to compare user defined object and collections.
326+
The `anydata` data type is used to compare user defined objects and collections.
327327

328328
Example:
329329
```sql
@@ -368,7 +368,7 @@ end;
368368
/
369369
```
370370

371-
This test will fail as the `v_acutal` is not equal `v_expected`.
371+
This test will fail as `v_actual` is not equal `v_expected`.
372372

373373
## match
374374
Validates that the actual value is matching the expected regular expression.
@@ -384,13 +384,13 @@ begin
384384
end;
385385
```
386386

387-
Parameters `a_pattern` and `a_modifiers` represent a valid regexp pattern accepted by [Oracle regexp_like function](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF00501)
387+
Parameters `a_pattern` and `a_modifiers` represent a valid regexp pattern accepted by [Oracle REGEXP_LIKE condition](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF00501)
388388

389389

390390

391391
# Supported data types
392392

393-
Below matrix illustrates the data types supported by different matchers.
393+
The matrix below illustrates the data types supported by different matchers.
394394

395395
| | be_between | be_empty | be_false | be_greater_than | be_greater_or_equal | be_less_or_equal | be_less_than | be_like | be_not_null | be_null | be_true | equal | match |
396396
|:------------------------------|:----------:|:--------:|:--------:|:---------------:|:-------------------:|:----------------:|:------------:|:-------:|:-----------:|:-------:|:-------:|:-----:|:-----:|
@@ -411,17 +411,17 @@ Below matrix illustrates the data types supported by different matchers.
411411

412412

413413
# Negating a matcher
414-
Expectations provide a very convenient way to perform a check on negated matcher.
414+
Expectations provide a very convenient way to perform a check on a negated matcher.
415415

416-
Syntax of check for matcher evaluating to true:
416+
Syntax to check for matcher evaluating to true:
417417
```sql
418418
begin
419419
ut.expect( a_actual {data-type} ).to_{matcher};
420420
ut.expect( a_actual {data-type} ).to_( {matcher} );
421421
end;
422422
```
423423

424-
Syntax of check for matcher evaluating to false:
424+
Syntax to check for matcher evaluating to false:
425425
```sql
426426
begin
427427
ut.expect( a_actual {data-type} ).not_to_{matcher};
@@ -438,5 +438,5 @@ begin
438438
ut.expect( null ).not_to( be_true() );
439439
end;
440440
```
441-
Since NULL is neither true not it is not true, both expectations will report failure.
441+
Since NULL is neither *true* nor *not true*, both expectations will report failure.
442442

0 commit comments

Comments
 (0)