Search in sources :

Example 6 with MavenBuildStep

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");
}
Also used : MavenBuildStep(org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Example 7 with MavenBuildStep

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");
}
Also used : MavenBuildStep(org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Example 8 with MavenBuildStep

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);
}
Also used : EmmaResultsPage(org.jenkinsci.test.acceptance.plugins.emma.EmmaResultsPage) Build(org.jenkinsci.test.acceptance.po.Build) MavenBuildStep(org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep) EmmaPublisher(org.jenkinsci.test.acceptance.plugins.emma.EmmaPublisher) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 9 with MavenBuildStep

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");
}
Also used : MavenBuildStep(org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Aggregations

MavenBuildStep (org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep)9 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)7 Test (org.junit.Test)7 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)6 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)4 Build (org.jenkinsci.test.acceptance.po.Build)2 HashMap (java.util.HashMap)1 Since (org.jenkinsci.test.acceptance.junit.Since)1 EmmaPublisher (org.jenkinsci.test.acceptance.plugins.emma.EmmaPublisher)1 EmmaResultsPage (org.jenkinsci.test.acceptance.plugins.emma.EmmaResultsPage)1 JacocoPublisher (org.jenkinsci.test.acceptance.plugins.jacoco.JacocoPublisher)1 JacocoResultPage (org.jenkinsci.test.acceptance.plugins.jacoco.JacocoResultPage)1 JavadocPublisher (org.jenkinsci.test.acceptance.plugins.javadoc.JavadocPublisher)1 StringParameter (org.jenkinsci.test.acceptance.po.StringParameter)1 Issue (org.jvnet.hudson.test.Issue)1