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());
}
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());
}
Aggregations