提交 e1e7f1b9 编写于 作者: J Jesse Glick

[JENKINS-23191] Cannot reproduce problem in HtmlUnit test, but can at least...

[JENKINS-23191] Cannot reproduce problem in HtmlUnit test, but can at least guard against other regressions.
上级 7667abba
......@@ -36,6 +36,7 @@ import hudson.model.User;
import hudson.security.AuthorizationMatrixProperty;
import hudson.security.Permission;
import hudson.security.ProjectMatrixAuthorizationStrategy;
import hudson.tasks.BuildTrigger;
import hudson.tasks.BuildTriggerTest;
import hudson.triggers.Trigger;
import java.util.Arrays;
......@@ -57,6 +58,24 @@ public class ReverseBuildTriggerTest {
@Rule public JenkinsRule r = new JenkinsRule();
@Test public void configRoundtrip() throws Exception {
r.createFreeStyleProject("upstream");
FreeStyleProject downstream = r.createFreeStyleProject("downstream");
FreeStyleProject wayDownstream = r.createFreeStyleProject("wayDownstream");
downstream.addTrigger(new ReverseBuildTrigger("upstream", Result.SUCCESS));
downstream.getPublishersList().add(new BuildTrigger(Collections.singleton(wayDownstream), Result.SUCCESS));
downstream.save();
r.configRoundtrip(downstream);
ReverseBuildTrigger rbt = downstream.getTrigger(ReverseBuildTrigger.class);
assertNotNull(rbt);
assertEquals("upstream", rbt.getUpstreamProjects());
assertEquals(Result.SUCCESS, rbt.getThreshold());
BuildTrigger bt = downstream.getPublishersList().get(BuildTrigger.class);
assertNotNull(bt);
assertEquals(Collections.singletonList(wayDownstream), bt.getChildProjects(downstream));
assertEquals(Result.SUCCESS, bt.getThreshold());
}
/** @see BuildTriggerTest#testDownstreamProjectSecurity */
@Test public void upstreamProjectSecurity() throws Exception {
r.jenkins.setSecurityRealm(r.createDummySecurityRealm());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册