Search in sources :

Example 1 with JobsByDateReportImpl

use of org.jenkins.plugins.audit2db.internal.reports.JobsByDateReportImpl in project selenium_java by sergueik.

the class JobsByDateReportTests method invalidDateRangeShouldReturnEmptyResults.

@Test
public void invalidDateRangeShouldReturnEmptyResults() {
    final JobsByDateReport report = new JobsByDateReportImpl();
    report.setRepository(TestUtils.getTestRepository());
    final Map<String, List<BuildDetails>> dataset = TestUtils.createRandomDataset(DbAuditUtil.getHostName());
    // after each test run
    for (final List<BuildDetails> detailsList : dataset.values()) {
        TestUtils.getTestRepository().saveBuildDetailsList(detailsList);
    }
    Map<String, List<BuildDetails>> results = report.getProjectExecutions(TestUtils.YESTERDAY, TestUtils.YESTERDAY);
    Assert.assertTrue("Unexpected results collection", results.isEmpty());
    results = report.getProjectExecutions(TestUtils.TOMORROW, TestUtils.TOMORROW);
    Assert.assertTrue("Unexpected results collection", results.isEmpty());
}
Also used : BuildDetails(org.jenkins.plugins.audit2db.model.BuildDetails) List(java.util.List) JobsByDateReport(org.jenkins.plugins.audit2db.reports.JobsByDateReport) JobsByDateReportImpl(org.jenkins.plugins.audit2db.internal.reports.JobsByDateReportImpl) Test(org.junit.Test)

Example 2 with JobsByDateReportImpl

use of org.jenkins.plugins.audit2db.internal.reports.JobsByDateReportImpl in project selenium_java by sergueik.

the class JobsByDateReportTests method matchingParametersShouldReturnNonEmptyResults.

@Test
public void matchingParametersShouldReturnNonEmptyResults() {
    final JobsByDateReport report = new JobsByDateReportImpl();
    report.setRepository(TestUtils.getTestRepository());
    final Map<String, List<BuildDetails>> dataset = TestUtils.createRandomDataset(DbAuditUtil.getHostName());
    // after each test run
    for (final List<BuildDetails> detailsList : dataset.values()) {
        TestUtils.getTestRepository().saveBuildDetailsList(detailsList);
    }
    final Map<String, List<BuildDetails>> results = report.getProjectExecutions(TestUtils.NOW, TestUtils.NOW);
    Assert.assertFalse("Unexpected empty results", results.isEmpty());
}
Also used : BuildDetails(org.jenkins.plugins.audit2db.model.BuildDetails) List(java.util.List) JobsByDateReport(org.jenkins.plugins.audit2db.reports.JobsByDateReport) JobsByDateReportImpl(org.jenkins.plugins.audit2db.internal.reports.JobsByDateReportImpl) Test(org.junit.Test)

Aggregations

List (java.util.List)2 JobsByDateReportImpl (org.jenkins.plugins.audit2db.internal.reports.JobsByDateReportImpl)2 BuildDetails (org.jenkins.plugins.audit2db.model.BuildDetails)2 JobsByDateReport (org.jenkins.plugins.audit2db.reports.JobsByDateReport)2 Test (org.junit.Test)2