mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
merged back the RC branch
This commit is contained in:
commit
c3f002cede
3 files changed
+20
-3
No files matched your search
@@ -132,9 +132,11 @@ import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException;
|
||||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.rules.MethodRule;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
import org.junit.rules.TestRule;
|
||||
import org.junit.runner.Description;
|
||||
import org.junit.runners.model.FrameworkMethod;
|
||||
import org.junit.runners.model.Statement;
|
||||
import org.jvnet.hudson.test.recipes.Recipe;
|
||||
import org.jvnet.hudson.test.rhino.JavaScriptDebugger;
|
||||
@@ -220,7 +222,7 @@ import static org.junit.matchers.JUnitMatchers.containsString;
|
||||
* @author Stephen Connolly
|
||||
* @since 1.436
|
||||
*/
|
||||
public class JenkinsRule implements TestRule, RootAction {
|
||||
public class JenkinsRule implements TestRule, MethodRule, RootAction {
|
||||
|
||||
private final TestEnvironment env = new TestEnvironment(null);
|
||||
|
||||
@@ -445,6 +447,13 @@ public class JenkinsRule implements TestRule, RootAction {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Backward compatibility with JUnit 4.8.
|
||||
*/
|
||||
public Statement apply(Statement base, FrameworkMethod method, Object target) {
|
||||
return apply(base,Description.createTestDescription(method.getMethod().getDeclaringClass(), method.getName(), method.getAnnotations()));
|
||||
}
|
||||
|
||||
public Statement apply(final Statement base, final Description description) {
|
||||
if (description.getAnnotation(WithoutJenkins.class) != null) {
|
||||
// request has been made to not create the instance for this test method
|
||||
|
||||
Reference in new issue
Block a user