Search in sources :

Example 1 with Server

use of org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGlobalConfig.Server 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 Server

use of org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGlobalConfig.Server in project acceptance-test-harness by jenkinsci.

the class ArtifactoryPluginTest method configureArtifactory.

ArtifactoryGlobalConfig.Server configureArtifactory(ArtifactoryContainer artifactory) {
    JenkinsConfig config = jenkins.getConfigPage();
    config.configure();
    ArtifactoryGlobalConfig global = new ArtifactoryGlobalConfig(config);
    Server server = global.addServer();
    server.id.set("artifactoryId");
    server.url.set(artifactory.getURL());
    server.username.set("admin");
    server.password.set("password");
    config.save();
    return server;
}
Also used : Server(org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGlobalConfig.Server) ArtifactoryGlobalConfig(org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGlobalConfig) JenkinsConfig(org.jenkinsci.test.acceptance.po.JenkinsConfig)

Aggregations

ArtifactoryGlobalConfig (org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGlobalConfig)2 Server (org.jenkinsci.test.acceptance.plugins.artifactory.ArtifactoryGlobalConfig.Server)2 ArtifactoryContainer (org.jenkinsci.test.acceptance.docker.fixtures.ArtifactoryContainer)1 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)1 JenkinsConfig (org.jenkinsci.test.acceptance.po.JenkinsConfig)1 Test (org.junit.Test)1