提交 b04ba7bf 编写于 作者: R redsolo

[HUDSON-4423] Added test case for issue

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21560 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f8751b20
...@@ -26,6 +26,7 @@ package hudson.model; ...@@ -26,6 +26,7 @@ package hudson.model;
import com.gargoylesoftware.htmlunit.ElementNotFoundException; import com.gargoylesoftware.htmlunit.ElementNotFoundException;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.security.GlobalMatrixAuthorizationStrategy; import hudson.security.GlobalMatrixAuthorizationStrategy;
import hudson.tasks.Shell; import hudson.tasks.Shell;
...@@ -130,6 +131,27 @@ public class AbstractProjectTest extends HudsonTestCase { ...@@ -130,6 +131,27 @@ public class AbstractProjectTest extends HudsonTestCase {
} }
} }
/**
* Tests round trip configuration of the blockBuildWhenUpstreamBuilding field
*/
@Bug(4423)
public void testConfiguringBlockBuildWhenUpstreamBuildingRoundtrip() throws Exception {
FreeStyleProject p = createFreeStyleProject();
p.blockBuildWhenUpstreamBuilding = false;
HtmlForm form = new WebClient().getPage(p, "configure").getFormByName("config");
HtmlInput input = form.getInputByName("blockBuildWhenUpstreamBuilding");
assertFalse("blockBuildWhenUpstreamBuilding check box is checked.", input.isChecked());
input.setChecked(true);
submit(form);
assertTrue("blockBuildWhenUpstreamBuilding was not updated from configuration form", p.blockBuildWhenUpstreamBuilding);
form = new WebClient().getPage(p, "configure").getFormByName("config");
input = form.getInputByName("blockBuildWhenUpstreamBuilding");
assertTrue("blockBuildWhenUpstreamBuilding check box is not checked.", input.isChecked());
}
/** /**
* Unless the concurrent build option is enabled, polling and build should be mutually exclusive * Unless the concurrent build option is enabled, polling and build should be mutually exclusive
* to avoid allocating unnecessary workspaces. * to avoid allocating unnecessary workspaces.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册