Examples of severity()


Examples of org.sonar.api.issue.Issue.severity()

    Issue issue = argumentCaptor.getValue();
    assertThat(issue.ruleKey()).isEqualTo(RuleKey.of("foo", "bar"));
    assertThat(issue.message()).isEqualTo("Foo");
    assertThat(issue.line()).isEqualTo(3);
    assertThat(issue.severity()).isNull();
    assertThat(issue.effortToFix()).isEqualTo(10.0);
  }

  @Test
  public void shouldAddIssueOnDirectory() {
View Full Code Here

Examples of org.sonar.api.issue.Issue.severity()

    Issue issue = argumentCaptor.getValue();
    assertThat(issue.ruleKey()).isEqualTo(RuleKey.of("foo", "bar"));
    assertThat(issue.message()).isEqualTo("Foo");
    assertThat(issue.line()).isNull();
    assertThat(issue.severity()).isNull();
    assertThat(issue.effortToFix()).isEqualTo(10.0);
  }

  @Test
  public void shouldAddIssueOnProject() {
View Full Code Here

Examples of org.sonar.api.issue.Issue.severity()

    session.commit();

    Issue result = service.createManualIssue(file.key(), manualRule.getKey(), 10, "Fix it", null, 2d);

    Issue manualIssue = indexClient.get(IssueIndex.class).getByKey(result.key());
    assertThat(manualIssue.severity()).isEqualTo(Severity.MAJOR);
  }

  @Test
  public void create_manual_issue_with_rule_name_when_no_message() {
    RuleDto manualRule = RuleTesting.newManualRule("manualRuleKey").setName("Manual rule name");
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue.severity()

    assertThat(issue.status()).isEqualTo(Issue.STATUS_CLOSED);
    assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_FALSE_POSITIVE);
    assertThat(issue.effortToFix()).isEqualTo(15.0);
    assertThat(issue.debt()).isEqualTo(Duration.create(10L));
    assertThat(issue.line()).isEqualTo(6);
    assertThat(issue.severity()).isEqualTo("BLOCKER");
    assertThat(issue.message()).isEqualTo("message");
    assertThat(issue.manualSeverity()).isTrue();
    assertThat(issue.reporter()).isEqualTo("arthur");
    assertThat(issue.assignee()).isEqualTo("perceval");
    assertThat(issue.attribute("key")).isEqualTo("value");
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue.severity()

    assertThat(issue.projectKey()).isEqualTo(projectKey);
    assertThat(issue.message()).isEqualTo("the message");
    assertThat(issue.line()).isEqualTo(123);
    assertThat(issue.ruleKey().repository()).isEqualTo("squid");
    assertThat(issue.ruleKey().rule()).isEqualTo("NullDereference");
    assertThat(issue.severity()).isEqualTo(Severity.CRITICAL);
    assertThat(issue.assignee()).isNull();
    assertThat(issue.isNew()).isTrue();
    assertThat(issue.resolution()).isNull();
    assertThat(issue.status()).isEqualTo(Issue.STATUS_OPEN);
    assertThat(issue.attribute("JIRA")).isEqualTo("FOO-123");
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue.severity()

      .componentKey("Action.java")
      .projectKey("org.apache.struts")
      .ruleKey(RuleKey.of("squid", "NullDereference"))
      .build();

    assertThat(issue.severity()).isNull();
  }
}
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue.severity()

    assertThat(issue.key()).isEqualTo("ABCDE");
    assertThat(issue.componentKey()).isEqualTo("struts:org.apache.struts.Action");

    // Scan wins on :
    assertThat(issue.line()).isEqualTo(200);
    assertThat(issue.severity()).isEqualTo(Severity.BLOCKER);
    assertThat(issue.manualSeverity()).isFalse();

    // User wins on :
    assertThat(issue.assignee()).isEqualTo("arthur");
    assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_FALSE_POSITIVE);
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue.severity()

      .setSeverity(Severity.INFO)
      .setManualSeverity(true);

    new UpdateConflictResolver().mergeFields(dbIssue, issue);

    assertThat(issue.severity()).isEqualTo(Severity.INFO);
    assertThat(issue.manualSeverity()).isTrue();
  }
}
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue.severity()

    when(trackingResult.matched()).thenReturn(newArrayList(issue));
    when(trackingResult.matching(eq(issue))).thenReturn(previousIssue);
    decorator.mergeMatched(trackingResult);

    assertThat(issue.manualSeverity()).isTrue();
    assertThat(issue.severity()).isEqualTo("MAJOR");
    verify(updater, never()).setPastSeverity(eq(issue), anyString(), any(IssueChangeContext.class));
  }

  @Test
  public void merge_issue_changelog_with_previous_changelog() throws Exception {
View Full Code Here

Examples of org.sonar.server.issue.index.IssueDoc.severity()

    assertThat(manualIssue.componentUuid()).isEqualTo(file.uuid());
    assertThat(manualIssue.projectUuid()).isEqualTo(project.uuid());
    assertThat(manualIssue.ruleKey()).isEqualTo(manualRule.getKey());
    assertThat(manualIssue.message()).isEqualTo("Fix it");
    assertThat(manualIssue.line()).isEqualTo(10);
    assertThat(manualIssue.severity()).isEqualTo(Severity.MINOR);
    assertThat(manualIssue.effortToFix()).isEqualTo(2d);
    assertThat(manualIssue.reporter()).isEqualTo(connectedUser.getLogin());
  }

  @Test
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.