Package org.jvnet.hudson.test
package org.jvnet.hudson.test
Test harness for Jenkins and its plugins. Start exploring from
JenkinsRule
.-
ClassDescriptionEchoes build output to standard error as it arrives.
Builder
that captures the environment variables used during a build.Runs at the end of the test to cleanup any live channels.Server-side logic that implementsHudsonTestCase.executeOnServer(java.util.concurrent.Callable)
.Test bed to verify the configuration roundtripness of theComputerConnector
.Creates a test builder, which creates a file in the workspace.Tests that the specified class has the default constructor.Gets notified before the test completes to perform additional cleanup.SCM
useful for testing that extracts the given resource as a zip file.SCM
useful for testing that extracts the given resource as a zip file.MockBuilder
that always cause a build to fail.Fake SCM implementation that can report arbitrary commits from arbitrary users.Fake a process launch.FakeProc
implementation that represents a completed process.FlagRule<T>Saves and restores sort of a flag, such as astatic
field or system property.Deprecated.JenkinsRule
variant with special options for tests written in Groovy.Controls how aHudsonTestCase
initializesJENKINS_HOME
.Allocates a new directory by copying from an existing directory, or unzipping from a zip file.Allocates a new directory by copying from a test resourcePageCreator
that understands JNLP file.Deprecated.New code should useJenkinsRule
.Manages inbound agents.The options used to (re)start an inbound agent.A builder ofInboundAgentRule.Options
.Acts as a reverse proxy, so that during a test we can avoid hitting updates.jenkins.io.Builds up aTestSuite
for performing static syntax checks on Jelly scripts.Test bed to verify the configuration roundtripness of theComputerConnector
.Some handy matchers.Meta-annotation for recipe annotations, which controls the test environment set up.JenkinsRecipe.Runner<T extends Annotation>The code that implements the recipe semantics.JUnit rule to allow test cases to fire up a Jenkins instance.Convenience wrapper for JSON responses.Simpler alternative toRestartableJenkinsRule
.One step to run, intended to be a SAM for lambdas withJenkinsSessionRule.then(org.jvnet.hudson.test.JenkinsSessionRule.Step)
.LikeRunnable
but can throw any exception.A test rule which allows you to easily enable one or more loggers for the duration of a test.Static utility methods for verifying heap memory usage.An authorization strategy configured in a fluent style from test code.Forces the build result to be some pre-configured value.Minimal implementation of a modifiable item group akin to the CloudBees Folders plugin.Allows testing of anything related toQueueItemAuthenticator
.Kills off theWebAppMain
ServletContextListener
.Called by the code generated by maven-hpi-plugin to build tests for plugins.DecoratingOutputStream
which prefixes lines of text with an identifier and optional color.Slave that pretends to fork processes.Checks things about*.properties
.Deprecated.Using a 2.x parent POM, Surefire will be configured to retry failing tests automatically.LikeJenkinsSessionRule
but running Jenkins in a more realistic environment.One step to run.RealJenkinsRule.Step2<T extends Serializable>RealJenkinsRule.StepWithFourArgs<A1 extends Serializable,A2 extends Serializable, A3 extends Serializable, A4 extends Serializable> RealJenkinsRule.StepWithOneArg<A1 extends Serializable>RealJenkinsRule.StepWithReturnAndFourArgs<R extends Serializable,A1 extends Serializable, A2 extends Serializable, A3 extends Serializable, A4 extends Serializable> RealJenkinsRule.StepWithReturnAndThreeArgs<R extends Serializable,A1 extends Serializable, A2 extends Serializable, A3 extends Serializable> RealJenkinsRule.StepWithReturnAndTwoArgs<R extends Serializable,A1 extends Serializable, A2 extends Serializable> RealJenkinsRule.StepWithThreeArgs<A1 extends Serializable,A2 extends Serializable, A3 extends Serializable> Plugin for use internally only byRealJenkinsRule
, do not use this from plugin test code!Checks for any ongoing activity (queue, builds) that might interfere withTemporaryDirectoryAllocator.dispose()
.Provides a pattern for executing a sequence of steps.One step to run, intended to be a SAM for lambdas withRestartableJenkinsRule.then(org.jvnet.hudson.test.RestartableJenkinsRule.Step)
.Utility to determine when a build record is loaded.Used internally.Used internally.Deprecated.UseMockAuthorizationStrategy
plusMockFolder
instead.Lock mechanism to let multiple threads execute phases sequentially.Stripped-down clone ofCommandLauncher
.SCM
useful for testing that puts just one file in the workspace.Builder
that just sleeps for the specified amount of milli-seconds.Utility to display the log of a build in real time.Allocates temporary directories and cleans it up at the end.PartialBuilder
implementation for writing a one-off throw-away builder used during tests.A crumb issuer that issues a constant crumb value.Works likeExtension
except used for inserting extensions during unit tests.LoadsTestExtension
s.PartialNotifier
implementation to facilitate notifier implementation for testing.PluginManager
to speed up unit tests.PluginManager
that can work with unit tests where dependencies are just jars.MockBuilder
that always cause a build to fail.Ensures thatjenkins.war
is exploded.An annotation for test methods that do not require theJenkinsRule
/HudsonTestCase
to create and tear down the jenkins instance.Test Builder, which copies a file from a workspace of another job.
GroovyJenkinsRule
instead.