use of org.jenkins.plugins.audit2db.internal.reports.JobsByParamReportImpl 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());
}
use of org.jenkins.plugins.audit2db.internal.reports.JobsByParamReportImpl in project selenium_java by sergueik.
the class JobsByParamReportTests method matchingParametersShouldReturnNonEmptyResults.
@Test
public void matchingParametersShouldReturnNonEmptyResults() {
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(), TestUtils.NOW, TestUtils.NOW);
Assert.assertFalse("Unexpected empty results", results.isEmpty());
}
use of org.jenkins.plugins.audit2db.internal.reports.JobsByParamReportImpl in project selenium_java by sergueik.
the class JobsByParamReportTests method invalidParamNameShouldReturnEmptyResults.
@Test
public void invalidParamNameShouldReturnEmptyResults() {
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() + " INVALID", param.getValue(), TestUtils.NOW, TestUtils.NOW);
Assert.assertTrue("Unexpected results collection", results.isEmpty());
}
use of org.jenkins.plugins.audit2db.internal.reports.JobsByParamReportImpl in project selenium_java by sergueik.
the class JobsByParamReportTests method invalidParamValueShouldReturnEmptyResults.
@Test
public void invalidParamValueShouldReturnEmptyResults() {
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() + " INVALID", TestUtils.NOW, TestUtils.NOW);
Assert.assertTrue("Unexpected results collection", results.isEmpty());
}
use of org.jenkins.plugins.audit2db.internal.reports.JobsByParamReportImpl in project selenium_java by sergueik.
the class JobsByParamReportTests method paramNameWithWildcardShouldReturnNonEmptyResults.
@Test
public void paramNameWithWildcardShouldReturnNonEmptyResults() {
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().substring(0) + "%", param.getValue(), TestUtils.NOW, TestUtils.NOW);
Assert.assertFalse("Unexpected empty results", results.isEmpty());
}
Aggregations