[![Build status](https://github.com/utPLSQL/utPLSQL-maven-plugin/actions/workflows/build.yml/badge.svg)](https://github.com/utPLSQL/utPLSQL-maven-plugin/actions/workflows/build.yml) [![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) # utPLSQL-maven-plugin A maven plugin for running Unit Tests with utPLSQL v3+. ## Compatibility This plugin is compatible with utPLSQL 3.1.0+. ## Prerequisites * Java SE Runtime Environment 8 * Maven Version 3.5+ * Oracle JDBC driver ```xml com.oracle.database.jdbc ojdbc8 21.3.0.0 ``` ## Usage ### Skipping Tests To skip running the tests for a particular project, set the **skipUtplsqlTests** property to true. ```xml true ``` You can also skip the tests via the command line by executing the following command: mvn install -DskipTests #### Skipping by Default 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: ```xml true ``` This will allow you to run with all tests disabled by default and to run them with this command: mvn install -DskipUtplsqlTests=false ### Configuration Please refer to the following usage example for the parameters descriptions: ```xml 4.0.0 org.my_org my-artifact-name 1.0.0 url_of_connection user password org.utplsql utplsql-maven-plugin 3.1.11 test schema_name src/test/resources/scripts/sources **/*pkg **/*pkb src/test/resources/scripts/test **/*pkg **/*pkb false false false false 0 test_tag true 5 app.test1,app.test2 app.test1,app.test2 app.test1,app.test2 app.test1,app.test2 app.test1,app.test2 app.test1,app.test2 UT_COVERAGE_SONAR_REPORTER utplsql/coverage-sonar-reporter.xml true UT_SONAR_TEST_REPORTER utplsql/sonar-test-reporter.xml false UT_TEAMCITY_REPORTER code_owner .*/\w+/(\w+)/(\w+)\.\w{3} app 2 1 package body package_bodies tests_owner .*/\w+/(\w+)/(\w+)\.\w{3} test 2 1 package body package_bodies ``` More project samples are available in the `src/test/resources-its/org/utplsql/maven/plugin/UtPlsqlMojoIT` directory: * **simple-project:** Minimalist test project with standard project directory structure. * **regex-project:** Overrides project directory structure and use additional parameters (sourcesRegexExpression, testsRegexExpression, ...), to tell utPLSQL how project files should be mapped into database objects. * **type-mapping-project:** Example how to use regex and custom type parameters together. * **owner-param-project:** Demonstrates how to use sourcesOwner and testsOwner parameters. ## Comparison with utPLSQL CLI | CLI short parameter | CLI long parameter | Maven XML path | | --- | --- | --- | | -c | --color | | | | --failure-exit-code | | | -p | --path | paths.path | | -f | --format | reporters.reporter.name | | -o | | reporters.reporter.fileOutput | | -s | | reporters.reporter.consoleOutput | | | | ignoreFailure | | -scc | --skip-compatibility-check | skipCompatibilityCheck | | | --tags | tags.tag | | -D | --dbms_output | dbmsOutput | | -r | --random-test-order | randomTestOrder | | -seed | --random-test-order-seed | randomTestOrderSeed | | -exclude | | excludeObject | | -include | | includeObject | | | | | | -source_path | | sources.source.directory | | -owner | | sourcesOwner | | -regex_expression | | sourcesRegexExpression | | -type_mapping | | list of testsCustomTypeMapping.customTypeMapping | | -owner_subexpression | | sourcesOwnerSubexpression | | -type_subexpression | | sourcesTypeSubexpression | | -name_subexpression | | sourcesNameSubexpression | | | | | | -test_path | | tests.test.directory | | -owner | | testsOwner | | -regex_expression | | testsRegexExpression | | -type_mapping | | list of testsCustomTypeMapping.customTypeMapping | | -owner_subexpression | | testsOwnerSubexpression | | -type_subexpression | | testsTypeSubexpression | | -name_subexpression | | testsNameSubexpression |