Search in sources :

Example 1 with SubversionScm

use of org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm 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 SubversionScm

use of org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm 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 SubversionScm

use of org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm 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 SubversionScm

use of org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm in project acceptance-test-harness by jenkinsci.

the class MultipleScmsPluginTest method checkout_several_scms.

@Test
public void checkout_several_scms() {
    FreeStyleJob job = jenkins.jobs.create();
    job.configure();
    MultipleScms scms = job.useScm(MultipleScms.class);
    GitScm git = scms.addScm(GitScm.class);
    git.url("git://github.com/jenkinsci/acceptance-test-harness.git");
    git.localDir("git-project");
    SubversionScm svn = scms.addScm(SubversionScm.class);
    svn.url.set("http://svn.apache.org/repos/asf/subversion/trunk/build/");
    svn.local.set("svn-project");
    job.addShellStep("test -d svn-project/.svn && test -f git-project/pom.xml");
    job.save();
    job.startBuild().shouldSucceed();
}
Also used : SubversionScm(org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) GitScm(org.jenkinsci.test.acceptance.plugins.git.GitScm) MultipleScms(org.jenkinsci.test.acceptance.plugins.multiple_scms.MultipleScms) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 5 with SubversionScm

use of org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm 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)

Aggregations

AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)13 SubversionScm (org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm)13 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)13 Test (org.junit.Test)13 SvnContainer (org.jenkinsci.test.acceptance.docker.fixtures.SvnContainer)12 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)12 Build (org.jenkinsci.test.acceptance.po.Build)3 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 GitScm (org.jenkinsci.test.acceptance.plugins.git.GitScm)1 MultipleScms (org.jenkinsci.test.acceptance.plugins.multiple_scms.MultipleScms)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