Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export some fields about the found failure cause indication #156

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public List<String> getCategories() {
*
* @return the list.
*/
@Exported
public List<FoundIndication> getIndications() {
if (indications == null) {
indications = new LinkedList<FoundIndication>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.sonyericsson.jenkins.plugins.bfa.utils.OldDataConverter;
import hudson.model.Run;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

import java.util.List;
import java.util.Scanner;
Expand All @@ -41,6 +43,7 @@
*
* @author Tomas Westling &lt;[email protected]&gt;
*/
@ExportedBean
@JsonIgnoreProperties(ignoreUnknown = true)
public class FoundIndication {

Expand Down Expand Up @@ -127,6 +130,7 @@ public FoundIndication(@JsonProperty("pattern") String pattern,
*
* @return the file in which we found the match.
*/
@Exported
public String getMatchingFile() {
return matchingFile;
}
Expand All @@ -136,6 +140,7 @@ public String getMatchingFile() {
*
* @return the pattern.
*/
@Exported
public String getPattern() {
return pattern;
}
Expand All @@ -154,6 +159,7 @@ public Run getBuild() {
*
* @return the matching String.
*/
@Exported
public String getMatchingString() {
return matchingString;
}
Expand All @@ -162,6 +168,7 @@ public String getMatchingString() {
* Getter for the first matching line (useful with multi-line build log indications.
* @return the first line from {@code getMatchingString()}.
*/
@Exported
public String getFirstMatchingLine() {
final Scanner scanner = new Scanner(matchingString);
try {
Expand Down Expand Up @@ -204,6 +211,7 @@ public Object readResolve() {
*
* @return the matching line number.
*/
@Exported
public int getMatchingLine() {
if (matchingLine != null) {
return matchingLine;
Expand All @@ -218,6 +226,7 @@ public int getMatchingLine() {
*
* @return the hash of the line of text.
*/
@Exported
public int getMatchingHash() {
if (matchingString != null) {
return matchingString.hashCode();
Expand Down