Examples of AnalysisReportDto


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

  @Test
  public void insert_multiple_reports() {
    db.prepareDbUnit(getClass(), "empty.xml");

    AnalysisReportDto report = new AnalysisReportDto()
      .setProjectKey(DEFAULT_PROJECT_KEY)
      .setSnapshotId(DEFAULT_SNAPSHOT_ID)
      .setData("data-project")
      .setStatus(PENDING)
      .setStartedAt(DateUtils.parseDate("2014-09-25"))
View Full Code Here

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

  public void find_one_report_by_project_key() {
    db.prepareDbUnit(getClass(), "select.xml");

    final String projectKey = "123456789-987654321";
    List<AnalysisReportDto> reports = sut.findByProjectKey(session, projectKey);
    AnalysisReportDto report = reports.get(0);

    assertThat(reports).hasSize(1);
    assertThat(report.getProjectKey()).isEqualTo(projectKey);
    assertThat(report.getId()).isEqualTo(1);
  }
View Full Code Here

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

  @Test
  public void get_oldest_available_report() {
    db.prepareDbUnit(getClass(), "select_oldest_available_report.xml");

    final String projectKey = "123456789-987654321";
    AnalysisReportDto nextAvailableReport = sut.getNextAvailableReport(session);

    assertThat(nextAvailableReport.getId()).isEqualTo(2);
    assertThat(nextAvailableReport.getProjectKey()).isEqualTo(projectKey);
  }
View Full Code Here

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

  @Test
  public void get_oldest_available_report_with_working_reports_older() {
    db.prepareDbUnit(getClass(), "select_oldest_available_report_with_working_reports_older.xml");

    final String projectKey = "123456789-987654321";
    AnalysisReportDto nextAvailableReport = sut.getNextAvailableReport(session);

    assertThat(nextAvailableReport.getId()).isEqualTo(2);
    assertThat(nextAvailableReport.getProjectKey()).isEqualTo(projectKey);
  }
View Full Code Here

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

  @Test
  public void null_when_no_available_pending_report_because_working_report_on_the_same_project() {
    db.prepareDbUnit(getClass(), "select-with-no-available-report.xml");

    AnalysisReportDto nextAvailableReport = sut.getNextAvailableReport(session);

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

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

  @Test
  public void getById_maps_all_the_fields_except_the_data() {
    db.prepareDbUnit(getClass(), "one_analysis_report.xml");

    AnalysisReportDto report = sut.getById(session, 1L);

    assertThat(report.getProjectKey()).isEqualTo(DEFAULT_PROJECT_KEY);
    assertThat(report.getCreatedAt()).isEqualTo(DateUtils.parseDate("2014-09-24"));
    assertThat(report.getUpdatedAt()).isEqualTo(DateUtils.parseDate("2014-09-25"));
    assertThat(report.getStartedAt()).isEqualTo(DateUtils.parseDate("2014-09-26"));
    assertThat(report.getFinishedAt()).isEqualTo(DateUtils.parseDate("2014-09-27"));
    assertThat(report.getStatus()).isEqualTo(WORKING);
    assertThat(report.getData()).isNull();
    assertThat(report.getKey()).isEqualTo("1");
  }
View Full Code Here

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

  @Test
  public void getById_returns_null_when_id_not_found() {
    db.prepareDbUnit(getClass(), "select.xml");

    AnalysisReportDto report = sut.getById(session, 4L);

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

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

    assertThat(report).isNull();
  }

  @Test(expected = NullPointerException.class)
  public void nullPointerExc_when_trying_to_book_a_report_without_id() {
    sut.bookAnalysisReport(session, new AnalysisReportDto());
  }
View Full Code Here

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

  @Test
  public void cannot_book_an_already_working_report_analysis() {
    db.prepareDbUnit(getClass(), "one_busy_report_analysis.xml");

    AnalysisReportDto report = newDefaultReport();
    AnalysisReportDto reportBooked = sut.bookAnalysisReport(session, report);

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

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

  public void book_one_available_report_analysis() {
    Date mockedNow = DateUtils.parseDate("2014-09-30");
    when(system2.now()).thenReturn(mockedNow.getTime());
    db.prepareDbUnit(getClass(), "one_available_analysis.xml");

    AnalysisReportDto report = newDefaultReport();
    AnalysisReportDto reportBooked = sut.bookAnalysisReport(session, report);

    assertThat(reportBooked.getId()).isEqualTo(1L);
    assertThat(reportBooked.getStatus()).isEqualTo(WORKING);
    assertThat(reportBooked.getStartedAt()).isEqualTo(mockedNow);
  }
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.