Package org.jvnet.hudson.test
Class JenkinsSessionRule
java.lang.Object
org.jvnet.hudson.test.JenkinsSessionRule
- All Implemented Interfaces:
org.junit.rules.TestRule
JenkinsRule
derivative which allows Jenkins to be restarted in the middle of a test.
It also supports running test code before, between, or after Jenkins sessions,
whereas a test method using JenkinsRule
directly
will only run after Jenkins has started and must complete before Jenkins terminates.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
One step to run, intended to be a SAM for lambdas withthen(org.jvnet.hudson.test.JenkinsSessionRule.Step)
. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JenkinsSessionRule
public JenkinsSessionRule()
-
-
Method Details
-
getHome
Get the Jenkins home directory, which is consistent across restarts. -
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) - Specified by:
apply
in interfaceorg.junit.rules.TestRule
-
then
Run one Jenkins session and shut down.- Throws:
Throwable
-