Skip to content

Commit 0e120ec

Browse files
committed
added analysis (PMD)
1 parent e34ee5a commit 0e120ec

File tree

5 files changed

+28
-42
lines changed

5 files changed

+28
-42
lines changed

.c9build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ sudo apt-get install openjdk-7-jdk
88
mvn clean compile
99

1010
# Analysis
11+
mvn pmd:pmd
1112

1213
# Test
1314
mvn cobertura:cobertura -Dcobertura.report.format=xml
1415

1516
# Publish
1617
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
17-
testspace [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml master.c9
18+
testspace target/pmd.xml [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml master.c9

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ language:
33

44
script:
55
- mvn clean compile
6+
- mvn pmd:pmd
67
- mvn cobertura:cobertura -Dcobertura.report.format=xml
78

89
after_script:
910
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
10-
- testspace [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}
11+
- testspace target/pmd.xml [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Sample demonstrates techniques for using Testspace with Java code and the [TestN
1010
Using Multiple Online CI Services:
1111

1212
[![Build Status](https://travis-ci.org/testspace-samples/java.testng.svg?branch=master)](https://travis-ci.org/testspace-samples/java.testng)
13+
[![CircleCI](https://circleci.com/gh/testspace-samples/java.testng.svg?style=svg)](https://circleci.com/gh/testspace-samples/java.testng)
1314
[![Run Status](https://api.shippable.com/projects/570770c52a8192902e1bc922/badge?branch=master)](https://app.shippable.com/projects/570770c52a8192902e1bc922)
1415

1516

@@ -19,6 +20,7 @@ Publishing **Test Content** using www.testspace.com.
1920
[![Space Health](https://samples.testspace.com/projects/125/spaces/456/badge)](https://samples.testspace.com/projects/125/spaces/456 "Test Cases")
2021
[![Space Metric](https://samples.testspace.com/projects/125/spaces/456/metrics/299/badge)](https://samples.testspace.com/spaces/456/schema/Code%20Coverage "Code Coverage (branches)")
2122
[![Space Metric](https://samples.testspace.com/projects/125/spaces/456/metrics/301/badge)](https://samples.testspace.com/spaces/456/schema/Code%20Coverage "Code Coverage (methods)")
23+
[![Space Metric](https://samples.testspace.com/projects/125/spaces/456/metrics/333/badge)](https://samples.testspace.com/spaces/456/schema/Static%20Analysis "Static Analysis (issues)")
2224

2325

2426
***
@@ -29,13 +31,14 @@ Build examples:
2931

3032
<pre>
3133
mvn clean compile
34+
mvn pmd:pmd
3235
mvn cobertura:cobertura -Dcobertura.report.format=xml
3336
</pre>
3437

3538
Publishing results example:
3639

3740
<pre>
38-
testspace [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/$BRANCH_NAME
41+
testspace target/pmd.xml [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/$BRANCH_NAME
3942
</pre>
4043

4144
Checkout the [Space](https://samples.testspace.com/projects/java.testng).
@@ -46,8 +49,5 @@ To replicate this sample:
4649
- Account at www.testspace.com.
4750
- CI Environment Variable called **TESTSPACE_TOKEN** required:
4851
- `TESTSPACE_TOKEN` = `[email protected]/my-project`
49-
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/using-your-organization:user-settings).
50-
- `my-org-name.testspace.com/my-project` based on your *subdomain* and *project* names. Refer [here](http://help.testspace.com/reference:runner-reference#login-credentials) for more details.
51-
52-
53-
52+
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/reference:client-reference#login-credentials).
53+
- `my-org-name.testspace.com/my-project` based on your *organization* (subdomain) and *project* names.

pom.xml

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@
77
<version>1.0-SNAPSHOT</version>
88
<name>testng</name>
99
<url>http://maven.apache.org</url>
10+
<reporting>
11+
<plugins>
12+
<plugin>
13+
<groupId>org.apache.maven.plugins</groupId>
14+
<artifactId>maven-pmd-plugin</artifactId>
15+
<version>3.6</version>
16+
<configuration>
17+
<rulesets>
18+
<!-- Two rule sets that come bundled with PMD -->
19+
<ruleset>/rulesets/java/braces.xml</ruleset>
20+
<ruleset>/rulesets/java/naming.xml</ruleset>
21+
</rulesets>
22+
</configuration>
23+
</plugin>
24+
</plugins>
25+
</reporting>
1026
<dependencies>
1127
<dependency>
1228
<groupId>org.testng</groupId>
@@ -15,37 +31,4 @@
1531
<scope>test</scope>
1632
</dependency>
1733
</dependencies>
18-
<reporting>
19-
<plugins>
20-
<!-- integrate maven-cobertura-plugin to project site -->
21-
<plugin>
22-
<groupId>org.codehaus.mojo</groupId>
23-
<artifactId>cobertura-maven-plugin</artifactId>
24-
<version>2.6</version>
25-
<configuration>
26-
<formats>
27-
<format>html</format>
28-
<format>xml</format>
29-
</formats>
30-
</configuration>
31-
</plugin>
32-
</plugins>
33-
</reporting>
34-
<build>
35-
<pluginManagement>
36-
<plugins>
37-
<plugin>
38-
<groupId>org.apache.maven.plugins</groupId>
39-
<artifactId>maven-compiler-plugin</artifactId>
40-
<configuration>
41-
<source>1.7</source>
42-
<target>1.7</target>
43-
<showDeprecation>true</showDeprecation>
44-
<showWarnings>true</showWarnings>
45-
<fork>true</fork>
46-
</configuration>
47-
</plugin>
48-
</plugins>
49-
</pluginManagement>
50-
</build>
5134
</project>

shippable.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ env:
66

77
script:
88
- mvn clean compile
9+
- mvn pmd:pmd
910
- mvn cobertura:cobertura -Dcobertura.report.format=xml
1011

1112
after_script:
1213
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
13-
- testspace [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/${BRANCH}#ship.Build.${BUILD_NUMBER}
14+
- testspace target/pmd.xml [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/${BRANCH}#ship.Build.${BUILD_NUMBER}
1415

0 commit comments

Comments
 (0)