Search in sources :

Example 11 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.

@Test
public void poll_for_changes() throws SubversionPluginTestException {
    final SvnContainer svnContainer = svn.get();
    JenkinsConfig jc = new JenkinsConfig(jenkins);
    jc.configure();
    jc.setQuietPeriod(0);
    jc.save();
    final FreeStyleJob f = jenkins.jobs.create();
    final SubversionScm subversionScm = f.useScm(SubversionScm.class);
    subversionScm.url.set(svnContainer.getUrlUnauthenticatedRepoAtRevision(1));
    f.save();
    f.startBuild().shouldSucceed();
    f.configure();
    subversionScm.url.set(svnContainer.getUrlUnauthenticatedRepoAtRevision(2));
    f.pollScm().schedule("* * * * *");
    f.addShellStep("test -d .svn");
    f.save();
    elasticSleep(10000);
    f.build(1).waitUntilFinished().shouldSucceed();
}
Also used : SvnContainer(org.jenkinsci.test.acceptance.docker.fixtures.SvnContainer) SubversionScm(org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm) JenkinsConfig(org.jenkinsci.test.acceptance.po.JenkinsConfig) 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 12 with SvnContainer

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

the class SubversionPluginTest method build_has_no_changes.

@Test
public void build_has_no_changes() 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());
    f.save();
    f.startBuild();
    final Changes changes = f.getLastBuild().getChanges();
    assertFalse("Build has changes.", changes.hasChanges());
}
Also used : Changes(org.jenkinsci.test.acceptance.po.Changes) 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 13 with SvnContainer

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

the class SubversionPluginTest method build_has_changes.

@Test
public void build_has_changes() throws SubversionPluginTestException {
    final SvnContainer svnContainer = svn.get();
    final FreeStyleJob f = jenkins.jobs.create();
    final SubversionScm subversionScm = f.useScm(SubversionScm.class);
    subversionScm.url.set(svnContainer.getUrlUnauthenticatedRepoAtRevision(1));
    f.save();
    f.startBuild().shouldSucceed();
    f.configure();
    subversionScm.url.set(svnContainer.getUrlUnauthenticatedRepoAtRevision(2));
    f.save();
    f.startBuild().shouldSucceed();
    final Changes changes = f.getLastBuild().getChanges();
    assertTrue("Build has no changes.", changes.hasChanges());
}
Also used : Changes(org.jenkinsci.test.acceptance.po.Changes) 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 14 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.

@Test
public void run_basic_subversion_build() throws SubversionPluginTestException {
    final SvnContainer svnContainer = svn.get();
    final FreeStyleJob f = jenkins.jobs.create();
    f.useScm(SubversionScm.class).url.set(svnContainer.getUrlUnauthenticatedRepo());
    f.addShellStep("test -d .svn");
    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) 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 15 with SvnContainer

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

the class Subversion_Version154_PluginTest method checkout_specific_revision.

@Test
public void checkout_specific_revision() throws SubversionPluginTestException {
    final int revision = 0;
    final SvnContainer svnContainer = svn.get();
    final FreeStyleJob f = jenkins.jobs.create();
    f.useScm(SubversionScm.class).url.set(svnContainer.getUrlUnsaveRepoAtRevision(revision));
    f.save();
    f.startBuild().shouldSucceed().shouldContainsConsoleOutput("At revision " + revision);
}
Also used : SvnContainer(org.jenkinsci.test.acceptance.docker.fixtures.SvnContainer) 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

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