Search in sources :

Example 1 with SvnContainer

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

the class SubversionPluginTest method poll_for_changes_excluded.

@Test
public void poll_for_changes_excluded() throws SubversionPluginTestException {
    final SvnContainer svnContainer = svn.get();
    final FreeStyleJob f = jenkins.jobs.create();
    final SubversionScm subversionScm = f.useScm(SubversionScm.class);
    subversionScm.url.set(svnContainer.getUrlUnsaveRepoAtRevision(1));
    // EXCLUDE THE CHANGES TO REV 2
    final SubversionSvmAdvanced scmAdvanced = subversionScm.advanced();
    scmAdvanced.excludedRegions.set(".*\\.txt");
    f.save();
    f.startBuild().shouldSucceed();
    f.configure();
    subversionScm.url.set(svnContainer.getUrlUnsaveRepoAtRevision(2));
    f.pollScm().schedule("* * * * *");
    f.save();
    elasticSleep(70000);
    // We should not have a second build after 70 seconds
    assertThat(f.getNextBuildNumber(), CoreMatchers.is(2));
}
Also used : SvnContainer(org.jenkinsci.test.acceptance.docker.fixtures.SvnContainer) SubversionScm(org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm) SubversionSvmAdvanced(org.jenkinsci.test.acceptance.plugins.subversion.SubversionSvmAdvanced) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Example 2 with SvnContainer

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

the class Subversion_Version154_PluginTest method run_basic_subversion_build_svn_userPwd.

@Test
public void run_basic_subversion_build_svn_userPwd() throws SubversionPluginTestException {
    final SvnContainer svnContainer = svn.get();
    final FreeStyleJob f = jenkins.jobs.create();
    f.addShellStep("test -d .svn");
    final SubversionScm subversionScm = f.useScm(SubversionScm.class);
    subversionScm.url.set(svnContainer.getSvnUrl());
    final SubversionCredentialUserPwd credentialPage = subversionScm.getCredentialPage(SubversionCredentialUserPwd.class);
    credentialPage.setUsername(SvnContainer.USER);
    credentialPage.setPassword(SvnContainer.PWD);
    credentialPage.confirmDialog();
    f.save();
    f.startBuild().shouldSucceed().shouldContainsConsoleOutput("test -d .svn");
}
Also used : SvnContainer(org.jenkinsci.test.acceptance.docker.fixtures.SvnContainer) SubversionScm(org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm) SubversionCredentialUserPwd(org.jenkinsci.test.acceptance.plugins.subversion.SubversionCredentialUserPwd) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Example 3 with SvnContainer

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

the class Subversion_Version154_PluginTest method always_checkout_fresh_copy.

@Test
public void always_checkout_fresh_copy() throws SubversionPluginTestException {
    final SvnContainer svnContainer = svn.get();
    final FreeStyleJob f = jenkins.jobs.create();
    final SubversionScm subversionScm = f.useScm(SubversionScm.class);
    subversionScm.url.set(svnContainer.getUrlUnsaveRepo());
    subversionScm.checkoutStrategy.select(SubversionScm.ALWAYS_FRESH_COPY);
    f.save();
    f.startBuild().shouldSucceed();
    f.startBuild().shouldSucceed().shouldContainsConsoleOutput("Checking out " + svnContainer.getUrlUnsaveRepo());
}
Also used : SvnContainer(org.jenkinsci.test.acceptance.docker.fixtures.SvnContainer) SubversionScm(org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Example 4 with SvnContainer

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

the class SubversionPluginTest method always_checkout_fresh_copy.

@Test
public void always_checkout_fresh_copy() throws SubversionPluginTestException {
    final SvnContainer svnContainer = svn.get();
    final FreeStyleJob f = jenkins.jobs.create();
    final SubversionScm subversionScm = f.useScm(SubversionScm.class);
    subversionScm.url.set(svnContainer.getUrlUnauthenticatedRepo());
    subversionScm.checkoutStrategy.select(SubversionScm.ALWAYS_FRESH_COPY);
    f.save();
    f.startBuild().shouldSucceed();
    Build b = f.startBuild().shouldSucceed();
    assertThat(b.getConsole(), Matchers.containsString("Checking out " + svnContainer.getUrlUnauthenticatedRepo()));
}
Also used : SvnContainer(org.jenkinsci.test.acceptance.docker.fixtures.SvnContainer) SubversionScm(org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm) Build(org.jenkinsci.test.acceptance.po.Build) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Example 5 with SvnContainer

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

the class SubversionPluginTest method run_basic_subversion_build_userPwd.

@Test
@WithCredentials(credentialType = WithCredentials.USERNAME_PASSWORD, values = { SvnContainer.USER, SvnContainer.PWD }, id = SvnContainer.USER)
public void run_basic_subversion_build_userPwd() throws SubversionPluginTestException {
    final SvnContainer svnContainer = svn.get();
    final FreeStyleJob f = jenkins.jobs.create();
    f.addShellStep("test -d .svn");
    final SubversionScm subversionScm = f.useScm(SubversionScm.class);
    subversionScm.url.set(svnContainer.getUrlAuthenticatedRepo());
    subversionScm.credentials.select(SvnContainer.USER);
    f.save();
    Build b = f.startBuild().shouldSucceed();
    assertThat(b.getConsole(), Matchers.containsString("test -d .svn"));
}
Also used : SvnContainer(org.jenkinsci.test.acceptance.docker.fixtures.SvnContainer) SubversionScm(org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm) Build(org.jenkinsci.test.acceptance.po.Build) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) WithCredentials(org.jenkinsci.test.acceptance.junit.WithCredentials) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Aggregations

SvnContainer (org.jenkinsci.test.acceptance.docker.fixtures.SvnContainer)17 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)17 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)17 Test (org.junit.Test)17 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)16 SubversionScm (org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm)12 Build (org.jenkinsci.test.acceptance.po.Build)6 Changes (org.jenkinsci.test.acceptance.po.Changes)3 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)2 SubversionCredentialUserPwd (org.jenkinsci.test.acceptance.plugins.subversion.SubversionCredentialUserPwd)2 WithDocker (org.jenkinsci.test.acceptance.junit.WithDocker)1 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)1 SubversionSvmAdvanced (org.jenkinsci.test.acceptance.plugins.subversion.SubversionSvmAdvanced)1 SvnRepositoryBrowserWebSvn (org.jenkinsci.test.acceptance.plugins.subversion.SvnRepositoryBrowserWebSvn)1 JenkinsConfig (org.jenkinsci.test.acceptance.po.JenkinsConfig)1 WorkflowJob (org.jenkinsci.test.acceptance.po.WorkflowJob)1 Category (org.junit.experimental.categories.Category)1