Package org.jvnet.hudson.test
Class RestartableJenkinsRule
java.lang.Object
org.jvnet.hudson.test.RestartableJenkinsRule
- All Implemented Interfaces:
org.junit.rules.MethodRule
@Deprecated
public class RestartableJenkinsRule
extends Object
implements org.junit.rules.MethodRule
Deprecated.
- Since:
- 1.567
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.static interfaceDeprecated.One step to run, intended to be a SAM for lambdas withthen(org.jvnet.hudson.test.RestartableJenkinsRule.Step). -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStep(org.junit.runners.model.Statement step) Deprecated.voidaddStep(org.junit.runners.model.Statement step, boolean expectedToStartCorrectly) Deprecated.voidaddStepWithDirtyShutdown(org.junit.runners.model.Statement step) Deprecated.org.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target) Deprecated.protected JenkinsRulecreateJenkinsRule(org.junit.runner.Description description) Deprecated.voidstep(groovy.lang.Closure<?> c) Deprecated.voidDeprecated.Run one Jenkins session and shut down.voidDeprecated.voidDeprecated.Run one Jenkins session and then simulate the Jenkins process ending without a clean shutdown.
-
Field Details
-
j
Deprecated. -
home
Deprecated.JENKINS_HOME
-
-
Constructor Details
-
RestartableJenkinsRule
public RestartableJenkinsRule()Deprecated.
-
-
Method Details
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target) Deprecated.- Specified by:
applyin interfaceorg.junit.rules.MethodRule
-
step
Deprecated. -
then
Deprecated.Run one Jenkins session and shut down.- Since:
- 2.24
-
thenWithHardShutdown
Deprecated.Run one Jenkins session and then simulate the Jenkins process ending without a clean shutdown. This can be used to test that data is appropriately persisted without relying on shutdown processes.Implementation note: we're actually just copying the JENKINS_HOME, which takes some time - so the shutdown isn't truly instant (additional data may be written while this happens).
-
thenDoesNotStart
public void thenDoesNotStart()Deprecated. -
addStep
Deprecated. -
addStep
@Deprecated public void addStep(org.junit.runners.model.Statement step, boolean expectedToStartCorrectly) Deprecated. -
addStepWithDirtyShutdown
Deprecated. -
createJenkinsRule
Deprecated.
-
JenkinsSessionRule.RestartableJenkinsRulewill evaluate your test method to collect all steps, then execute them in turn and restart Jenkins in between each step, after the test method has exited. That is probably not what you would expect from looking at sources, and it will not work naturally withAfteretc. Tests needing to dynamically disable plugins, simulate crashes, etc. are better written usingRealJenkinsRule.