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

Skip to content

Commit 94c0137

Browse files
committed
changed documentation, moved annotations description to the readme.md
1 parent 22398ce commit 94c0137

2 files changed

Lines changed: 85 additions & 14 deletions

File tree

docs/userguide/annotations.md

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

33
Annotations provide a way to configure tests and suites in a declarative way similar to modern OOP languages.
4-
The annotation list is based on jUnit 5 implementation.
4+
The annotation list is based on moder testing framework such as jUnit 5, RSpec.
55

6-
# Example
7-
Let's say we have the test package like this:
6+
Annotations allow to configure test infrastructure in a declarative way without anything stored in tables or config files. The framework runner scans the schema for all the suitable annotated packages, automatically configures suites, forms hierarchy from then and executes them.
7+
8+
# Example of annotated package
89
```
910
create or replace package test_pkg is
1011
11-
-- %suite
12-
-- %displayname(Name of suite)
12+
-- %suite(Name of suite)
1313
-- %suitepath(all.globaltests)
1414
1515
-- %beforeall
@@ -24,16 +24,19 @@ create or replace package test_pkg is
2424
-- %displayname(Name of test1)
2525
procedure test1;
2626
27-
-- %test
28-
-- %displayname(Name of test2)
27+
-- %test(Name of test2)
2928
-- %beforetest(setup_test1)
3029
-- %aftertest(teardown_test1)
3130
procedure test2;
3231
3332
-- %test
3433
-- %displayname(Name of test3)
35-
-- %testtype(smoke)
34+
-- %disable
3635
procedure test3;
36+
37+
-- %test(Name of test4)
38+
-- %rollback(manual)
39+
procedure test4;
3740
3841
procedure setup_test1;
3942
@@ -52,17 +55,15 @@ end test_pkg;
5255

5356
| Annotation |Level| Describtion |
5457
| --- | --- | --- |
55-
| `%suite` | Package | Marks package to be a suite of tests This way all testing packages might be found in a schema. |
58+
| `%suite(<description>)` | Package | Marks package to be a suite of tests This way all testing packages might be found in a schema. Optional schema discription can by provided, similar to `%displayname` annotation. |
5659
| `%suitepath(<path>)` | Package | Similar to java package. The annotation allows logical grouping of suites into hierarcies. |
57-
| `%displayname(<description>)` | Package/procedure | Human-familiar describtion of the suite/test. `%displayname(Name of the suite/test)` |
58-
| `%test` | Procedure | Denotes that a method is a test method. |
60+
| `%displayname(<description>)` | Package/procedure | Human-familiar describtion of the suite/test. Syntax is based on jUnit annotation: `%displayname(Name of the suite/test)` |
61+
| `%test(<description>)` | Procedure | Denotes that a method is a test method. Optional test discription can by provided, similar to `%displayname` annotation. |
5962
| `%beforeall` | Procedure | Denotes that the annotated procedure should be executed once before all elements of the current suite. |
6063
| `%afterall` | Procedure | Denotes that the annotated procedure should be executed once after all elements of the current suite. |
6164
| `%beforeeach` | Procedure | Denotes that the annotated procedure should be executed before each `%test` method in the current suite. |
6265
| `%aftereach` | Procedure | Denotes that the annotated procedure should be executed after each `%test` method in the current suite. |
6366
| `%beforetest(<procedure_name>)` | Procedure | Denotes that mentioned procedure should be executed before the annotated `%test` procedure. |
6467
| `%aftertest(<procedure_name>)` | Procedure | Denotes that mentioned procedure should be executed after the annotated `%test` procedure. |
6568
| `%rollback(<type>)` | Package/procedure | Configure transaction control behaviour (type). Supported values: `auto`(default) - rollback to savepoint (before the test/suite setup) is issued after each test/suite teardown; `manual` - rollback is never issued automatically. Property can be overridden for child element (test in suite) |
66-
| `%disable` | Package/procedure | Used to disable a suite or a test |
67-
68-
Annotations allow us to configure test infrastructure in a declarative way without anything stored in tables or config files. Suite manager would scan the schema for all the suitable packages, automatically configure suites and execute them. This can be simplified to the situation when you just ran suite manager over a schema for the defined types of tests and reporters and everything goes automatically. This is going to be convenient to be executed from CI tools using standard reporting formats.
69+
| `%disable` | Package/procedure | Used to disable a suite or a test |

readme.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,76 @@ The following table is a work in progress right now, and **will** change. If y
6767

6868
<sup>3</sup> Test execution comparison is in a single call so the results are combined. We know it was always possible group in any way with multiple calls. But that may not be desired under CI system where you want a single JUnit XML Output.
6969

70+
# Annotations
71+
72+
Annotations provide a way to configure tests and suites in a declarative way similar to modern OOP languages.
73+
The annotation list is based on moder testing framework such as jUnit 5, RSpec.
74+
75+
Annotations allow to configure test infrastructure in a declarative way without anything stored in tables or config files. The framework runner scans the schema for all the suitable annotated packages, automatically configures suites, forms hierarchy from then and executes them.
76+
77+
# Example of annotated package
78+
```
79+
create or replace package test_pkg is
80+
81+
-- %suite(Name of suite)
82+
-- %suitepath(all.globaltests)
83+
84+
-- %beforeall
85+
procedure globalsetup;
86+
87+
-- %afterall
88+
procedure global_teardown;
89+
90+
/* Such comments are allowed */
91+
92+
-- %test
93+
-- %displayname(Name of test1)
94+
procedure test1;
95+
96+
-- %test(Name of test2)
97+
-- %beforetest(setup_test1)
98+
-- %aftertest(teardown_test1)
99+
procedure test2;
100+
101+
-- %test
102+
-- %displayname(Name of test3)
103+
-- %disable
104+
procedure test3;
105+
106+
-- %test(Name of test4)
107+
-- %rollback(manual)
108+
procedure test4;
109+
110+
procedure setup_test1;
111+
112+
procedure teardown_test1;
113+
114+
-- %beforeeach
115+
procedure setup;
116+
117+
-- %aftereach
118+
procedure teardown;
119+
120+
end test_pkg;
121+
```
122+
123+
#Annotations meaning
124+
125+
| Annotation |Level| Describtion |
126+
| --- | --- | --- |
127+
| `%suite(<description>)` | Package | Marks package to be a suite of tests This way all testing packages might be found in a schema. Optional schema discription can by provided, similar to `%displayname` annotation. |
128+
| `%suitepath(<path>)` | Package | Similar to java package. The annotation allows logical grouping of suites into hierarcies. |
129+
| `%displayname(<description>)` | Package/procedure | Human-familiar describtion of the suite/test. Syntax is based on jUnit annotation: `%displayname(Name of the suite/test)` |
130+
| `%test(<description>)` | Procedure | Denotes that a method is a test method. Optional test discription can by provided, similar to `%displayname` annotation. |
131+
| `%beforeall` | Procedure | Denotes that the annotated procedure should be executed once before all elements of the current suite. |
132+
| `%afterall` | Procedure | Denotes that the annotated procedure should be executed once after all elements of the current suite. |
133+
| `%beforeeach` | Procedure | Denotes that the annotated procedure should be executed before each `%test` method in the current suite. |
134+
| `%aftereach` | Procedure | Denotes that the annotated procedure should be executed after each `%test` method in the current suite. |
135+
| `%beforetest(<procedure_name>)` | Procedure | Denotes that mentioned procedure should be executed before the annotated `%test` procedure. |
136+
| `%aftertest(<procedure_name>)` | Procedure | Denotes that mentioned procedure should be executed after the annotated `%test` procedure. |
137+
| `%rollback(<type>)` | Package/procedure | Configure transaction control behaviour (type). Supported values: `auto`(default) - rollback to savepoint (before the test/suite setup) is issued after each test/suite teardown; `manual` - rollback is never issued automatically. Property can be overridden for child element (test in suite) |
138+
| `%disable` | Package/procedure | Used to disable a suite or a test |
139+
70140

71141
__Primary Directories__
72142

0 commit comments

Comments
 (0)