Package org.jvnet.hudson.test.fixtures
Class JenkinsSessionFixture
java.lang.Object
org.jvnet.hudson.test.fixtures.JenkinsSessionFixture
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.
Usage:
private static final JenkinsSessionFixture FIXTURE = new JenkinsSessionFixture();
public void method() {
try {
FIXTURE.setUp([…]);
FIXTURE.then(() -> […]);
} finally {
FIXTURE.tearDown();
}
}
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceOne step to run, intended to be a SAM for lambdas withthen(org.jvnet.hudson.test.fixtures.JenkinsSessionFixture.Step). -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JenkinsSessionFixture
public JenkinsSessionFixture()
-
-
Method Details
-
getHome
Get the Jenkins home directory, which is consistent across restarts. -
setUp
-
tearDown
public void tearDown() -
then
Run one Jenkins session and shut down.- Throws:
Throwable
-