private static org.sonar.runner.api.Issue transformIssue(org.sonar.runner.batch.IssueListener.Issue batchIssue) {
org.sonar.runner.api.Issue.Builder issueBuilder = org.sonar.runner.api.Issue.builder();
- issueBuilder.setAssignee(batchIssue.getAssignee());
+ issueBuilder.setAssigneeLogin(batchIssue.getAssigneeLogin());
+ issueBuilder.setAssigneeName(batchIssue.getAssigneeName());
issueBuilder.setComponentKey(batchIssue.getComponentKey());
issueBuilder.setKey(batchIssue.getKey());
issueBuilder.setLine(batchIssue.getLine());
issueBuilder.setMessage(batchIssue.getMessage());
issueBuilder.setNew(batchIssue.isNew());
issueBuilder.setResolution(batchIssue.getResolution());
- issueBuilder.setRule(batchIssue.getRule());
+ issueBuilder.setRuleKey(batchIssue.getRuleKey());
+ issueBuilder.setRuleName(batchIssue.getRuleName());
+ issueBuilder.setSeverity(batchIssue.getSeverity());
issueBuilder.setStatus(batchIssue.getStatus());
return issueBuilder.build();
private final String componentKey;
private final Integer line;
private final String message;
- private final String rule;
+ private final String ruleKey;
+ private final String ruleName;
private final String status;
private final String resolution;
private final boolean isNew;
- private final String assignee;
+ private final String assigneeLogin;
+ private final String assigneeName;
+ private final String severity;
- private Issue(String key, String componentKey, Integer line, String message, String rule, String status, String resolution, boolean isNew, String assignee) {
+ private Issue(String key, String componentKey, Integer line, String message, String ruleKey, String ruleName, String status, String resolution, boolean isNew,
+ String assigneeLogin, String assigneeName, String severity) {
super();
this.key = key;
this.componentKey = componentKey;
this.line = line;
this.message = message;
- this.rule = rule;
+ this.ruleKey = ruleKey;
+ this.ruleName = ruleName;
this.status = status;
this.resolution = resolution;
this.isNew = isNew;
- this.assignee = assignee;
+ this.assigneeLogin = assigneeLogin;
+ this.assigneeName = assigneeName;
+ this.severity = severity;
}
public static class Builder {
private String componentKey;
private Integer line;
private String message;
- private String rule;
+ private String ruleKey;
+ private String ruleName;
private String status;
private String resolution;
private boolean isNew;
- private String assignee;
+ private String assigneeLogin;
+ private String assigneeName;
+ private String severity;
public String getKey() {
return key;
return this;
}
- public String getRule() {
- return rule;
+ public String getRuleKey() {
+ return ruleKey;
}
- public Builder setRule(String rule) {
- this.rule = rule;
+ public Builder setRuleKey(String ruleKey) {
+ this.ruleKey = ruleKey;
+ return this;
+ }
+
+ public String getRuleName() {
+ return ruleKey;
+ }
+
+ public Builder setRuleName(String ruleName) {
+ this.ruleName = ruleName;
return this;
}
return this;
}
- public String getAssignee() {
- return assignee;
+ public String getAssigneeLogin() {
+ return assigneeLogin;
}
- public Builder setAssignee(String assignee) {
- this.assignee = assignee;
+ public Builder setAssigneeLogin(String assigneeLogin) {
+ this.assigneeLogin = assigneeLogin;
+ return this;
+ }
+
+ public String getAssigneeName() {
+ return assigneeName;
+ }
+
+ public Builder setAssigneeName(String assigneeName) {
+ this.assigneeName = assigneeName;
+ return this;
+ }
+
+ public String getSeverity() {
+ return severity;
+ }
+
+ public Builder setSeverity(String severity) {
+ this.severity = severity;
return this;
}
public Issue build() {
- return new Issue(key, componentKey, line, message, rule, status, resolution, isNew, assignee);
+ return new Issue(key, componentKey, line, message, ruleKey, ruleName, status, resolution, isNew, assigneeLogin, assigneeName, severity);
}
}
return message;
}
- public String getRule() {
- return rule;
+ public String getRuleKey() {
+ return ruleKey;
+ }
+
+ public String getRuleName() {
+ return ruleName;
}
public String getStatus() {
return isNew;
}
- public String getAssignee() {
- return assignee;
+ public String getAssigneeLogin() {
+ return assigneeLogin;
+ }
+
+ public String getAssigneeName() {
+ return assigneeName;
+ }
+
+ public String getSeverity() {
+ return severity;
}
}
IssueListenerAdapter adapter = new IssueListenerAdapter(apiIssueListener);
org.sonar.runner.batch.IssueListener.Issue batchIssue = new org.sonar.runner.batch.IssueListener.Issue();
- batchIssue.setAssignee("assignee");
+ batchIssue.setAssigneeName("assignee");
adapter.handle(batchIssue);
assertThat(issuesRecorded).hasSize(1);
- assertThat(issuesRecorded.get(0).getAssignee()).isEqualTo("assignee");
+ assertThat(issuesRecorded.get(0).getAssigneeName()).isEqualTo("assignee");
}
@Test(expected = IllegalArgumentException.class)
private String componentKey;
private Integer line;
private String message;
- private String rule;
+ private String ruleKey;
+ private String ruleName;
private String status;
private String resolution;
private boolean isNew;
- private String assignee;
+ private String assigneeLogin;
+ private String assigneeName;
+ private String severity;
+
+ public String getSeverity() {
+ return severity;
+ }
+
+ public void setSeverity(String severity) {
+ this.severity = severity;
+ }
+
+ public String getKey() {
+ return key;
+ }
public void setKey(String key) {
this.key = key;
}
+ public String getComponentKey() {
+ return componentKey;
+ }
+
public void setComponentKey(String componentKey) {
this.componentKey = componentKey;
}
+ public Integer getLine() {
+ return line;
+ }
+
public void setLine(Integer line) {
this.line = line;
}
+ public String getMessage() {
+ return message;
+ }
+
public void setMessage(String message) {
this.message = message;
}
- public void setRule(String rule) {
- this.rule = rule;
+ public String getRuleKey() {
+ return ruleKey;
}
- public void setStatus(String status) {
- this.status = status;
+ public void setRuleKey(String ruleKey) {
+ this.ruleKey = ruleKey;
}
- public void setResolution(String resolution) {
- this.resolution = resolution;
+ public String getRuleName() {
+ return ruleName;
}
- public void setNew(boolean isNew) {
- this.isNew = isNew;
+ public void setRuleName(String ruleName) {
+ this.ruleName = ruleName;
}
- public void setAssignee(String assignee) {
- this.assignee = assignee;
+ public String getStatus() {
+ return status;
}
- public String getKey() {
- return key;
+ public void setStatus(String status) {
+ this.status = status;
}
- public String getComponentKey() {
- return componentKey;
+ public String getResolution() {
+ return resolution;
}
- public Integer getLine() {
- return line;
+ public void setResolution(String resolution) {
+ this.resolution = resolution;
}
- public String getMessage() {
- return message;
+ public boolean isNew() {
+ return isNew;
}
- public String getRule() {
- return rule;
+ public void setNew(boolean isNew) {
+ this.isNew = isNew;
}
- public String getStatus() {
- return status;
+ public String getAssigneeLogin() {
+ return assigneeLogin;
}
- public String getResolution() {
- return resolution;
+ public void setAssigneeLogin(String assigneeLogin) {
+ this.assigneeLogin = assigneeLogin;
}
- public boolean isNew() {
- return isNew;
+ public String getAssigneeName() {
+ return assigneeName;
}
- public String getAssignee() {
- return assignee;
+ public void setAssigneeName(String assigneeName) {
+ this.assigneeName = assigneeName;
}
}
*/
package org.sonar.runner.batch;
-import org.sonar.api.issue.Issue;
import org.sonar.batch.bootstrapper.Batch;
import org.sonar.batch.bootstrapper.LogOutput;
private static IssueListener.Issue transformIssue(Issue batchIssue) {
IssueListener.Issue newIssue = new IssueListener.Issue();
- newIssue.setAssignee(batchIssue.assignee());
- newIssue.setComponentKey(batchIssue.componentKey());
- newIssue.setKey(batchIssue.key());
- newIssue.setResolution(batchIssue.resolution());
- newIssue.setRule(batchIssue.ruleKey().toString());
- newIssue.setMessage(batchIssue.message());
+
+ newIssue.setAssigneeLogin(batchIssue.getAssigneeLogin());
+ newIssue.setAssigneeName(batchIssue.getAssigneeName());
+ newIssue.setComponentKey(batchIssue.getComponentKey());
+ newIssue.setKey(batchIssue.getKey());
+ newIssue.setResolution(batchIssue.getResolution());
+ newIssue.setRuleKey(batchIssue.getRuleKey());
+ newIssue.setRuleName(batchIssue.getRuleName());
+ newIssue.setMessage(batchIssue.getMessage());
newIssue.setNew(batchIssue.isNew());
- newIssue.setLine(batchIssue.line());
-
+ newIssue.setLine(batchIssue.getLine());
+ newIssue.setSeverity(batchIssue.getSeverity());
+ newIssue.setStatus(batchIssue.getStatus());
+
return newIssue;
}
}