Package org.jvnet.hudson.test
Class JenkinsSessionRule
- java.lang.Object
-
- org.jvnet.hudson.test.JenkinsSessionRule
-
- All Implemented Interfaces:
org.junit.rules.TestRule
public class JenkinsSessionRule extends Object implements org.junit.rules.TestRule
Simpler alternative toRestartableJenkinsRule
. Most critically,then(org.jvnet.hudson.test.JenkinsSessionRule.Step)
runs immediately, so this rule plays nicely with things likeAfter
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
JenkinsSessionRule.Step
One step to run, intended to be a SAM for lambdas withthen(org.jvnet.hudson.test.JenkinsSessionRule.Step)
.
-
Constructor Summary
Constructors Constructor Description JenkinsSessionRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.junit.runners.model.Statement
apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
File
getHome()
Get the Jenkins home directory, which is consistent across restarts.void
then(JenkinsSessionRule.Step s)
Run one Jenkins session and shut down.
-
-
-
Method Detail
-
getHome
public File 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
public void then(JenkinsSessionRule.Step s) throws Throwable
Run one Jenkins session and shut down.- Throws:
Throwable
-
-