Search in sources :

Example 1 with MavenBuild

use of org.jenkinsci.test.acceptance.plugins.maven.MavenBuild 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 2 with MavenBuild

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

the class MavenPluginTest method assertHasModule.

private void assertHasModule(MavenModuleSet job, String name) {
    assertThat(job.module(name), pageObjectExists());
    MavenBuild build = job.getLastBuild();
    assertThat(build.module(name), pageObjectExists());
    job.visit("modules");
    WebElement webElement = find(by.xpath("//a[@href='%s/']", name));
    webElement.click();
    // clicking a second time fixes it
    if (!driver.getCurrentUrl().equals(job.module(name).url.toExternalForm())) {
        webElement.click();
    }
    assertThat(driver.getCurrentUrl(), equalTo(job.module(name).url.toExternalForm()));
    build.open();
    find(by.xpath("//a[@href='%s/']", name)).click();
    assertThat(driver.getCurrentUrl(), equalTo(build.module(name).url.toExternalForm()));
}
Also used : MavenBuild(org.jenkinsci.test.acceptance.plugins.maven.MavenBuild) WebElement(org.openqa.selenium.WebElement)

Aggregations

MavenBuild (org.jenkinsci.test.acceptance.plugins.maven.MavenBuild)2 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)1 MavenModuleSet (org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet)1 ArtifactArchiver (org.jenkinsci.test.acceptance.po.ArtifactArchiver)1 Test (org.junit.Test)1 Issue (org.jvnet.hudson.test.Issue)1 WebElement (org.openqa.selenium.WebElement)1