use of org.jenkins.plugins.audit2db.internal.reports.JobHistoryReportImpl in project selenium_java by sergueik.
the class JobHistoryReportTests method invalidProjectNameShouldReturnEmptyResults.
@Test
public void invalidProjectNameShouldReturnEmptyResults() {
final JobHistoryReport report = new JobHistoryReportImpl();
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 String projectName = dataset.keySet().iterator().next();
final Map<String, List<BuildDetails>> results = report.getProjectExecutions(projectName.substring(0) + " INVALID", TestUtils.NOW, TestUtils.NOW);
Assert.assertTrue("Unexpected results collection", results.isEmpty());
}
use of org.jenkins.plugins.audit2db.internal.reports.JobHistoryReportImpl in project selenium_java by sergueik.
the class JobHistoryReportTests method projectNameWithWildcardShouldReturnNonEmptyResults.
@Test
public void projectNameWithWildcardShouldReturnNonEmptyResults() {
final JobHistoryReport report = new JobHistoryReportImpl();
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 String projectName = dataset.keySet().iterator().next();
final Map<String, List<BuildDetails>> results = report.getProjectExecutions(projectName.substring(0) + "%", TestUtils.NOW, TestUtils.NOW);
Assert.assertFalse("Unexpected empty results", results.isEmpty());
}
use of org.jenkins.plugins.audit2db.internal.reports.JobHistoryReportImpl in project selenium_java by sergueik.
the class JobHistoryReportTests method matchingParametersShouldReturnNonEmptyResults.
@Test
public void matchingParametersShouldReturnNonEmptyResults() {
final JobHistoryReport report = new JobHistoryReportImpl();
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 String projectName = dataset.keySet().iterator().next();
final Map<String, List<BuildDetails>> results = report.getProjectExecutions(projectName, TestUtils.NOW, TestUtils.NOW);
Assert.assertFalse("Unexpected empty results", results.isEmpty());
}
Aggregations