提交 e0990b4b 编写于 作者: J Jeff Thompson

Add tests for downloading JNLP file at new and obsoleted names.

上级 70797bf4
......@@ -814,7 +814,6 @@ public class SlaveComputer extends Computer {
@WebMethod(name="slave-agent.jnlp")
public HttpResponse doSlaveAgentJnlp(StaplerRequest req, StaplerResponse res) {
return doJenkinsAgentJnlp(req, res);
}
......
......@@ -23,6 +23,7 @@
*/
package hudson.slaves;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.Proc;
import hudson.Util;
......@@ -49,6 +50,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
......@@ -297,4 +299,21 @@ public class JNLPLauncherTest {
j.assertEqualBeans(original,s.getLauncher(),"tunnel,vmargs");
j.assertEqualDataBoundBeans(((JNLPLauncher) s.getLauncher()).getWorkDirSettings(), custom);
}
@Test
public void testJnlpFileDownload() throws Exception {
assertJnlpFileDownload("/jenkins-agent.jnlp");
}
@Test
public void testObsoletedJnlpFileDownload() throws Exception {
assertJnlpFileDownload("/slave-agent.jnlp");
}
private void assertJnlpFileDownload(String filename) throws Exception {
Computer c = addTestAgent(false);
Page p = j.createWebClient().getPage(j.getURL() + "computer/" + c.getName() + filename);
assertThat(p.getWebResponse().getStatusCode(), is(200));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册