use of org.jenkinsci.test.acceptance.plugins.emma.EmmaResultsPage in project acceptance-test-harness by jenkinsci.
the class EmmaPluginTest method coverage_test.
/*
* Performs a coverage test by enabling coverage reporting and when
* tests are run a coverage report is created.
* The coverage report data is then verified.
*/
@Test
public void coverage_test() {
job = jenkins.jobs.create();
job.configure();
job.copyDir(resource("/emma/test"));
// In the maven build step an Emma goal is added to enable coverage reporting.
MavenBuildStep mbs = job.addBuildStep(MavenBuildStep.class);
mbs.targets.set("clean emma:emma package");
EmmaPublisher ep = job.addPublisher(EmmaPublisher.class);
ep.setReportingThresholds(100, 70, 80, 80, 80, 0, 0, 0, 0, 0);
job.save();
Build build = job.startBuild().waitUntilFinished().shouldSucceed();
EmmaResultsPage resultsPage = new EmmaResultsPage(jenkins.injector, build.getConsoleUrl());
// class method block line
List<String> expected = Arrays.asList("100.0", "50.0", "45.5", "50.0", "100.0", "50.0", "45.5", "50.0");
resultsPage.assertHasResult(expected);
}
Aggregations