Search in sources :

Example 6 with SvnContainer

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

the class SubversionPluginTest 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.getUrlUnauthenticatedRepoAtRevision(revision));
    f.save();
    Build b = f.startBuild().shouldSucceed();
    assertThat(b.getConsole(), Matchers.containsString("At revision " + revision));
}
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 7 with SvnContainer

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

the class WorkflowPluginTest method subversion.

/**
 * Pipeline analogue of {@link SubversionPluginTest#build_has_changes}.
 */
@Category(DockerTest.class)
@WithDocker
@WithPlugins({ "workflow-cps@2.12", "workflow-job@2.5", "workflow-durable-task-step@2.4", "subversion@2.6" })
@Test
public void subversion() throws Exception {
    final SvnContainer svnContainer = svn.get();
    WorkflowJob job = jenkins.jobs.create(WorkflowJob.class);
    job.script.set("node {svn '" + svnContainer.getUrlUnauthenticatedRepoAtRevision(1) + "'}");
    job.save();
    job.startBuild().shouldSucceed();
    job.configure();
    job.script.set("node {svn '" + svnContainer.getUrlUnauthenticatedRepoAtRevision(2) + "'}");
    job.save();
    Build b2 = job.startBuild().shouldSucceed();
    assertTrue(b2.getChanges().hasChanges());
}
Also used : SvnContainer(org.jenkinsci.test.acceptance.docker.fixtures.SvnContainer) Build(org.jenkinsci.test.acceptance.po.Build) WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob) Category(org.junit.experimental.categories.Category) 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) WithDocker(org.jenkinsci.test.acceptance.junit.WithDocker)

Example 8 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_svn_userPwd.

@Test
@WithCredentials(credentialType = WithCredentials.USERNAME_PASSWORD, values = { SvnContainer.USER, SvnContainer.PWD }, id = SvnContainer.USER)
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());
    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)

Example 9 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_and_repoBrowser.

@Test
public void build_has_changes_and_repoBrowser() 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));
    final SvnRepositoryBrowserWebSvn repositoryBrowserWebSvn = subversionScm.useRepositoryBrowser(SvnRepositoryBrowserWebSvn.class);
    repositoryBrowserWebSvn.url.set(svnContainer.getUrlViewVC());
    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 diff link.", changes.hasDiffFileLink("testOne.txt"));
}
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) SvnRepositoryBrowserWebSvn(org.jenkinsci.test.acceptance.plugins.subversion.SvnRepositoryBrowserWebSvn) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Example 10 with SvnContainer

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

the class SubversionPluginTest method clean_checkout.

@Test
public void clean_checkout() 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.CLEAN_CHECKOUT);
    f.addShellStep("echo test > unversioned.txt");
    f.save();
    f.startBuild().shouldSucceed();
    f.configure();
    f.removeFirstBuildStep();
    f.addShellStep("test ! -f unversioned.txt");
    f.save();
    f.startBuild().shouldSucceed();
}
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)

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