Search in sources :

Example 16 with MavenModuleSet

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

the class MavenPluginTest method build_multimodule.

@Test
public void build_multimodule() {
    installSomeMaven(jenkins);
    MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);
    job.configure();
    job.copyDir(resource("/maven_plugin/multimodule/"));
    job.goals.set("package");
    job.save();
    job.startBuild().shouldSucceed().shouldContainsConsoleOutput("Building root 1.0").shouldContainsConsoleOutput("Building module_a 2.0").shouldContainsConsoleOutput("Building module_b 3.0");
    assertHasModule(job, "gid$root");
    assertHasModule(job, "gid$module_a");
    assertHasModule(job, "gid$module_b");
}
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 17 with MavenModuleSet

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

the class JobConfigHistoryPluginTest method track_change_in_maven_project.

@Test
@Issue("JENKINS-24410")
@WithPlugins("maven-plugin")
public void track_change_in_maven_project() {
    MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);
    JobConfigHistory history = job.action(JobConfigHistory.class);
    List<Change> original = history.getChanges();
    job.configure();
    job.goals.set("clean");
    job.save();
    List<Change> newOnes = history.getChanges();
    assertThat("New changes saved", newOnes.size(), greaterThan(original.size()));
}
Also used : JobConfigHistory(org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory) Change(org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory.Change) 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 18 with MavenModuleSet

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

the class FindBugsPluginTest method should_set_result_to_unstable_if_warning_found.

/**
 * Builds a maven project and checks if it is unstable.
 */
@Test
public void should_set_result_to_unstable_if_warning_found() {
    MavenModuleSet job = createMavenJob(settings -> settings.setBuildUnstableTotalAll("0"));
    buildJobAndWait(job).shouldBeUnstable();
}
Also used : MavenModuleSet(org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet) Test(org.junit.Test)

Example 19 with MavenModuleSet

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

the class PmdPluginTest method should_set_result_to_failed_if_warning_found.

/**
 * Builds a maven project and checks if it failed.
 */
@Test
public void should_set_result_to_failed_if_warning_found() {
    MavenModuleSet job = createMavenJob(settings -> settings.setBuildFailedTotalAll("0"));
    buildJobAndWait(job).shouldFail();
}
Also used : MavenModuleSet(org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet) Test(org.junit.Test)

Example 20 with MavenModuleSet

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

the class ViolationsPluginTest method maven.

@Test
public void maven() {
    MavenInstallation.installSomeMaven(jenkins);
    MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);
    job.configure();
    job.copyDir(resource("/violations_plugin"));
    new Violations(job).config("fxcop").pattern("fxcop/*");
    job.save();
    job.startBuild().shouldSucceed();
    MavenModule module = job.module("gid$example");
    MavenModuleBuild moduleBuild = module.getLastBuild();
    assertThat(module.action(ViolationsAction.class), hasViolations("fxcop", "2", "2"));
    assertThat(moduleBuild.action(ViolationsAction.class), hasViolations("fxcop", "2", "2"));
}
Also used : Violations(org.jenkinsci.test.acceptance.plugins.violations.Violations) MavenModuleBuild(org.jenkinsci.test.acceptance.plugins.maven.MavenModuleBuild) MavenModule(org.jenkinsci.test.acceptance.plugins.maven.MavenModule) ViolationsAction(org.jenkinsci.test.acceptance.plugins.violations.ViolationsAction) MavenModuleSet(org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

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