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
Without this, I saw:
FAILURE: initializationError(hudson.model.CauseTest)
[INFO] java.lang.Exception: Field j must implement MethodRule
[INFO] at org.junit.runners.BlockJUnit4ClassRunner.validateRuleField(BlockJUnit4ClassRunner.java:188)
[INFO] at org.junit.runners.BlockJUnit4ClassRunner.validateFields(BlockJUnit4ClassRunner.java:183)
[INFO] at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:123)
[INFO] at org.junit.runners.ParentRunner.validate(ParentRunner.java:269)
[INFO] at org.junit.runners.ParentRunner.<init>(ParentRunner.java:66)
[INFO] at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:58)
[INFO] at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:13)
[INFO] at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
[INFO] at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
[INFO] at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
[INFO] at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
[INFO] at junit.framework.JUnit4TestAdapter.<init>(JUnit4TestAdapter.java:31)
[INFO] at junit.framework.JUnit4TestAdapter.<init>(JUnit4TestAdapter.java:24)
[INFO] at com.sun.maven.junit.LocalTestCaseRunner.buildMethodTestCase(LocalTestCaseRunner.java:121)
[INFO] at com.sun.maven.junit.LocalTestCaseRunner.buildTestCase(LocalTestCaseRunner.java:83)
[INFO] at com.sun.maven.junit.LocalTestCaseRunner.runTestCase(LocalTestCaseRunner.java:62)
[INFO] at com.sun.maven.junit.LocalTestCaseRunner.runTestCase(LocalTestCaseRunner.java:58)
[INFO] at sun.reflect.GeneratedMethodAccessor334.invoke(Unknown Source)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[INFO] at java.lang.reflect.Method.invoke(Method.java:597)
[INFO] at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:274)
[INFO] at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:255)
[INFO] at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:215)
[INFO] at hudson.remoting.UserRequest.perform(UserRequest.java:118)
[INFO] at hudson.remoting.UserRequest.perform(UserRequest.java:48)
[INFO] at hudson.remoting.Request$2.run(Request.java:270)
[INFO] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
[INFO] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
[INFO] at java.util.concurrent.FutureTask.run(FutureTask.java:138)
[INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[INFO] at java.lang.Thread.run(Thread.java:662)