use of org.jenkins.plugins.audit2db.model.BuildDetails in project selenium_java by sergueik.
the class BuildDetailsImplTests method differentIdShouldBreakEquality.
@Test
public void differentIdShouldBreakEquality() {
final BuildDetails expected = getBuildDetails();
final BuildDetails actual = getBuildDetails();
Assert.assertEquals("Broken equality", expected, actual);
actual.setId(actual.getId() + "CHANGED");
Assert.assertFalse("Broken inequality logic", actual.equals(expected));
}
use of org.jenkins.plugins.audit2db.model.BuildDetails 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.model.BuildDetails 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.model.BuildDetails 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.model.BuildDetails in project selenium_java by sergueik.
the class JobsByParamReportTests method paramValueWithWildcardShouldReturnNonEmptyResults.
@Test
public void paramValueWithWildcardShouldReturnNonEmptyResults() {
final JobsByParamReport report = new JobsByParamReportImpl();
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 BuildParameter param = dataset.values().iterator().next().get(0).getParameters().get(0);
final Map<String, List<BuildDetails>> results = report.getProjectExecutions(param.getName(), param.getValue().substring(0) + "%", TestUtils.NOW, TestUtils.NOW);
Assert.assertFalse("Unexpected empty results", results.isEmpty());
}
Aggregations