Skip to content
Permalink
Browse files
JENKINS-28659 - Add proper migration of test result path settings for…
… existing projects.
  • Loading branch information
stolp committed May 31, 2015
1 parent c056393 commit 8ef8f774f08a0cc412aa75701792cd8ba1635e26
Showing with 15 additions and 7 deletions.
  1. +15 −7 src/main/java/hudson/plugins/klaros/KlarosTestResultPublisher.java
@@ -94,7 +94,7 @@ public class KlarosTestResultPublisher extends Recorder implements Serializable

/**
* The path test results.
*
*
* @deprecated since 1.5
*/
private String pathTestResults;
@@ -138,12 +138,8 @@ public KlarosTestResultPublisher(final String config, final String iteration, fi
this.env = env;
this.sut = sut;
this.createTestSuite = createTestSuite;
this.pathTestResults = pathTestResults;
this.resultSets = resultSets;
// Migrate old settings
if (StringUtils.isNotEmpty(pathTestResults)) {
this.resultSets = new ResultSet[]{new ResultSet(StringUtils.trim(pathTestResults)) };
}
migratePathTestResults();
this.url = url;
this.username = username;
this.password = password;
@@ -328,7 +324,18 @@ public String getPathTestResults() {
*/
public void setPathTestResults(final String value) {

pathTestResults = StringUtils.trim(value);
migratePathTestResults();
}

/**
* Migrate deprecated path test results setting.
*/
private void migratePathTestResults() {

if (StringUtils.isNotEmpty(pathTestResults)) {
resultSets = new ResultSet[]{new ResultSet(StringUtils.trim(pathTestResults)) };
pathTestResults = null;
}
}

/**
@@ -338,6 +345,7 @@ public void setPathTestResults(final String value) {
*/
public ResultSet[] getResultSets() {

migratePathTestResults();
return resultSets;
}

0 comments on commit 8ef8f77

Please sign in to comment.