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

Use the stapler incremental now that's republished.

上级 acebd93d
...@@ -39,7 +39,7 @@ THE SOFTWARE. ...@@ -39,7 +39,7 @@ THE SOFTWARE.
<properties> <properties>
<staplerFork>true</staplerFork> <staplerFork>true</staplerFork>
<stapler.version>1.258</stapler.version> <stapler.version>1.259-rc1393.7b6d39453a92</stapler.version>
<spring.version>2.5.6.SEC03</spring.version> <spring.version>2.5.6.SEC03</spring.version>
<groovy.version>2.4.12</groovy.version> <groovy.version>2.4.12</groovy.version>
</properties> </properties>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*/ */
package jenkins.security; package jenkins.security;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.model.FreeStyleProject; import hudson.model.FreeStyleProject;
import hudson.model.ItemGroup; import hudson.model.ItemGroup;
...@@ -34,6 +35,7 @@ import org.junit.Rule; ...@@ -34,6 +35,7 @@ import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.MockAuthorizationStrategy; import org.jvnet.hudson.test.MockAuthorizationStrategy;
import org.kohsuke.stapler.HttpResponses;
import java.io.IOException; import java.io.IOException;
...@@ -49,6 +51,7 @@ public class StackTraceSuppressionTest { ...@@ -49,6 +51,7 @@ public class StackTraceSuppressionTest {
@Before @Before
public void setup() { public void setup() {
Jenkins.SHOW_STACK_TRACE = false; Jenkins.SHOW_STACK_TRACE = false;
HttpResponses.SHOW_STACK_TRACE = false;
} }
@Test @Test
...@@ -83,36 +86,36 @@ public class StackTraceSuppressionTest { ...@@ -83,36 +86,36 @@ public class StackTraceSuppressionTest {
assertThat(content, not(containsString("Caused by"))); assertThat(content, not(containsString("Caused by")));
} }
// @Test @Test
// public void nonexistentAdjunct() throws Exception { public void nonexistentAdjunct() throws Exception {
// /* This test belongs in Stapler but it's easy to put it together here. /* This test belongs in Stapler but it's easy to put it together here.
// This test is based upon Stapler throwing an exception for this broken request. This test is based upon Stapler throwing an exception for this broken request.
// If Stapler is improved to better handle this error, this test may erroneously fail. */ If Stapler is improved to better handle this error, this test may erroneously fail. */
// JenkinsRule.WebClient wc = j.createWebClient(); JenkinsRule.WebClient wc = j.createWebClient();
//
// wc.setThrowExceptionOnFailingStatusCode(false); wc.setThrowExceptionOnFailingStatusCode(false);
// HtmlPage page = wc.goTo("adjuncts/40331c1bldu3i%3b//'%3b//\"%3b//%25>%3f>uezm3<script>alert(1)</script>foo/org/kohsuke/stapler/jquery/jquery.full.js"); HtmlPage page = wc.goTo("adjuncts/40331c1bldu3i%3b//'%3b//\"%3b//%25>%3f>uezm3<script>alert(1)</script>foo/org/kohsuke/stapler/jquery/jquery.full.js");
//
// String content = page.getWebResponse().getContentAsString(); String content = page.getWebResponse().getContentAsString();
// assertThat(content, containsString("No such adjunct found")); assertThat(content, containsString("No such adjunct found"));
// assertThat(content, not(containsString("AdjunctManager.doDynamic"))); assertThat(content, not(containsString("AdjunctManager.doDynamic")));
// } }
//
// @Test @Test
// public void nonexistentAdjunctShowsTrace() throws Exception { public void nonexistentAdjunctShowsTrace() throws Exception {
// /* This test belongs in Stapler but it's easy to put it together here. /* This test belongs in Stapler but it's easy to put it together here.
// This test is based upon Stapler throwing an exception for this broken request. This test is based upon Stapler throwing an exception for this broken request.
// If Stapler is improved to better handle this error, this test may erroneously fail. */ If Stapler is improved to better handle this error, this test may erroneously fail. */
// JenkinsRule.WebClient wc = j.createWebClient(); JenkinsRule.WebClient wc = j.createWebClient();
// HttpResponses.SHOW_STACK_TRACE = true; HttpResponses.SHOW_STACK_TRACE = true;
//
// wc.setThrowExceptionOnFailingStatusCode(false); wc.setThrowExceptionOnFailingStatusCode(false);
// Page page = wc.goTo("adjuncts/40331c1bldu3i%3b//'%3b//\"%3b//%25>%3f>uezm3<script>alert(1)</script>foo/org/kohsuke/stapler/jquery/jquery.full.js", "text/plain"); Page page = wc.goTo("adjuncts/40331c1bldu3i%3b//'%3b//\"%3b//%25>%3f>uezm3<script>alert(1)</script>foo/org/kohsuke/stapler/jquery/jquery.full.js", "text/plain");
//
// String content = page.getWebResponse().getContentAsString(); String content = page.getWebResponse().getContentAsString();
// assertThat(content, containsString("No such adjunct found")); assertThat(content, containsString("No such adjunct found"));
// assertThat(content, containsString("AdjunctManager.doDynamic")); assertThat(content, containsString("AdjunctManager.doDynamic"));
// } }
@Test @Test
public void exception() throws Exception { public void exception() throws Exception {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册