Added a listener that gets called at the end of the test to provide opportunity for a cleanup.
This avoids the code duplication between HudsonTestCase vs JenkinsRule, too.
https://ci.jenkins-ci.org/job/jenkins_main_trunk/2602/testReport/junit/hudson.model/JobTest/readPermission/
com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 404 Not Found for http://localhost:47898/jenkins//j_acegi_security_check
at com.gargoylesoftware.htmlunit.WebClient.throwFailingHttpStatusCodeExceptionIfNecessary(WebClient.java:549)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:333)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:357)
at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:196)
at org.jvnet.hudson.test.JenkinsRule$WebClient.login(JenkinsRule.java:1776)
at org.jvnet.hudson.test.JenkinsRule$WebClient.login(JenkinsRule.java:1788)
at hudson.model.JobTest.readPermission(JobTest.java:182)
Copying every time causes overwriting files in the webapp directory, and often causes errors in Windows.
This reverts JENKINS-12647(commit 7ae303f881).
Expanded MockFolder to be a ViewGroup so that it is possible to test views inside folders,
and generally fixed it to service Stapler hierarchies properly so that WebClient-based tests can work.
Otherwise your disk will fill up with (large) /tmp/hudson*tmp/ dirs when running plugin tests.
(Would have been better to use e.g. TemporaryFolder, but that would require incompatible changes to the test harness.)
To reproduce SUREFIRE-974 prior to this fix, pick an arbitrary group class to (not) exclude:
mvn -f test/pom.xml -Dtest=CoreJellyTest -DexcludedGroups=hudson.ExtensionPoint test
- My second patch, with whitelisted XPath values and forbidden JSONP.
- Disabling JSONP altogether for REST API (unless explicitly allowed).
- Forbid primitive XPath result sets by default.
- Refuse to serve _crumb=123456 as this could (very hypothetically) be exploited.
(cherry picked from commit f4af9b1ab4)
Conflicts:
core/src/main/java/hudson/model/Api.java