Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'JENKINS-20662' of github.com:daniel-beck/jenkins
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 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
26 changes: 26 additions & 0 deletions
26
test/src/test/groovy/jenkins/model/lazy/LazyBuildMixIn_Test.groovy
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,26 @@ | ||
package jenkins.model.lazy | ||
|
||
import hudson.model.Run | ||
import hudson.model.TaskListener | ||
import hudson.model.listeners.RunListener | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.jvnet.hudson.test.Bug | ||
import org.jvnet.hudson.test.SleepBuilder | ||
import org.jvnet.hudson.test.JenkinsRule | ||
|
||
class LazyBuildMixIn_Test { | ||
@Rule | ||
public JenkinsRule r = new JenkinsRule(); | ||
|
||
@Test | ||
@Bug(20662) | ||
public void testNewRunningBuildRelationFromPrevious() { | ||
def p = r.createFreeStyleProject(); | ||
p.buildersList.replaceBy([new SleepBuilder(1000)]) | ||
def b1 = p.scheduleBuild2(0).get(); | ||
assert null == b1.getNextBuild(); | ||
def b2 = p.scheduleBuild2(0).waitForStart(); | ||
assert b2 == b1.getNextBuild(); | ||
} | ||
} |