Examples of DefaultIssue


Examples of org.sonar.api.issue.internal.DefaultIssue

        "      ]}");
  }

  @Test
  public void write_no_transitions() throws Exception {
    Issue issue = new DefaultIssue()
      .setKey("ABCD")
      .setComponentKey("sample:src/main/xoo/sample/Sample.xoo")
      .setProjectKey("sample")
      .setRuleKey(RuleKey.of("squid", "AvoidCycle"));
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue

  @Test
  public void should_list_out_transitions_from_status_open() throws Exception {
    workflow.start();

    DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_OPEN);
    List<Transition> transitions = workflow.outTransitions(issue);
    assertThat(transitions).hasSize(3);
    assertThat(keys(transitions)).containsOnly("confirm", "falsepositive", "resolve");
  }
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue

  @Test
  public void should_list_out_transitions_from_status_confirmed() throws Exception {
    workflow.start();

    DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_CONFIRMED);
    List<Transition> transitions = workflow.outTransitions(issue);
    assertThat(transitions).hasSize(3);
    assertThat(keys(transitions)).containsOnly("unconfirm", "falsepositive", "resolve");
  }
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue

  @Test
  public void should_list_out_transitions_from_status_resolved() throws Exception {
    workflow.start();

    DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_RESOLVED);
    List<Transition> transitions = workflow.outTransitions(issue);
    assertThat(transitions).hasSize(1);
    assertThat(keys(transitions)).containsOnly("reopen");
  }
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue

  @Test
  public void should_list_out_transitions_from_status_reopen() throws Exception {
    workflow.start();

    DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_REOPENED);
    List<Transition> transitions = workflow.outTransitions(issue);
    assertThat(transitions).hasSize(3);
    assertThat(keys(transitions)).containsOnly("confirm", "resolve", "falsepositive");
  }
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue

  @Test
  public void should_list_no_out_transition_from_status_closed() throws Exception {
    workflow.start();

    DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_CLOSED);
    List<Transition> transitions = workflow.outTransitions(issue);
    assertThat(transitions).isEmpty();
  }
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue

  @Test
  public void should_list_out_transitions_from_status_closed_on_manual_issue() throws Exception {
    workflow.start();

    // Manual issue because of reporter
    DefaultIssue issue = new DefaultIssue()
      .setKey("ABCDE")
      .setStatus(Issue.STATUS_CLOSED)
      .setRuleKey(RuleKey.of("manual", "Performance"))
      .setReporter("simon");
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue

  @Test
  public void should_fail_if_unknown_status_when_listing_transitions() throws Exception {
    workflow.start();

    DefaultIssue issue = new DefaultIssue().setStatus("xxx");
    try {
      workflow.outTransitions(issue);
      fail();
    } catch (IllegalArgumentException e) {
      assertThat(e).hasMessage("Unknown status: xxx");
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue

  @Test
  public void should_do_automatic_transition() throws Exception {
    workflow.start();

    DefaultIssue issue = new DefaultIssue()
      .setKey("ABCDE")
      .setResolution(Issue.RESOLUTION_FIXED)
      .setStatus(Issue.STATUS_RESOLVED)
      .setNew(false)
      .setEndOfLife(true);
    Date now = new Date();
    workflow.doAutomaticTransition(issue, IssueChangeContext.createScan(now));
    assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_FIXED);
    assertThat(issue.status()).isEqualTo(Issue.STATUS_CLOSED);
    assertThat(issue.closeDate()).isNotNull();
    assertThat(issue.updateDate()).isEqualTo(DateUtils.truncate(now, Calendar.SECOND));
  }
View Full Code Here

Examples of org.sonar.api.issue.internal.DefaultIssue

    }
  }

  private void addUnmatched(Collection<IssueDto> unmatchedIssues, SourceHashHolder sourceHashHolder, Collection<DefaultIssue> issues) {
    for (IssueDto unmatchedDto : unmatchedIssues) {
      DefaultIssue unmatched = unmatchedDto.toDefaultIssue();
      if (StringUtils.isNotBlank(unmatchedDto.getReporter()) && !Issue.STATUS_CLOSED.equals(unmatchedDto.getStatus())) {
        relocateManualIssue(unmatched, unmatchedDto, sourceHashHolder);
      }
      updateUnmatchedIssue(unmatched, false /* manual issues can be kept open */);
      issues.add(unmatched);
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.