Search in sources :

Example 11 with MavenModuleSet

use of org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet in project acceptance-test-harness by jenkinsci.

the class ArtifactoryPluginTest method maven_integration.

@Test
@WithPlugins("maven-plugin")
@Ignore
@Issue("JENKINS-66791")
public void maven_integration() {
    installSomeMaven(jenkins);
    final ArtifactoryContainer artifactory = artifactoryContainer.get();
    waitForArtifactory(artifactory);
    configureArtifactory(artifactory);
    MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);
    job.configure();
    job.copyDir(resource("/artifactory_plugin/multimodule/"));
    job.goals.set("install");
    job.options("-verbose");
    ArtifactoryPublisher publisher = job.addPublisher(ArtifactoryPublisher.class);
    publisher.refresh();
    job.save();
    Build build = job.startBuild().shouldSucceed();
    String log = build.getConsole();
    assertThat(log, containsString("Initializing Artifactory Build-Info Recording"));
    assertThat(log, containsString("Deploying artifact"));
    assertThat(log, containsRegexp("Deploying build (info|descriptor) to: " + artifactory.getURL() + "/api/build"));
}
Also used : ArtifactoryContainer(org.jenkinsci.test.acceptance.docker.fixtures.ArtifactoryContainer) Build(org.jenkinsci.test.acceptance.po.Build) ArtifactoryPublisher(org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryPublisher) Matchers.containsString(org.hamcrest.Matchers.containsString) MavenModuleSet(org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet) Ignore(org.junit.Ignore) Issue(org.jvnet.hudson.test.Issue) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Example 12 with MavenModuleSet

use of org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet in project acceptance-test-harness by jenkinsci.

the class CompressArtifactsPluginTest method archiveMavenProject.

@Test
@Issue("JENKINS-27558")
@WithPlugins("maven-plugin")
public void archiveMavenProject() {
    MavenInstallation.installSomeMaven(jenkins);
    MavenModuleSet mp = jenkins.jobs.create(MavenModuleSet.class);
    mp.configure();
    mp.copyDir(resource("/maven_plugin/multimodule/"));
    mp.goals.set("clean package -B -DskipTests=true");
    mp.addPublisher(ArtifactArchiver.class).includes("module_a/**/*");
    mp.save();
    MavenBuild raw = mp.startBuild().shouldSucceed().as(MavenBuild.class);
    CompressingArtifactManager.setup(jenkins);
    MavenBuild compressed = mp.startBuild().shouldSucceed().as(MavenBuild.class);
    compareArtifacts(raw, compressed);
    compareArtifacts(raw.module("gid$root"), compressed.module("gid$root"));
    compareArtifacts(raw.module("gid$module_a"), compressed.module("gid$module_a"));
    compareArtifacts(raw.module("gid$module_b"), compressed.module("gid$module_b"));
}
Also used : MavenBuild(org.jenkinsci.test.acceptance.plugins.maven.MavenBuild) ArtifactArchiver(org.jenkinsci.test.acceptance.po.ArtifactArchiver) MavenModuleSet(org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet) Issue(org.jvnet.hudson.test.Issue) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Example 13 with MavenModuleSet

use of org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet in project acceptance-test-harness by jenkinsci.

the class MavenPluginTest method set_global_maven_options.

@Test
public void set_global_maven_options() {
    installSomeMaven(jenkins);
    jenkins.configure();
    new MavenProjectConfig(jenkins.getConfigPage()).opts.set("-showversion");
    jenkins.save();
    MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);
    job.configure();
    job.copyDir(resource("/maven_plugin/multimodule/"));
    job.goals.set("clean");
    job.save();
    job.startBuild().shouldSucceed().shouldContainsConsoleOutput(" Runtime Environment ");
}
Also used : MavenProjectConfig(org.jenkinsci.test.acceptance.plugins.maven.MavenProjectConfig) MavenModuleSet(org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Example 14 with MavenModuleSet

use of org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet in project acceptance-test-harness by jenkinsci.

the class MavenPluginTest method set_maven_options.

@Test
public void set_maven_options() {
    installSomeMaven(jenkins);
    MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);
    job.configure();
    job.copyDir(resource("/maven_plugin/multimodule/"));
    job.goals.set("clean");
    job.options("-showversion");
    job.save();
    job.startBuild().waitUntilFinished().shouldContainsConsoleOutput(" Runtime Environment ");
}
Also used : MavenModuleSet(org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Example 15 with MavenModuleSet

use of org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet in project acceptance-test-harness by jenkinsci.

the class MavenPluginTest method send_mail.

@Test
@Issue({ "JENKINS-20209", "JENKINS-21045" })
public void send_mail() throws Exception {
    installSomeMaven(jenkins);
    MailhogContainer mailhog = mailhogProvider.get();
    MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);
    job.configure();
    Mailer mailer = job.addBuildSettings(Mailer.class);
    mailer.recipients.set("root@example.com");
    job.save();
    job.startBuild().shouldFail();
    mailhog.assertMail(Pattern.compile("Build failed in Jenkins: .* #1"), "root@example.com", Pattern.compile(job.name));
}
Also used : Mailer(org.jenkinsci.test.acceptance.plugins.mailer.Mailer) MailhogContainer(org.jenkinsci.test.acceptance.docker.fixtures.MailhogContainer) MavenModuleSet(org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet) Issue(org.jvnet.hudson.test.Issue) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Aggregations

MavenModuleSet (org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet)22 Test (org.junit.Test)21 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)9 Build (org.jenkinsci.test.acceptance.po.Build)7 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)5 Issue (org.jvnet.hudson.test.Issue)5 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)4 CheckStyleAction (org.jenkinsci.test.acceptance.plugins.checkstyle.CheckStyleAction)2 MavenBuild (org.jenkinsci.test.acceptance.plugins.maven.MavenBuild)2 Matchers.containsString (org.hamcrest.Matchers.containsString)1 ArtifactoryContainer (org.jenkinsci.test.acceptance.docker.fixtures.ArtifactoryContainer)1 MailhogContainer (org.jenkinsci.test.acceptance.docker.fixtures.MailhogContainer)1 ArtifactoryPublisher (org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryPublisher)1 FindBugsAction (org.jenkinsci.test.acceptance.plugins.findbugs.FindBugsAction)1 JobConfigHistory (org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory)1 Change (org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory.Change)1 Mailer (org.jenkinsci.test.acceptance.plugins.mailer.Mailer)1 MavenModule (org.jenkinsci.test.acceptance.plugins.maven.MavenModule)1 MavenModuleBuild (org.jenkinsci.test.acceptance.plugins.maven.MavenModuleBuild)1 MavenProjectConfig (org.jenkinsci.test.acceptance.plugins.maven.MavenProjectConfig)1