Skip to content

Commit 4c3c08c

Browse files
committed
Merge branch 'feature/maven-it-extension' into develop
2 parents 76d3d75 + 55fa919 commit 4c3c08c

File tree

60 files changed

+518
-817
lines changed

Some content is hidden

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

60 files changed

+518
-817
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
restore-keys: |
5757
${{ runner.os }}-maven-
5858
59-
- name: Maven verify and sonar
59+
- name: Maven unit and integration tests with sonar
6060
run: mvn clean verify sonar:sonar -Pcoverage -Dsonar.projectKey=org.utplsql:utplsql-maven-plugin
6161
env:
6262
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=org.utplsql%3Autplsql-maven-plugin&metric=alert_status)](https://sonarcloud.io/dashboard?id=org.utplsql%3Autplsql-maven-plugin)
33

44
# utPLSQL-maven-plugin
5+
56
A maven plugin for running Unit Tests with utPLSQL v3+.
67

78
## Compatibility
9+
810
This plugin is compatible with utPLSQL 3.1.0+.
911

1012
## Prerequisites
13+
1114
* Java SE Runtime Environment 8
1215
* Maven Version 3.5+
13-
* Oracle JDBC driver
16+
* Oracle JDBC driver
1417

1518
```xml
19+
1620
<dependency>
1721
<groupId>com.oracle.database.jdbc</groupId>
1822
<artifactId>ojdbc8</artifactId>
@@ -27,6 +31,7 @@ This plugin is compatible with utPLSQL 3.1.0+.
2731
To skip running the tests for a particular project, set the **skipUtplsqlTests** property to true.
2832

2933
```xml
34+
3035
<configuration>
3136
<skipUtplsqlTests>true</skipUtplsqlTests>
3237
</configuration>
@@ -38,9 +43,11 @@ You can also skip the tests via the command line by executing the following comm
3843

3944
#### Skipping by Default
4045

41-
If you want to skip tests by default but want the ability to re-enable tests from the command line, you need to go via a properties section in the pom:
46+
If you want to skip tests by default but want the ability to re-enable tests from the command line, you need to go via a
47+
properties section in the pom:
4248

4349
```xml
50+
4451
<configuration>
4552
<skipUtplsqlTests>true</skipUtplsqlTests>
4653
</configuration>
@@ -55,9 +62,10 @@ This will allow you to run with all tests disabled by default and to run them wi
5562
Please refer to the following usage example for the parameters descriptions:
5663

5764
```xml
65+
5866
<project xmlns="http://maven.apache.org/POM/4.0.0"
59-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
60-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
67+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
68+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
6169
<modelVersion>4.0.0</modelVersion>
6270

6371
<groupId>org.my_org</groupId>
@@ -90,7 +98,7 @@ Please refer to the following usage example for the parameters descriptions:
9098
</goals>
9199
<configuration>
92100
<!-- REQUIRED PARAMETERS -->
93-
101+
94102
<!-- A list of tests suite paths. -->
95103
<!-- The path(s) can be in one of the following formats: -->
96104
<!-- schema[.package[.procedure]] -->
@@ -115,7 +123,7 @@ Please refer to the following usage example for the parameters descriptions:
115123
</sources>
116124

117125
<tests>
118-
<test>
126+
<test>
119127
<!-- Path to project test files. -->
120128
<directory>src/test/resources/scripts/test</directory>
121129
<!-- File patterns to include. -->
@@ -125,13 +133,13 @@ Please refer to the following usage example for the parameters descriptions:
125133
</includes>
126134
</test>
127135
</tests>
128-
136+
129137
<!-- OPTIONAL PARAMETERS -->
130-
138+
131139
<!-- Continue in case of failure. -->
132140
<!-- Defaults to: ${maven.test.failure.ignore} -->
133141
<ignoreFailure>false</ignoreFailure>
134-
142+
135143
<!-- Skip the utPLSQL version compatibility check. -->
136144
<!-- Defaults to: false -->
137145
<skipCompatibilityCheck>false</skipCompatibilityCheck>
@@ -153,17 +161,17 @@ Please refer to the following usage example for the parameters descriptions:
153161
<randomTestOrder>true</randomTestOrder>
154162
<!-- Sets the seed to use for random test execution order. If set, it sets -random to true. -->
155163
<randomTestOrderSeed>5</randomTestOrderSeed>
156-
164+
157165
<!-- Comma-separated object list to include in the coverage report. -->
158166
<!-- Format: [schema.]package[,[schema.]package ...]. -->
159167
<!-- See coverage reporting options in framework documentation. -->
160168
<includeObject>app.test1,app.test2</includeObject>
161-
169+
162170
<!-- Comma-separated object list to exclude from the coverage report. -->
163171
<!-- Format: [schema.]package[,[schema.]package ...]. -->
164172
<!-- See coverage reporting options in framework documentation. -->
165173
<excludeObject>app.test1,app.test2</excludeObject>
166-
174+
167175
<!-- List of reporters. -->
168176
<!-- You can pass the name of the reporter and/or the output file -->
169177
<!-- of the reporter and/or if the report is logged to the console. -->
@@ -194,7 +202,7 @@ Please refer to the following usage example for the parameters descriptions:
194202
<name>UT_TEAMCITY_REPORTER</name>
195203
</reporter>
196204
</reporters>
197-
205+
198206
<!-- Custom source code mapping options. -->
199207
<!-- See coverage reporting options in framework documentation. -->
200208
<sourcesOwner>code_owner</sourcesOwner>
@@ -208,7 +216,7 @@ Please refer to the following usage example for the parameters descriptions:
208216
<customMapping>package_bodies</customMapping>
209217
</customTypeMapping>
210218
</sourcesCustomTypeMapping>
211-
219+
212220
<!-- Custom test code mapping options. -->
213221
<!-- See coverage reporting options in framework documentation. -->
214222
<testsOwner>tests_owner</testsOwner>
@@ -231,9 +239,12 @@ Please refer to the following usage example for the parameters descriptions:
231239
</project>
232240
```
233241

234-
More project samples are available in the src/test/resources/integration-tests directory:
242+
More project samples are available in the `src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT`
243+
directory:
244+
235245
* **simple-project:** Minimalist test project with standard project directory structure.
236-
* **regex-project:** Overrides project directory structure and use additional parameters (sourcesRegexExpression, testsRegexExpression, ...), to tell utPLSQL how project files should be mapped into database objects.
246+
* **regex-project:** Overrides project directory structure and use additional parameters (sourcesRegexExpression,
247+
testsRegexExpression, ...), to tell utPLSQL how project files should be mapped into database objects.
237248
* **type-mapping-project:** Example how to use regex and custom type parameters together.
238249
* **owner-param-project:** Demonstrates how to use sourcesOwner and testsOwner parameters.
239250

pom.xml

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,27 @@
5353
<maven.compiler.target>1.8</maven.compiler.target>
5454
<maven.compiler.source>1.8</maven.compiler.source>
5555
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
56+
5657
<maven.version>3.5.2</maven.version>
5758
<jaxb.version>2.3.1</jaxb.version>
58-
<powermock.version>2.0.9</powermock.version>
59+
<itf.version>0.11.0</itf.version>
60+
5961
<sonar.organization>utplsql</sonar.organization>
6062
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
6163
</properties>
6264

65+
<dependencyManagement>
66+
<dependencies>
67+
<dependency>
68+
<groupId>org.junit</groupId>
69+
<artifactId>junit-bom</artifactId>
70+
<version>5.8.1</version>
71+
<type>pom</type>
72+
<scope>import</scope>
73+
</dependency>
74+
</dependencies>
75+
</dependencyManagement>
76+
6377
<dependencies>
6478
<dependency>
6579
<groupId>com.sun.xml.bind</groupId>
@@ -130,17 +144,27 @@
130144
<version>3.3.0</version>
131145
<scope>test</scope>
132146
</dependency>
147+
133148
<dependency>
134-
<groupId>org.apache.maven.shared</groupId>
135-
<artifactId>maven-verifier</artifactId>
136-
<version>1.6</version>
149+
<groupId>org.junit.jupiter</groupId>
150+
<artifactId>junit-jupiter-engine</artifactId>
137151
<scope>test</scope>
138152
</dependency>
153+
<dependency>
154+
<groupId>org.junit.vintage</groupId>
155+
<artifactId>junit-vintage-engine</artifactId>
156+
</dependency>
139157

140158
<dependency>
141-
<groupId>junit</groupId>
142-
<artifactId>junit</artifactId>
143-
<version>4.13.2</version>
159+
<groupId>com.soebes.itf.jupiter.extension</groupId>
160+
<artifactId>itf-jupiter-extension</artifactId>
161+
<version>${itf.version}</version>
162+
<scope>test</scope>
163+
</dependency>
164+
<dependency>
165+
<groupId>com.soebes.itf.jupiter.extension</groupId>
166+
<artifactId>itf-assertj</artifactId>
167+
<version>${itf.version}</version>
144168
<scope>test</scope>
145169
</dependency>
146170

@@ -173,6 +197,21 @@
173197
</execution>
174198
</executions>
175199
</plugin>
200+
<plugin>
201+
<groupId>com.soebes.itf.jupiter.extension</groupId>
202+
<artifactId>itf-maven-plugin</artifactId>
203+
<version>${itf.version}</version>
204+
<executions>
205+
<execution>
206+
<id>installing</id>
207+
<phase>pre-integration-test</phase>
208+
<goals>
209+
<goal>install</goal>
210+
<goal>resources-its</goal>
211+
</goals>
212+
</execution>
213+
</executions>
214+
</plugin>
176215
<plugin>
177216
<groupId>org.apache.maven.plugins</groupId>
178217
<artifactId>maven-shade-plugin</artifactId>
@@ -238,7 +277,7 @@
238277
<plugin>
239278
<groupId>org.jacoco</groupId>
240279
<artifactId>jacoco-maven-plugin</artifactId>
241-
<version>0.8.5</version>
280+
<version>0.8.7</version>
242281
<executions>
243282
<execution>
244283
<id>prepare-agent</id>

scripts/sql/create_app_objects.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
whenever sqlerror exit failure rollback
22
whenever oserror exit failure rollback
33

4-
@src/test/resources/integration-tests/simple-project/scripts/sources/TO_TEST_ME.tab
5-
@src/test/resources/integration-tests/simple-project/scripts/sources/APP.PKG_TEST_ME.spc
6-
@src/test/resources/integration-tests/simple-project/scripts/sources/APP.PKG_TEST_ME.bdy
4+
@src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/simple/scripts/sources/TO_TEST_ME.tab
5+
@src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/simple/scripts/sources/APP.PKG_TEST_ME.spc
6+
@src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/simple/scripts/sources/APP.PKG_TEST_ME.bdy
77

8-
@src/test/resources/integration-tests/simple-project/scripts/tests/APP.TEST_PKG_TEST_ME.spc
9-
@src/test/resources/integration-tests/simple-project/scripts/tests/APP.TEST_PKG_TEST_ME.bdy
8+
@src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/simple/scripts/tests/APP.TEST_PKG_TEST_ME.spc
9+
@src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/simple/scripts/tests/APP.TEST_PKG_TEST_ME.bdy
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
whenever sqlerror exit failure rollback
22
whenever oserror exit failure rollback
33

4-
@src/test/resources/integration-tests/owner-param-project/scripts/sources/foo/tables/TO_TEST_ME.tab
5-
@src/test/resources/integration-tests/owner-param-project/scripts/sources/foo/packages/PKG_TEST_ME.sql
6-
@src/test/resources/integration-tests/owner-param-project/scripts/sources/foo/package_bodies/PKG_TEST_ME.sql
4+
@src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/owner_param/scripts/sources/foo/tables/TO_TEST_ME.tab
5+
@src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/owner_param/scripts/sources/foo/packages/PKG_TEST_ME.sql
6+
@src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/owner_param/scripts/sources/foo/package_bodies/PKG_TEST_ME.sql

scripts/sql/create_tests_owner_objects.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ whenever oserror exit failure rollback
33

44
create synonym TO_TEST_ME for CODE_OWNER.TO_TEST_ME;
55
create synonym PKG_TEST_ME for CODE_OWNER.PKG_TEST_ME;
6-
@src/test/resources/integration-tests/owner-param-project/scripts/test/bar/packages/TEST_PKG_TEST_ME.sql
7-
@src/test/resources/integration-tests/owner-param-project/scripts/test/bar/package_bodies/TEST_PKG_TEST_ME.sql
6+
7+
@src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/owner_param/scripts/test/bar/packages/TEST_PKG_TEST_ME.sql
8+
@src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT/owner_param/scripts/test/bar/package_bodies/TEST_PKG_TEST_ME.sql

0 commit comments

Comments
 (0)