Package org.sonar.api.issue.internal

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


    assertThat(issue).isNotNull();
    assertThat(issue.key()).isNotNull();
    assertThat(issue.effortToFix()).isEqualTo(10000.0);
    assertThat(issue.componentKey()).isEqualTo(componentKey);
    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);
View Full Code Here


    assertThat(issue.componentKey()).isEqualTo("org.sonar.sample:Sample");
    assertThat(issue.componentId()).isEqualTo(1L);
    assertThat(issue.moduleUuid()).isEqualTo("BCDE");
    assertThat(issue.moduleUuidPath()).isEqualTo("ABCD.BCDE.");
    assertThat(issue.projectUuid()).isEqualTo("ABCD");
    assertThat(issue.projectKey()).isEqualTo("org.sonar.sample");
    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);
View Full Code Here

  private void verifyIssuesAreAllRelatedOnActionPlanProject(List<Issue> issues, ActionPlan actionPlan) {
    String projectKey = actionPlan.projectKey();
    for (Issue issue : issues) {
      DefaultIssue defaultIssue = (DefaultIssue) issue;
      String issueProjectKey = defaultIssue.projectKey();
      if (issueProjectKey == null || !issueProjectKey.equals(projectKey)) {
        throw new IllegalArgumentException("Issues are not all related to the action plan project: " + projectKey);
      }
    }
  }
View Full Code Here

      if (!action.supports(issue)) {
        throw new IllegalStateException("A condition is not respected");
      }

      IssueChangeContext changeContext = IssueChangeContext.createUser(new Date(), userSession.login());
      Component project = dbClient.componentDao().getByKey(session, issue.projectKey());
      FunctionContext functionContext = new FunctionContext(issue, updater, changeContext, getProjectSettings(project));
      for (Function function : action.functions()) {
        function.execute(functionContext);
      }
      issueStorage.save(issue);
View Full Code Here

    return Iterables.find(workflow.outTransitions(issue), new Predicate<Transition>() {
      @Override
      public boolean apply(Transition input) {
        return input.key().equals(transition) &&
          (StringUtils.isBlank(input.requiredProjectPermission()) ||
          userSession.hasProjectPermission(input.requiredProjectPermission(), defaultIssue.projectKey()));
      }
    }, null) != null;
  }

  private String transition(Map<String, Object> properties) {
View Full Code Here

    verifyLoggedIn();

    DbSession session = dbClient.openSession(false);
    try {
      DefaultIssue issue = getByKeyForUpdate(session, issueKey).toDefaultIssue();
      UserSession.get().checkProjectPermission(UserRole.ISSUE_ADMIN, issue.projectKey());

      IssueChangeContext context = IssueChangeContext.createUser(new Date(), UserSession.get().login());
      if (issueUpdater.setManualSeverity(issue, severity, context)) {
        saveIssue(session, issue, context, null);
      }
View Full Code Here

    assertThat(issue.line()).isEqualTo(42);
    assertThat(issue.message()).isEqualTo("the message");
    assertThat(issue.key()).isNotEmpty();
    assertThat(issue.ruleKey().toString()).isEqualTo("squid:AvoidCycle");
    assertThat(issue.componentKey()).isEqualTo("struts:src/org/struts/Action.java");
    assertThat(issue.projectKey()).isEqualTo("org.apache:struts-core");
  }

  @Test
  public void filter_issue() throws Exception {
    ruleBuilder.add(SQUID_RULE_KEY).setName(SQUID_RULE_NAME);
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.