use of org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep in project acceptance-test-harness by jenkinsci.
the class MavenPluginTest method autoinstall_maven3_for_freestyle_job.
@Test
public void autoinstall_maven3_for_freestyle_job() {
installMaven(jenkins, "maven_3.6.3", "3.6.3");
FreeStyleJob job = jenkins.jobs.create();
job.configure();
MavenBuildStep step = job.addBuildStep(MavenBuildStep.class);
step.version.select("maven_3.6.3");
step.targets.set("-version");
job.save();
job.startBuild().shouldSucceed().shouldContainsConsoleOutput("Apache Maven 3.6.3");
}
use of org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep in project acceptance-test-harness by jenkinsci.
the class MavenPluginTest method use_local_maven_repo.
@Test
public void use_local_maven_repo() {
installSomeMaven(jenkins);
FreeStyleJob job = jenkins.jobs.create();
job.configure();
MavenBuildStep step = job.addBuildStep(MavenBuildStep.class);
step.targets.set(GENERATE);
step.useLocalRepository();
job.save();
job.startBuild().shouldSucceed().shouldContainsConsoleOutput("-Dmaven.repo.local=([^\\n]*)[/\\\\].repository");
}
use of org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep 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);
}
use of org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep in project acceptance-test-harness by jenkinsci.
the class MavenPluginTest method autoinstall_maven2_for_freestyle_job.
@Test
public void autoinstall_maven2_for_freestyle_job() {
installMaven(jenkins, "maven_2.2.1", "2.2.1");
FreeStyleJob job = jenkins.jobs.create();
job.configure();
MavenBuildStep step = job.addBuildStep(MavenBuildStep.class);
step.version.select("maven_2.2.1");
step.targets.set("-version");
job.save();
job.startBuild().shouldSucceed().shouldContainsConsoleOutput("Apache Maven 2.2.1");
}
Aggregations