Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,101 @@
# utPLSQL-maven-plugin
A maven plugin for running Unit Tests with utPLSQL v3+

### Compatibility

This plugin is compatible with the Java-API 3.0.4.

### Prerequisites
You have to be a fully utPLSQL environment available compatible with the Java API.


### Plugin Parameters

* `url`
* URL of the Connection to the database
* Default: `${dbURL}`
* `user`
* Credential of the connection to the database
* Default: `${dbUser}`
* `password`
* Password of the connection to the database
* Default: `${dbPass}`
* `ignoreFailure`
* Ignore or continue when a test fail
* Default: `${maven.test.failure.ignore}`
* `skipCompatibilityCheck`
* Skip the Compatibility Checks
* `true` | `false` (default: `false`)
* `reporters`
* List of the Reporters (Check the example below).
* You can pass the name of the reporter and/or the output file of the reporter and/or if the report is logged to the console
* This is a current list of the names of the reporters (See UtPLSQL documentation in order to check the final list): `UT_DOCUMENTATION_REPORTER`, `UT_COVERAGE_HTML_REPORTER`, `UT_TEAMCITY_REPORTER`, `UT_XUNIT_REPORTER`, `UT_COVERALLS_REPORTER`, `UT_COVERAGE_SONAR_REPORTER`, `UT_SONAR_TEST_REPORTER`
* Check the example below

* `paths`
* Paths of the resources
* `sources`
* Sources of the scripts at the style of the maven resources
* `tests`
* Test fo the scripts at the style of the maven resources
* `targetDir`
* Target dir, this is a readonly property
* Default: `${project.build.directory}`
* `includeObject`
* Include Object
* `excludeObject`
* Exclude Objects



### Sample of use
The next snippet is a sample of declaration of the pom
```xml
<plugin>
<groupId>org.utplsql</groupId>
<artifactId>utplsql-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<goals>
<goal>test</goal>
</goals>
<configuration>
<url>url_of_connection</url>
<user>user</user>
<password>password</password>
<failOnErrors>false</failOnErrors>
<reporters>
<reporter>
<name>UT_COVERAGE_SONAR_REPORTER</name>
<fileOutput>utplsql/coverage-sonar-reporter.xml</fileOutput>
<consoleOutput>true</consoleOutput>
</reporter>
<reporter>
<name>UT_SONAR_TEST_REPORTER</name>
<fileOutput>utplsql/sonar-test-reporter.xml</fileOutput>
<consoleOutput>false</consoleOutput>
</reporter>
<reporter>
<name>UT_TEAMCITY_REPORTER</name>
</reporter>
</reporters>
<sources>
<source>
<directory>src/test/resources/scripts/sources</directory>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we give support for sources (file mapping), we will also need to have:

    -owner="app"
    -regex_expression="pattern"
    -type_mapping="matched_string=TYPE[/matched_string=TYPE]*"
    -owner_subexpression=subexpression_number
    -type_subexpression=subexpression_number
    -name_subexpression=subexpression_number

One thin that needs improvement on utPLSQL side is documentation of those options - currently it's vague and insufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insted of adding more modification for the plugin will not be more useful release this version as is and open a new one aligned with the last version of the java-api(3.0.5)?

<includes>
<include>**/*pkg</include>
<include>**/*pkb</include>
</includes>
</source>
</sources>
<tests>
<test>
<directory>src/test/resources/scripts/test</directory>
<includes>
<include>**/*pkg</include>
<include>**/*pkb</include>
</includes>
</test>
</tests>
</configuration>
</plugin>
```
232 changes: 124 additions & 108 deletions utplsql-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -1,110 +1,126 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.utplsql</groupId>
<artifactId>utplsql-maven-plugin-build</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>utplsql-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>

<name>utplsql-maven-plugin Maven Plugin</name>

<!-- FIXME change it to the project's website -->
<url>http://maven.apache.org</url>

<properties>
</properties>

<dependencies>
<dependency>
<groupId>org.utplsql</groupId>
<artifactId>java-api</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
</dependency>

<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5</version>
<scope>provided</scope>
</dependency>

<!-- test dependencies -->

<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>${maven.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.8.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.5</version>
<executions>
<execution>
<id>default-descriptor</id>
<phase>process-classes</phase>
</execution>
<execution>
<id>help-goal</id>
<goals>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.utplsql</groupId>
<artifactId>utplsql-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>

<version>1.0.0-SNAPSHOT</version>

<name>utplsql-maven-plugin Maven Plugin</name>

<!-- FIXME change it to the project's website -->
<url>http://maven.apache.org</url>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<url>http://utplsql.org</url>
I might have someone to take care of the website so we will be publishing info on all utPLSQL projects there, not just the main project.


<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>

<dependencies>

<dependency>
<groupId>org.utplsql</groupId>
<artifactId>java-api</artifactId>
<version>3.0.4</version>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>3.0.2</version>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.5.2</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.8</version>
</dependency>

<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5</version>
<scope>provided</scope>
</dependency>

<!-- test dependencies -->

<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.5.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.8.0</version>
<scope>test</scope>
</dependency>


</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.5</version>
<configuration>
<goalPrefix>utplsql</goalPrefix>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
<execution>
<id>help-goal</id>
<goals>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>

</plugin>
</plugins>
</build>

</project>
Loading