diff --git a/pom.xml b/pom.xml index 3f6853b1ec2d4cdae8ce01d2b1c51bda3d74c99d..9d29bdd79902acf06e1d8ede4b8006774c30aba1 100644 --- a/pom.xml +++ b/pom.xml @@ -29,10 +29,109 @@ </modules> <properties> - <sonar.host.url>http://edelquality.westeurope.cloudapp.azure.com:9000/sonar/</sonar.host.url> + <!--<sonar.host.url>http://edelquality.westeurope.cloudapp.azure.com:9000/sonar/</sonar.host.url>--> + <sonar.host.url>http://localhost:9000</sonar.host.url> <sonar.exclusions>**/smp/data/model/*, **/smp/exceptions/*, **/to_be_removed/*</sonar.exclusions> + + <sonar.ws.timeout>300</sonar.ws.timeout> + <sonar.login>1659ebb88e2d1a896bfd56e835358c06418219c3</sonar.login> + <sonar.jacoco.remotePort>${jacocoRemotePort}</sonar.jacoco.remotePort> + <sonar.jacoco.remoteAddress>${jacocoRemoteAddress}</sonar.jacoco.remoteAddress> + <jacoco.maven.plugin.version>0.7.9</jacoco.maven.plugin.version> + <sonar.jacoco.reportPath>${maven.multiModuleProjectDirectory}/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath> </properties> + <profiles> + <!-- soap ui --> + <profile> + <id>run-soapui</id> + <build> + <defaultGoal>test</defaultGoal> + <plugins> + <plugin> + <groupId>com.smartbear.soapui</groupId> + <artifactId>soapui-pro-maven-plugin</artifactId> + <version>5.0.0</version> + <configuration> + <outputFolder>${maven.multiModuleProjectDirectory}/code-coverage/surefire-reports</outputFolder> + <junitReport>true</junitReport> + <printReport>true</printReport> + <soapuiProperties> + <property> + <name>soapui.scripting.library</name> + <value>${maven.multiModuleProjectDirectory}/smp-soapui-tests/groovy</value> + </property> + <property> + <name>soapui.logroot</name> + <value>${maven.multiModuleProjectDirectory}/code-coverage/soapui/logs/</value> + </property> + <property> + <name>http.nonProxyHosts</name> + <value>localhost|127.*|[::1]</value> + </property> + </soapuiProperties> + <testFailIgnore>true</testFailIgnore> + <projectFile>${maven.multiModuleProjectDirectory}/smp-soapui-tests/soapui/SMP3.0-BAMBOO-soapui-project.xml</projectFile> + <projectProperties> + <value>url=${url}</value> + </projectProperties> + </configuration> + + <executions> + <execution> + <phase>integration-test</phase> + <goals> + <goal>test</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.maven.plugin.version}</version> + + <executions> + <execution> + <phase>post-integration-test</phase> + + <goals> + <goal>dump</goal> + </goals> + <configuration> + <destFile>${sonar.jacoco.reportPath}</destFile> + <address>${sonar.jacoco.remoteAddress}</address> + <port>${sonar.jacoco.remotePort}</port> + <reset>false</reset> + <append>true</append> + </configuration> + </execution> + </executions> + </plugin> +<!-- + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>3.0.0</version> + <executions> + <execution> + <id>default-clean</id> + <phase>clean</phase> + <goals> + <goal>clean</goal> + </goals> + </execution> + </executions> + <configuration> + <excludeDefaultDirectories>true</excludeDefaultDirectories> + </configuration> + </plugin>--> + </plugins> + </build> + </profile> + </profiles> + <build> <plugins> <plugin> diff --git a/smp-api/pom.xml b/smp-api/pom.xml index c6e5b5730696e9bbcaa12aacacee9f32535d8fac..b3cde7b822841e8c20997ad4f071dcdd120c824a 100644 --- a/smp-api/pom.xml +++ b/smp-api/pom.xml @@ -79,6 +79,29 @@ </plugins> </configuration> </plugin> + + <!-- just clean code coverage folder before collecting any information--> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>3.0.0</version> + <executions> + <execution> + <id>default-clean</id> + <phase>clean</phase> + <goals> + <goal>clean</goal> + </goals> + </execution> + </executions> + <configuration> + <filesets> + <fileset> + <directory>${maven.multiModuleProjectDirectory}/code-coverage</directory> + </fileset> + </filesets> + </configuration> + </plugin> </plugins> </build> </project> diff --git a/smp-parent-pom/pom.xml b/smp-parent-pom/pom.xml index e803aad72672fe2643c3b427e66a2947e4e96424..d5733c6adbb5b6143e048215ce261d06842c06de 100644 --- a/smp-parent-pom/pom.xml +++ b/smp-parent-pom/pom.xml @@ -92,6 +92,14 @@ <lombok.version>1.16.16</lombok.version> <xmlunit.version>2.5.1</xmlunit.version> <hamcrest.version>2.0.0.0</hamcrest.version> + + + <sonar.jacoco.reportPath>${maven.multiModuleProjectDirectory}/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath> + <sonar.jacoco.itReportPath>${maven.multiModuleProjectDirectory}/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath> + <jacoco.maven.plugin.version>0.7.9</jacoco.maven.plugin.version> + <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> + <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis> + <sonar.language>java</sonar.language> </properties> <!-- Where are we looking for JARs? --> @@ -540,6 +548,7 @@ </dependency> </dependencies> </profile> + </profiles> <!-- Build plugins --> @@ -627,35 +636,107 @@ </configuration> </plugin> - <!-- code coverage report --> + + <!-- catalin --> + <!-- unit tests, surefire plugin --> <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.18.1</version> + <configuration> + <reportsDirectory>${maven.multiModuleProjectDirectory}/code-coverage/surefire-reports</reportsDirectory> + </configuration> + <executions> + <execution> + <id>default-test</id> + <configuration> + <argLine>-server -ea -Duser.language=en -XX:-UseSplitVerifier -Xms512m -Xmx1024m ${surefire.argline} + </argLine> + <includes> + <include>**/*Test.java</include> + </includes> + <excludes> + <exclude>**/*IntegrationTest.java</exclude> + </excludes> + </configuration> + </execution> + </executions> + </plugin> + + <!-- integration tests, failsafe plugin --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.19.1</version> + <configuration> + <reportsDirectory>${maven.multiModuleProjectDirectory}/code-coverage/failsafe-reports</reportsDirectory> + </configuration> <executions> <execution> - <id>default-prepare-agent</id> + <id>integration-tests</id> + <phase>integration-test</phase> <goals> - <goal>prepare-agent</goal> + <goal>integration-test</goal> + <goal>verify</goal> </goals> + <configuration> + <!-- Sets the VM argument line used when integration tests are run. --> + <argLine>-server -ea -XX:-UseSplitVerifier -Xms512m -Xmx1024m -Duser.language=en ${failsafe.argline} + </argLine> + + <includes> + <include>**/*IntegrationTest.java</include> + </includes> + <!-- Skips integration tests if the value of skipITs property is true--> + <skipTests>${skipITs}</skipTests> + + </configuration> </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-junit47</artifactId> + <version>2.19.1</version> + </dependency> + </dependencies> + </plugin> + + <!-- jacoco start --> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.maven.plugin.version}</version> + <executions> <execution> - <id>default-report</id> - <phase>prepare-package</phase> + <id>pre-unit-test</id> <goals> - <goal>report</goal> + <goal>prepare-agent</goal> </goals> + <configuration> + <destFile>${sonar.jacoco.reportPath}</destFile> + <propertyName>surefire.argline</propertyName> + <append>true</append> + </configuration> </execution> + <execution> - <id>default-check</id> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> <goals> - <goal>check</goal> + <goal>prepare-agent-integration</goal> </goals> <configuration> - <rules/> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${sonar.jacoco.itReportPath}</destFile> + <propertyName>failsafe.argline</propertyName> + <append>true</append> </configuration> </execution> </executions> </plugin> + <!-- jacoco end --> + </plugins> </build> </project>