Skip to content
Permalink
Browse files

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

… least guard against other regressions.

(cherry picked from commit e1e7f1b)
  • Loading branch information...
jglick authored and olivergondza committed Jun 16, 2014
1 parent 694538e commit 84195ea8468766df8df470f3a1a686caefb644a3
Showing with 19 additions and 0 deletions.
  1. +19 −0 test/src/test/java/jenkins/triggers/ReverseBuildTriggerTest.java
@@ -36,6 +36,7 @@
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 @@

@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());

0 comments on commit 84195ea

Please sign in to comment.
You can’t perform that action at this time.