File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\test\src\test\java\jenkins\model\JenkinsLocationConfigurationTest.java.html

1 package jenkins.model;
2
3 import com.gargoylesoftware.htmlunit.html.HtmlInput;
4 import com.gargoylesoftware.htmlunit.html.HtmlPage;
5 import org.jvnet.hudson.test.HudsonTestCase;
6
7 /**
8 * @author Kohsuke Kawaguchi
9 */
10 public class JenkinsLocationConfigurationTest extends HudsonTestCase {
11 /**
12 * Makes sure the use of "localhost" in the Hudson URL reports a warning.
13 */
14 public void testLocalHostWarning() throws Exception {
15 HtmlPage p = new WebClient().goTo("configure");
16 HtmlInput url = p.getFormByName("config").getInputByName("_.url");
17 url.setValueAttribute("http://localhost:1234/");
18 assertTrue(p.getDocumentElement().getTextContent().contains("instead of localhost"));
19 }
20 }
21