Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-29340] Implemented a new proposal
- Loading branch information
Showing
5 changed files
with
72 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package hudson.scm; | ||
|
||
import hudson.model.FreeStyleProject; | ||
import hudson.model.TaskListener; | ||
import org.jenkinsci.plugins.envinject.EnvInjectJobProperty; | ||
import org.jenkinsci.plugins.envinject.EnvInjectJobPropertyInfo; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.jvnet.hudson.test.JenkinsRule; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
public class SubversionEnvInjectTest { | ||
|
||
public static String REPO_URL = "https://svn.jenkins-ci.org/trunk/hudson/test-projects/${REPO}"; | ||
|
||
@Rule | ||
public JenkinsRule jenkins = new JenkinsRule(); | ||
|
||
@Test | ||
public void pollingWithEnvInject() throws Exception { | ||
FreeStyleProject project = jenkins.createFreeStyleProject(); | ||
|
||
EnvInjectJobPropertyInfo jobPropertyInfo = new EnvInjectJobPropertyInfo(null, "REPO=trivial-maven", null, null, null, false); | ||
EnvInjectJobProperty envInjectJobProperty = new EnvInjectJobProperty(); | ||
envInjectJobProperty.setOn(true); | ||
envInjectJobProperty.setInfo(jobPropertyInfo); | ||
project.addProperty(envInjectJobProperty); | ||
|
||
project.setScm(new SubversionSCM(REPO_URL)); | ||
|
||
TaskListener listener = jenkins.createTaskListener(); | ||
PollingResult poll = project.poll(listener); | ||
assertTrue(poll.hasChanges()); | ||
|
||
jenkins.assertBuildStatusSuccess(project.scheduleBuild2(0).get()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters