Search in sources :

Example 1 with MultipleScms

use of org.jenkinsci.test.acceptance.plugins.multiple_scms.MultipleScms 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 2 with MultipleScms

use of org.jenkinsci.test.acceptance.plugins.multiple_scms.MultipleScms in project acceptance-test-harness by jenkinsci.

the class MultipleScmsPluginTest method poll_for_changes.

@Test
public void poll_for_changes() {
    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");
    job.pollScm().schedule("* * * * *");
    job.addShellStep("test -f git-project/pom.xml");
    job.save();
    elasticSleep(70000);
    // We should have some build after 70 seconds
    job.getLastBuild().shouldSucceed().shouldExist();
}
Also used : 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)

Aggregations

AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)2 GitScm (org.jenkinsci.test.acceptance.plugins.git.GitScm)2 MultipleScms (org.jenkinsci.test.acceptance.plugins.multiple_scms.MultipleScms)2 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)2 Test (org.junit.Test)2 SubversionScm (org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm)1