Examples of AnalysisReportDto


Examples of org.sonar.core.computation.db.AnalysisReportDto

  public void create_analysis_report_and_retrieve_it() {
    insertPermissionsForProject(DEFAULT_PROJECT_KEY);
    sut.add(DEFAULT_PROJECT_KEY, 123L);

    List<AnalysisReportDto> reports = sut.findByProjectKey(DEFAULT_PROJECT_KEY);
    AnalysisReportDto report = reports.get(0);

    assertThat(reports).hasSize(1);
    assertThat(report.getProjectKey()).isEqualTo(DEFAULT_PROJECT_KEY);
    assertThat(report.getSnapshotId()).isEqualTo(123L);
    assertThat(report.getCreatedAt()).isNotNull();
  }
View Full Code Here

Examples of org.sonar.core.computation.db.AnalysisReportDto

    sut.add(DEFAULT_PROJECT_KEY, 123L);
    sut.add("2", 123L);
    sut.add("3", 123L);

    AnalysisReportDto firstBookedReport = sut.bookNextAvailable();
    AnalysisReportDto secondBookedReport = sut.bookNextAvailable();
    AnalysisReportDto thirdBookedReport = sut.bookNextAvailable();

    assertThat(firstBookedReport.getProjectKey()).isEqualTo(DEFAULT_PROJECT_KEY);
    assertThat(firstBookedReport.getStatus()).isEqualTo(WORKING);
    assertThat(firstBookedReport.getStartedAt()).isNotNull();
    assertThat(secondBookedReport.getProjectKey()).isEqualTo("2");
    assertThat(thirdBookedReport.getProjectKey()).isEqualTo("3");
  }
View Full Code Here

Examples of org.sonar.core.computation.db.AnalysisReportDto

    assertThat(thirdBookedReport.getProjectKey()).isEqualTo("3");
  }

  @Test
  public void search_for_available_report_when_no_report_available() {
    AnalysisReportDto nullAnalysisReport = sut.bookNextAvailable();

    assertThat(nullAnalysisReport).isNull();
  }
View Full Code Here

Examples of org.sonar.core.computation.db.AnalysisReportDto

  @Test
  public void remove_remove_from_queue() {
    insertPermissionsForProject(DEFAULT_PROJECT_KEY);
    sut.add(DEFAULT_PROJECT_KEY, 123L);
    AnalysisReportDto report = sut.bookNextAvailable();
    report.setStatus(SUCCESS);

    sut.remove(report);

    assertThat(sut.all()).isEmpty();
  }
View Full Code Here

Examples of org.sonar.core.computation.db.AnalysisReportDto

    session.commit();

    clearIssueIndexToSimulateBatchInsertWithoutIndexing();

    queue.add(DEFAULT_PROJECT_KEY, 123L);
    AnalysisReportDto report = queue.bookNextAvailable();

    sut.execute(session, report, project);

    // Check that the issue has well be indexed in E/S
    assertThat(tester.get(IssueIndex.class).getNullableByKey(issue.getKey())).isNotNull();
View Full Code Here

Examples of org.sonar.core.computation.db.AnalysisReportDto

    clearIssueIndexToSimulateBatchInsertWithoutIndexing();

    queue.add(DEFAULT_PROJECT_KEY, 123L);
    List<AnalysisReportDto> reports = queue.findByProjectKey(DEFAULT_PROJECT_KEY);
    AnalysisReportDto reportDto = reports.get(0);

    // ACT
    sut.execute(session, reportDto, project);

    session.commit();
View Full Code Here

Examples of org.sonar.core.computation.db.AnalysisReportDto

      mock(AnalysisReportHistorySearchAction.class)));
  }

  @Test
  public void list_active_reports() throws Exception {
    AnalysisReportDto report = AnalysisReportDto
      .newForTests(1L)
      .setProjectKey("project-name")
      .setStatus(PENDING)
      .setData(null)
      .setCreatedAt(DateUtils.parseDateTime("2014-10-13T00:00:00+0200"))
View Full Code Here

Examples of org.sonar.core.computation.db.AnalysisReportDto

    this.sut = new DataCleanerStep(projectSettingsFactory, purgeTask, issueIndex);
  }

  @Test
  public void call_purge_method_of_the_purge_task() {
    AnalysisReportDto report = mock(AnalysisReportDto.class);
    ComponentDto project = mock(ComponentDto.class);

    sut.execute(mock(DbSession.class), report, project);

    verify(projectSettingsFactory).newProjectSettings(anyLong(), any(DbSession.class));
View Full Code Here

Examples of org.sonar.core.computation.db.AnalysisReportDto

    verify(service, never()).analyzeReport(any(AnalysisReportDto.class));
  }

  @Test
  public void call_findAndBook_and_then_analyze_if_there_is_a_report() {
    AnalysisReportDto report = AnalysisReportDto.newForTests(1L);
    when(queue.bookNextAvailable()).thenReturn(report);

    sut.run();

    verify(queue).bookNextAvailable();
View Full Code Here

Examples of org.sonar.core.computation.db.AnalysisReportDto

  @Test(expected = ForbiddenException.class)
  public void user_rights_is_not_enough_throw_ForbiddenException() throws Exception {
    insertPermissionsForProject(DEFAULT_PROJECT_KEY);
    queue.add(DEFAULT_PROJECT_KEY, 123L);

    AnalysisReportDto report = queue.all().get(0);
    report.succeed();
    queue.remove(report);
    userSession.setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);

    WsTester.TestRequest sut = wsTester.newGetRequest(AnalysisReportWebService.API_ENDPOINT, AnalysisReportHistorySearchAction.SEARCH_ACTION);
    sut.execute();
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.