Search in sources :

Example 1 with ArtifactoryContainer

use of org.jenkinsci.test.acceptance.docker.fixtures.ArtifactoryContainer in project acceptance-test-harness by jenkinsci.

the class ArtifactoryPluginTest method check_config_is_persisted.

@Test
public void check_config_is_persisted() {
    final ArtifactoryContainer artifactory = artifactoryContainer.get();
    waitForArtifactory(artifactory);
    ArtifactoryGlobalConfig.Server server = configureArtifactory(artifactory);
    jenkins.configure();
    server.testConnectionButton.click();
    waitFor(hasContent("Found Artifactory"));
    server.username.set("bob");
    server.testConnectionButton.click();
    waitFor(hasContent("Error occurred while requesting version information: Unauthorized"));
    server.url.set("http://localhost:4898/blabla");
    server.testConnectionButton.click();
    waitFor(hasContent(Pattern.compile("Error occurred while requesting version information: Connection( to http://localhost:4898)* refused")));
}
Also used : Server(org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGlobalConfig.Server) ArtifactoryContainer(org.jenkinsci.test.acceptance.docker.fixtures.ArtifactoryContainer) ArtifactoryGlobalConfig(org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGlobalConfig) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Example 2 with ArtifactoryContainer

use of org.jenkinsci.test.acceptance.docker.fixtures.ArtifactoryContainer 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 3 with ArtifactoryContainer

use of org.jenkinsci.test.acceptance.docker.fixtures.ArtifactoryContainer in project acceptance-test-harness by jenkinsci.

the class ArtifactoryPluginTest method gradle_integration.

@Test
@WithPlugins("gradle")
@Ignore
@Issue("JENKINS-39323")
public void gradle_integration() {
    final ArtifactoryContainer artifactory = artifactoryContainer.get();
    waitForArtifactory(artifactory);
    configureArtifactory(artifactory);
    GradleInstallation.installGradle(jenkins, "gradle 2.0", "2.0");
    FreeStyleJob job = jenkins.jobs.create();
    job.copyDir(resource("/artifactory_plugin/quickstart"));
    ArtifactoryGradleConfiguratior gradleConfig = new ArtifactoryGradleConfiguratior(job);
    gradleConfig.refresh();
    GradleStep gradle = job.addBuildStep(GradleStep.class);
    gradle.setVersion("gradle 2.0");
    // gradle.tasks.set("build --stacktrace --debug");
    gradle.setTasks("build");
    job.save();
    Build build = job.startBuild().shouldSucceed();
    String log = build.getConsole();
    assertThat(log, containsString("build artifactoryPublish"));
    assertThat(log, containsString("[buildinfo]"));
    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) GradleStep(org.jenkinsci.test.acceptance.plugins.gradle.GradleStep) ArtifactoryGradleConfiguratior(org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGradleConfiguratior) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) Matchers.containsString(org.hamcrest.Matchers.containsString) 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)

Aggregations

ArtifactoryContainer (org.jenkinsci.test.acceptance.docker.fixtures.ArtifactoryContainer)3 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)3 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)3 Test (org.junit.Test)3 Matchers.containsString (org.hamcrest.Matchers.containsString)2 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)2 Build (org.jenkinsci.test.acceptance.po.Build)2 Ignore (org.junit.Ignore)2 Issue (org.jvnet.hudson.test.Issue)2 ArtifactoryGlobalConfig (org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGlobalConfig)1 Server (org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGlobalConfig.Server)1 ArtifactoryGradleConfiguratior (org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGradleConfiguratior)1 ArtifactoryPublisher (org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryPublisher)1 GradleStep (org.jenkinsci.test.acceptance.plugins.gradle.GradleStep)1 MavenModuleSet (org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet)1 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)1