Skip to content

Commit

Permalink
Merge branch 'releases/1.2.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
benhamidene committed Nov 13, 2016
2 parents 3cc3c93 + 5be3f48 commit 5357a98
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 28 deletions.
11 changes: 7 additions & 4 deletions livingdoc-reports/src/license/THIRD-PARTY.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
# - Apache License, Version 2.0
# - Apache Software License, version 1.1
# - BSD
# - BSD 3-clause
# - BSD License
# - BSD style
# - BSD style license
# - CDDL
# - CDDL + GPLv2 with classpath exception
# - CDDL , GPL 2.0
# - CDDL or GPL 2 with Classpath Exception
# - CDDL v1.1 / GPL v2 dual license
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE
Expand All @@ -38,28 +40,29 @@
# - MIT license
# - MPL 1.1
# - NetBeans CDDL/GPL
# - Public
# - Public Domain
# - The Apache License, Version 2.0
# - The Apache Software License, Version 2.0
# - The BSD License
# - The MIT license
# - The New BSD License
# - Unknown
# - WTFPL
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
#Mon Oct 03 22:48:25 CEST 2016
#Sun Nov 13 08:33:28 CET 2016
antlr--antlr--2.7.6=The BSD License
commons-jelly--commons-jelly-tags-fmt--1.0=The Apache Software License, Version 2.0
commons-jelly--commons-jelly-tags-xml--1.1=The Apache Software License, Version 2.0
javax.servlet--jstl--1.1.0=CDDL , GPL 2.0
javax.servlet--servlet-api--2.4=CDDL , GPL 2.0
jaxen--jaxen--1.1-beta-11=BSD 3-clause
net.jcip--jcip-annotations--1.0=Public
ognl--ognl--2.7.3=The Apache License, Version 2.0
org.jenkins-ci--commons-jelly--1.1-jenkins-20120928=Unknown
org.jenkins-ci.dom4j--dom4j--1.6.1-jenkins-4=Unknown
org.jvnet--tiger-types--1.3=CDDL 1.0
org.jvnet--tiger-types--1.3=unknown
org.jvnet.hudson--activation--1.1.1-hudson-1=Unknown
org.jvnet.hudson--commons-jelly-tags-define--1.0.1-hudson-20071021=Unknown
org.kohsuke.jinterop--j-interop--2.0.6-kohsuke-1=MIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,9 @@ public void setSystemProperties(String systemProperties) {
this.systemProperties = systemProperties;
}


String[] getListOfFilenamePrefixes(){
return StringUtils.split(filenamePrefix, " ,");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Vector;
import java.util.logging.Logger;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.tools.ant.filters.StringInputStream;
import org.apache.xmlrpc.XmlRpcClient;
Expand Down Expand Up @@ -110,7 +111,7 @@ private List<SpecificationLocation> downloadSpecificationLocations(String repoUI
private SpecificationLocation findSpecificationLocationFor(List<SpecificationLocation> specLocationList, String location)
throws DocumentNotFoundException {
for (SpecificationLocation loc : specLocationList) {
if (loc.getSpecificationName().equals(location)){
if (loc.getSpecificationName().equals(location)) {
return loc;
}
}
Expand All @@ -130,9 +131,13 @@ private URI generateXmlRpcUrl() {
String getLocation(String filename) {
LOGGER.entering(getClass().getCanonicalName(), "getLocation", filename);
StringBuilder location = new StringBuilder(filename);
if (StringUtils.isNotEmpty(confluenceConfig.getFilenamePrefix()) && filename.startsWith(confluenceConfig
.getFilenamePrefix())) {
location.delete(0, confluenceConfig.getFilenamePrefix().length());
String[] prefixes = confluenceConfig.getListOfFilenamePrefixes();
if (prefixes != null) {
for (int i = 0; i < prefixes.length; i ++ ) {
if (filename.startsWith(prefixes[i])) {
location.delete(0, prefixes[i].length());
}
}
}

for (String postfix : REMOVEABLE_POSTFIXES) {
Expand Down Expand Up @@ -198,8 +203,7 @@ public void publishToConfluence(SummaryBuildReportBean summaryBuildReport) {
}
}

private void saveExecutionResult(SpecificationLocation specificationLocation, String normalizedXmlReport)
{
private void saveExecutionResult(SpecificationLocation specificationLocation, String normalizedXmlReport) {
URI location = URI.create(URIUtil.raw(specificationLocation.getBaseTestUrl()));

ExecutionResult execResult = new ExecutionResult();
Expand All @@ -217,12 +221,10 @@ private void saveExecutionResult(SpecificationLocation specificationLocation, St
if ( ! ( ExecutionResult.SUCCESS.equals(msg) )) {
throw new IllegalStateException(msg);
}
} catch (XmlRpcException | IOException e) {
} catch (XmlRpcException | IOException e) {
throw new IllegalStateException(e);
}



}

private void setSystemProperties() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class LivingDocBuildAction implements HealthReportingAction, StaplerProxy

private final SummaryBuildReportBean summary;

public LivingDocBuildAction(Run< ? , ? > run, SummaryBuildReportBean summary) {
public LivingDocBuildAction(Run< ? , ? > run , SummaryBuildReportBean summary) {
this.run = run;
this.summary = summary;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.logging.Logger;

import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
Expand Down Expand Up @@ -110,7 +109,8 @@ public String getDisplayName() {
}

public Graph getGraph() {
Calendar timestamp = project.getLastCompletedBuild().getTimestamp();
Calendar timestamp =project.getLastBuild() == null ? Calendar.getInstance() : project.getLastCompletedBuild().getTimestamp();

return new ProjectSummaryChart(timestamp, getAllLivingDocBuildSummaries());
}

Expand All @@ -137,4 +137,13 @@ public String getUrlName() {
public boolean hasSummaries() {
return getAllLivingDocBuildSummaries().size() > 0;
}

public LivingDocBuildAction getLastBuildAction() {
Run<? , ?> run = project.getLastBuild();
if (run != null) {
return run.getAction(LivingDocBuildAction.class);
}

return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void perform(Run< ? , ? > run, FilePath filePath, Launcher launcher, Task
}
LivingDocBuildAction action = run.getAction(LivingDocBuildAction.class);
if (action == null) {
action = new LivingDocBuildAction(run, summary);
action = new LivingDocBuildAction(run, summary.withoutXmlReports());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,11 @@ public boolean hasNoReports() {
public boolean hasReports() {
return ! hasNoReports();
}

public SummaryBuildReportBean withoutXmlReports(){
for(BuildReportBean report : buildReports){
report.setXmlReport(null);
}
return this;
}
}
2 changes: 1 addition & 1 deletion livingdoc-reports/src/main/resources/index.jelly
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div>
<img src="${app.rootUrl}plugin/livingdoc-reports/images/ld_logo_16.png"/>
This plugin integrates <a href="https://testit-livingdoc.atlassian.net/wiki/">testIT LivingDoc </a> test reports to Jenkins and publishes the results to a confluence instance with testIT LivingDoc support.
This plugin integrates <a href="https://testit-livingdoc.atlassian.net/wiki/">LivingDoc</a> test reports to Jenkins and publishes the results to a confluence instance with LivingDoc support.
</div>
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:local="local">
<div class="test-trend-caption">
testIT LivingDoc Result-History
LivingDoc Result-History
</div>

<j:if test="${from.hasSummaries()}">
<img id="gp_project_graph" src="${from.urlName}/graph/png" width="750" height="450" alt="[testIT LivingDoc Result-History]"/>
<j:if test="${from.hasSummaries()}">
<img id="ld_result_graph" src="${from.urlName}/graph/png" width="750" height="450" alt="[LivingDoc Result-History]"/>
</j:if>
</j:jelly>
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
The file name prefix and the file name postfix are used to extract the document name from the report file name. If you have added a prefix for your files the provide the prefix here
The file name prefix is used to extract the document name from the report file name. If you have added a prefix for your files the provide the prefix here.
You can provide a comma separated list of prefixes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The test results pattern may be defined as aregular expression.
Note that test files must be in LivingDoc XML format. For more information visit:
<a href="https://testit-livingdoc.atlassian.net/wiki/">testIT LivingDoc Documentation Site</a>
<a href="https://testit-livingdoc.atlassian.net/wiki/">LivingDoc Documentation Site</a>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LivingDocPublisher.livingdoc.publisher.displayname=Generate and publish testIT LivingDoc reports
LivingDocBuildAction.description=testIT LivingDoc statistics: {0}
LivingDocPublisher.livingdoc.publisher.displayname=Generate and publish LivingDoc reports
LivingDocBuildAction.description=LivingDoc statistics: {0}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<l:layout xmlns:livingdoc="/hudson/plugins/livingdoc-reports/tags" css="/plugin/livingdoc-reports/css/style.css">
<st:include it="${it.build}" page="sidepanel.jelly"/>
<l:main-panel>
<h1 id="ld_build_${it.build.number}">testIT LivingDoc Test Report (Build: ${it.build.number})</h1>
<h1 id="ld_build_${it.build.number}">LivingDoc Test Report (Build: ${it.build.number})</h1>
<table class="pane">
<tbody>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.17</version>
<version>2.19</version>
</parent>

<groupId>info.novatec.testit</groupId>
Expand Down

0 comments on commit 5357a98

Please sign in to comment.