Skip to content

Commit 5ecc749

Browse files
committed
added analysis from PMD
1 parent 087f842 commit 5ecc749

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
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*.xml target/site/cobertura/coverage.xml master.c9
18+
testspace target/pmd.xml [Tests]target/surefire-reports/TEST*.xml target/site/cobertura/coverage.xml master.c9

README.md

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

1111
[![Build Status](https://travis-ci.org/testspace-samples/java.junit.svg?branch=master)](https://travis-ci.org/testspace-samples/java.junit)
12+
[![CircleCI](https://circleci.com/gh/testspace-samples/java.junit.svg?style=svg)](https://circleci.com/gh/testspace-samples/java.junit)
1213
[![Run Status](https://api.shippable.com/projects/5722082e2a8192902e1e3e96/badge?branch=master)](https://app.shippable.com/projects/5722082e2a8192902e1e3e96)
1314

1415
***
@@ -17,6 +18,7 @@ Publishing **Test Content** using www.testspace.com.
1718
[![Space Health](https://samples.testspace.com/projects/124/spaces/454/badge)](https://samples.testspace.com/projects/124/spaces/454 "Test Cases")
1819
[![Space Metric](https://samples.testspace.com/projects/124/spaces/454/metrics/293/badge)](https://samples.testspace.com/spaces/454/schema/Code%20Coverage "Code Coverage (branches)")
1920
[![Space Metric](https://samples.testspace.com/projects/124/spaces/454/metrics/295/badge)](https://samples.testspace.com/spaces/454/schema/Code%20Coverage "Code Coverage (methods)")
21+
[![Space Metric](https://samples.testspace.com/projects/124/spaces/454/metrics/332/badge)](https://samples.testspace.com/spaces/454/schema/Static%20Analysis "Static Analysis (issues)")
2022

2123

2224
***
@@ -25,13 +27,14 @@ Build examples:
2527

2628
<pre>
2729
mvn clean compile
30+
mvn pmd:pmd
2831
mvn cobertura:cobertura -Dcobertura.report.format=xml
2932
</pre>
3033

3134
Publishing results example:
3235

3336
<pre>
34-
testspace [Tests]target/surefire-reports/TEST*.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/$BRANCH_NAME
37+
testspace target/pmd.xml [Tests]target/surefire-reports/TEST*.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/$BRANCH_NAME
3538
</pre>
3639

3740
Checkout the [Space](https://samples.testspace.com/projects/java.junit).
@@ -42,8 +45,8 @@ To replicate this sample:
4245
- Account at www.testspace.com.
4346
- CI Environment Variable called **TESTSPACE_TOKEN** required:
4447
- `TESTSPACE_TOKEN` = `[email protected]/my-project`
45-
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/using-your-organization:user-settings).
46-
- `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.
47-
48+
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/reference:client-reference#login-credentials).
49+
- `my-org-name.testspace.com/my-project` based on your *organization* (subdomain) and *project* names.
50+
4851

4952

pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@
77
<version>1.0-SNAPSHOT</version>
88
<name>junit</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>junit</groupId>

0 commit comments

Comments
 (0)