Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JENKINS-30369: Support specifying result file formats during result p…
…ublishing
- Loading branch information
stolp
committed
Sep 9, 2015
1 parent
131239f
commit d6a1126
Showing
6 changed files
with
231 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package hudson.plugins.klaros; | ||
|
||
public class ResultFormat { | ||
|
||
private final String id; | ||
private final String name; | ||
|
||
/** | ||
* Instantiates a new result format. | ||
* | ||
* @param id the format id | ||
* @param name the format name | ||
* @param script the script to transform this format | ||
*/ | ||
ResultFormat(final String id, final String name) { | ||
|
||
this.id = id; | ||
this.name = name; | ||
} | ||
|
||
/** | ||
* Gets the id. | ||
* | ||
* @return the id | ||
*/ | ||
public String getId() { | ||
|
||
return id; | ||
} | ||
|
||
/** | ||
* Gets the name. | ||
* | ||
* @return the name | ||
*/ | ||
public String getName() { | ||
|
||
return name; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,87 @@ | ||
/* | ||
* Copyright 2003 - 2015 verit Informationssysteme GmbH, Europaallee 10, | ||
* 67657 Kaiserslautern, Germany, http://www.verit.de. | ||
* | ||
* All rights reserved. | ||
* | ||
* This product or document is protected by copyright and distributed | ||
* under licenses restricting its use, copying, distribution, and | ||
* decompilation. No part of this product or documentation may be | ||
* reproduced in any form by any means without prior written authorization | ||
* of verit Informationssysteme GmbH and its licensors, if any. | ||
*/ | ||
package hudson.plugins.klaros; | ||
|
||
import org.apache.commons.lang.StringUtils; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
/** | ||
* The result set specification. | ||
*/ | ||
public class ResultSet { | ||
|
||
|
||
private static final String DEFAULT_FORMAT = "junit"; | ||
|
||
private String spec; | ||
private String format; | ||
|
||
public ResultSet() { | ||
|
||
format = DEFAULT_FORMAT; | ||
} | ||
|
||
@DataBoundConstructor | ||
public ResultSet(String spec) { | ||
|
||
this.spec = StringUtils.trim(spec); | ||
|
||
this(spec, DEFAULT_FORMAT); | ||
} | ||
|
||
@DataBoundConstructor | ||
public ResultSet(String spec, String format) { | ||
|
||
this.spec = StringUtils.strip(spec); | ||
this.format = StringUtils.strip(format); | ||
if (StringUtils.isBlank(format)) { | ||
format = DEFAULT_FORMAT; | ||
} | ||
} | ||
|
||
/** | ||
* Gets the spec. | ||
* | ||
* @return the spec | ||
*/ | ||
public String getSpec() { | ||
|
||
return spec; | ||
} | ||
|
||
|
||
/** | ||
* Sets the spec. | ||
* | ||
* @param spec the new spec | ||
*/ | ||
public void setSpec(String spec) { | ||
|
||
this.spec = StringUtils.trim(spec); | ||
} | ||
} | ||
|
||
/** | ||
* Gets the format. | ||
* | ||
* @return the format | ||
*/ | ||
public String getFormat() { | ||
|
||
return format; | ||
} | ||
|
||
/** | ||
* Sets the format. | ||
* | ||
* @param format the new format | ||
*/ | ||
public void setFormat(String format) { | ||
|
||
this.format = format; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters