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

Skip to content

Commit 4cf6e92

Browse files
author
john-otoole
committed
Minor documentation fixes
1 parent e448d70 commit 4cf6e92

2 files changed

Lines changed: 42 additions & 34 deletions

File tree

docs/userguide/annotations.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Annotations
22

33
Annotations are used to configure tests and suites in a declarative way similar to modern OOP languages. This way, test configuration is stored along with the test logic inside the test package.
4-
No configuration files or tables are needed. The annotations names are based on popular testing frameworks such as jUnit.
5-
The framework runner searches for all the suitable annotated packages, automatically configures suites, forms suites hierarchy, executes it and reports results in specified formats.
4+
No configuration files or tables are needed. The annotation names are based on popular testing frameworks such as jUnit.
5+
The framework runner searches for all the suitable annotated packages, automatically configures suites, forms the suite hierarchy, executes it and reports results in specified formats.
66

7-
Annotations are interpreted only in package specification and are case-insensitive. It is recommended however, to use the lower-case annotations as described in documentation.
7+
Annotations are interpreted only in the package specification and are case-insensitive. It is recommended however, to use lower-case annotations as described in this documentation.
88

9-
There are two places where annotations may appear:
9+
There are two places where annotations may appear:
1010

11-
- at the beginning of the package specification (`%suite`, `%suitepath` etc)
12-
- right before a procedure (`%test`, `%beforeall`, `%beforeeach` etc).
11+
- at the beginning of the package specification (`%suite`, `%suitepath` etc.)
12+
- right before a procedure (`%test`, `%beforeall`, `%beforeeach` etc.)
1313

14-
Package level annotations need to be separated by at least one empty line from the underlying procedure annotations.
14+
Package level annotations need to be separated by at least one empty line from the underlying procedure annotations.
1515

1616
Procedure annotations are defined right before the procedure they reference, no empty lines are allowed.
1717

18-
If a package specification contains `%suite` annotation, it is treated as a test package and processed by the framework.
18+
If a package specification contains the `%suite` annotation, it is treated as a test package and is processed by the framework.
1919

2020
Some annotations accept parameters like `%suite`, `%test` and `%displayname`. The parameters for annotations need to be placed in brackets. Values for parameters should be provided without any quotation marks.
2121

@@ -48,7 +48,7 @@ create or replace package test_pkg is
4848
-- %displayname(Name of test)
4949
-- %disabled
5050
procedure disabled_test;
51-
51+
5252
-- %test(Name of test)
5353
-- %rollback(manual)
5454
procedure no_transaction_control_test;
@@ -72,15 +72,15 @@ end test_pkg;
7272
| --- | --- | --- |
7373
| `%suite(<description>)` | Package | Mandatory. Marks package as a test suite. Optional suite description can be provided (see `displayname`). |
7474
| `%suitepath(<path>)` | Package | Similar to java package. The annotation allows logical grouping of suites into hierarchies. |
75-
| `%displayname(<description>)` | Package/procedure | Human-readable and meaningful description of a suite/test. `%displayname(Name of the suite/test)`. The annotation is provided for flexibility and convenience only. It has exactly the same meaning as `<descriotion>` in `test` and `suite` annotations. If description is provided using both `suite`/`test` and `displayname`, then the one defined as last takes precedence. |
75+
| `%displayname(<description>)` | Package/procedure | Human-readable and meaningful description of a suite/test. `%displayname(Name of the suite/test)`. The annotation is provided for flexibility and convenience only. It has exactly the same meaning as `<description>` in `test` and `suite` annotations. If description is provided using both `suite`/`test` and `displayname`, then the one defined as last takes precedence. |
7676
| `%test(<description>)` | Procedure | Denotes that the annotated procedure is a unit test procedure. Optional test description can by provided (see `displayname`). |
7777
| `%beforeall` | Procedure | Denotes that the annotated procedure should be executed once before all elements of the suite. |
7878
| `%afterall` | Procedure | Denotes that the annotated procedure should be executed once after all elements of the suite. |
7979
| `%beforeeach` | Procedure | Denotes that the annotated procedure should be executed before each `%test` procedure in the suite. |
8080
| `%aftereach` | Procedure | Denotes that the annotated procedure should be executed after each `%test` procedure in the suite. |
8181
| `%beforetest(<procedure_name>)` | Procedure | Denotes that mentioned procedure should be executed before the annotated `%test` procedure. |
8282
| `%aftertest(<procedure_name>)` | Procedure | Denotes that mentioned procedure should be executed after the annotated `%test` procedure. |
83-
| `%rollback(<type>)` | Package/procedure | Defines transaction control. Supported values: `auto`(default) - A savepoint is created before invocation of each "before block" is and a rollback to specific savepoint is issued after each "after" block; `manual` - rollback is never issued automatically. Property can be overridden for child element (test in suite) |
83+
| `%rollback(<type>)` | Package/procedure | Defines transaction control. Supported values: `auto`(default) - a savepoint is created before invocation of each "before block" is and a rollback to specific savepoint is issued after each "after" block; `manual` - rollback is never issued automatically. Property can be overridden for child element (test in suite) |
8484
| `%disabled` | Package/procedure | Used to disable a suite or a test. Disabled suites/tests do not get executed, they are however marked and reported as disabled in a test run. |
8585

8686
# Suitepath concept
@@ -94,10 +94,10 @@ If you want to create tests for your application it is recommended to structure
9494
* Policy tests
9595
* Claim tests
9696
* Payment tests
97-
* Payments recognition
97+
* Payments recognition
9898
* Payments set off
99-
* Payouts
100-
99+
* Payouts
100+
101101
The `%suitepath` annotation is used for such grouping. Even though test packages are defined in a flat structure the `%suitepath` is used by the framework to form them into a hierarchical structure. Your payments recognition test package might look like:
102102

103103
```sql
@@ -137,7 +137,7 @@ end test_payment_set_off;
137137
```
138138

139139
When you execute tests for your application, the framework constructs a test suite for each test package. Then it combines suites into grouping suites by the `%suitepath` annotation value so that the fully qualified path to the `recognize_by_num` procedure is `USER:payments.test_payment_recognition.test_recognize_by_num`. If any of its expectations fails then the test is marked as failed, also the `test_payment_recognition` suite, the parent suite `payments` and the whole run is marked as failed.
140-
The test report indicates which expectation has failed on the payments module. The payments recognition submodule is causing the failure as `recognize_by_num` has not met the expectations of the test. Grouping tests into modules and submodules using the `%suitepath` annotation allows you to logically organize your project's flat structure of packages into functional groups.
140+
The test report indicates which expectation has failed on the payments module. The payments recognition submodule is causing the failure as `recognize_by_num` has not met the expectations of the test. Grouping tests into modules and submodules using the `%suitepath` annotation allows you to logically organize your project's flat structure of packages into functional groups.
141141

142142
An additional advantage of such grouping is the fact that every element level of the grouping can be an actual unit test package containing a common module level setup for all of the submodules. So in addition to the packages mentioned above you could have the following package.
143143
```sql
@@ -175,12 +175,12 @@ It is strongly recommended not to have mixed transaction control in a suite.
175175
Mixed transaction control settings will not work properly when your suites are using shared setup/cleanup with beforeall, afterall, beforeeach or aftereach annotations.
176176
Your suite will most likely fail with error or warning on execution. Some of the automatic rollbacks will probably fail to execute depending on the configuration you have.
177177

178-
In some cases it is necessary to perform DDL as part of setup or cleanup for the tests.
178+
In some cases it is necessary to perform DDL as part of setup or cleanup for the tests.
179179
It is recommended to move such DDL statements to a procedure with `pragma autonomous_transaction` to eliminate implicit commits in the main session that is executing all your tests.
180180
Doing so allows your tests to use the framework's automatic transaction control and releases you from the burden of manual cleanup of data that was created or modified by test execution.
181181

182182
When you are testing code that performs explicit or implicit commits, you may set the test procedure to run as an autonomous transaction with `pragma autonomous_transaction`.
183-
Keep in mind that when your tests runs in autonomous transaction it will not see the data prepared in setup procedure unless the setup procedure committed the changes.
183+
Keep in mind that when your tests runs in autonomous transaction it will not see the data prepared in setup procedure unless the setup procedure committed the changes.
184184

185185
# Order of execution
186186

@@ -189,23 +189,23 @@ When processing the test suite `test_pkg` defined in [Example of annotated test
189189
```
190190
create a savepoint 'beforeall'
191191
execute global_setup
192-
192+
193193
create savepoint 'beforeeach'
194194
execute test_setup
195195
execute some_test
196196
execute test_cleanup
197197
rollback to savepoint 'beforeeach'
198-
198+
199199
create savepoint 'beforeeach'
200200
execute test_setup
201201
execute setup_another_test
202202
execute another_test
203203
execute cleanup_another_test
204204
execute test_cleanup
205205
rollback to savepoint 'beforeeach'
206-
206+
207207
mark disabled_test as disabled
208-
208+
209209
execute test_setup
210210
execute no_transaction_control_test
211211
execute test_cleanup

docs/userguide/install.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ This will create a new user `UT3` with password `XNtxj8eEgA6X6b6f`, grant all ne
5959
Example invocation of the script from command line:
6060
```bash
6161
cd source
62-
sqlplus sys/sys_pass@db as sysdba @@install_headless.sql
62+
sqlplus sys/sys_pass@db as sysdba @install_headless.sql
6363
```
6464

6565
SYSDBA is needed to grant access to DBMS_LOCK.
@@ -90,7 +90,7 @@ It is up to DBA to maintain the storage of the profiler tables.
9090
# Installation Procedure
9191

9292
### Creating schema for utPLSQL
93-
To create the utPLSQL schema and grant all the needed privileges execute script `create_utplsql_owner.sql` from the `source` directory with parameters:
93+
To create the utPLSQL schema and grant all the required privileges execute script `create_utplsql_owner.sql` from the `source` directory with parameters:
9494

9595
- `user name` - the name of the user that will own of utPLSQL object
9696
- `password` - the password to be set for that user
@@ -113,8 +113,8 @@ cd source
113113
sqlplus admin/admins_password@database @install.sql ut3
114114
```
115115

116-
### Allowing other users to access utPLSQL framework
117-
In order to allow other users to access utPLSQL, synonyms must be created and grants need to be added.
116+
### Allowing other users to access the utPLSQL framework
117+
In order to allow other users to access utPLSQL, synonyms must be created and privileges granted.
118118
You have two options:
119119

120120
- use grants and synonyms to public, to allow all users to access the framework
@@ -127,7 +127,7 @@ Example invocation:
127127
cd source
128128
sqlplus admin/admins_password@database @create_synonyms_and_grants_for_public.sql ut3
129129
```
130-
To grant utPLSQL to individual user execute script `source/create_synonyms_and_grants_for_user.sql`, provide `schema_name` where utPLSQL is installed and `user_name` to grant access for.
130+
To grant utPLSQL to an individual user, execute script `source/create_synonyms_and_grants_for_user.sql`, provide `schema_name` where utPLSQL is installed and `user_name` to grant access for.
131131

132132
Example invocation:
133133
```bash
@@ -143,31 +143,39 @@ The following tools that support the SQL*Plus commands can be used to run the in
143143

144144
# Additional requirements
145145

146-
In order to use Code Coverage functionality of utPLSQL, users executing the tests must have the CREATE privilege on the PLSQL code that the coverage is gathered on.
146+
In order to use the Code Coverage functionality of utPLSQL, users executing the tests must have the CREATE privilege on the PLSQL code that the coverage is gathered on.
147147
This is a requirement of [DBMS_PROFILER package](https://docs.oracle.com/cd/E18283_01/appdev.112/e16760/d_profil.htm#i999476).
148148

149149
In practice, user running tests for PLSQL code that he does not own, needs to have CREATE ANY PROCEDURE/CREATE ANY TRIGGER privileges.
150150
Running code coverage on objects that the user does not own will **not produce any coverage information** without those privileges.
151151

152152
# Uninstalling utPLSQL
153153

154-
To uninstall run `/source/uninstall.sql` and provide `schema_name` where utPLSQL is installed.
154+
To uninstall run `uninstall.sql` and provide `schema_name` where utPLSQL is installed.
155+
156+
Example invocation:
157+
```bash
158+
cd source
159+
sqlplus admin/admins_password@database @uninstall.sql ut3
160+
```
155161

156162
The uninstall script will remove all the objects installed by the install script.
157-
Additionally, all the public and private synonyms pointing to the objects in utPLSQL schema will be removed.
163+
Additionally, all the public and private synonyms pointing to the objects in the utPLSQL schema will be removed.
164+
165+
If you have extended any utPLSQL types such as a custom reporter, these will need to be dropped before the uninstall, otherwise the uninstall script might fail.
158166

159-
If you have you have extended any utPLSQL types such as a custom reporter, these will need to be dropped before the uninstall, otherwise the uninstall script might fail.
167+
The uninstall script does not drop the schema.
160168

161-
In order for the uninstall to be successful, you need to use the uninstall script, that was provided whit the exact version that was installed on your database.
162-
The uninstall script provided with version 3.0.1 will probably not work, if you want to remove version 3.0.0 from your database.
169+
In order for the uninstall to be successful, you need to use the uninstall script that was provided with the exact utPLSQL version installed on your database.
170+
i.e. the uninstall script provided with version 3.0.1 will probably not work if you want to remove version 3.0.0 from your database.
163171

164172
# Version upgrade
165173

166-
Currently, the only way to upgrade version of utPLSQL v3.0.0 and above is to remove the previous version and install new version
174+
Currently, the only way to upgrade version of utPLSQL v3.0.0 and above is to remove the previous version and install the new version.
167175

168176
# Working with utPLSQL v2
169177

170178
If you are using utPLSQL v2, you can still install utPLSQL v3.
171-
The only requirement is that utPLSQL v3 needs to be installed in different schema than utPLSQL v2.
179+
The only requirement is that utPLSQL v3 needs to be installed in a different schema than utPLSQL v2.
172180

173181
utPLSQL v3 and utPLSQL v2 do not collide on public synonym names.

0 commit comments

Comments
 (0)