Package org.jvnet.hudson.test
Test harness for Jenkins and its plugins. Start exploring from
JenkinsRule
.-
Interface Summary Interface Description EndOfTestListener Gets notified before the test completes to perform additional cleanup.FakeLauncher Fake a process launch.HudsonHomeLoader Controls how aHudsonTestCase
initializesJENKINS_HOME
.JenkinsSessionRule.Step One step to run, intended to be a SAM for lambdas withJenkinsSessionRule.then(org.jvnet.hudson.test.JenkinsSessionRule.Step)
.LenientRunnable LikeRunnable
but can throw any exception.PrefixedOutputStream.AnsiColor RealJenkinsRule.Step One step to run.RealJenkinsRule.Step2<T extends Serializable> RestartableJenkinsRule.Step One step to run, intended to be a SAM for lambdas withRestartableJenkinsRule.then(org.jvnet.hudson.test.RestartableJenkinsRule.Step)
. -
Class Summary Class Description BuildWatcher Echoes build output to standard error as it arrives.BuildWatcher.Listener CaptureEnvironmentBuilder Builder
that captures the environment variables used during a build.CaptureEnvironmentBuilder.DescriptorImpl ChannelShutdownListener Runs at the end of the test to cleanup any live channels.ClosureExecuterAction Server-side logic that implementsHudsonTestCase.executeOnServer(java.util.concurrent.Callable)
.ComputerConnectorTester Test bed to verify the configuration roundtripness of theComputerConnector
.ComputerConnectorTester.DescriptorImpl CreateFileBuilder Creates a test builder, which creates a file in the workspace.CreateFileBuilder.DescriptorImpl DefaultConstructorChecker Tests that the specified class has the default constructor.ExtractChangeLogParser ExtractChangeLogParser.ExtractChangeLogEntry ExtractChangeLogParser.FileInZip ExtractChangeLogSet ExtractResourceSCM SCM
useful for testing that extracts the given resource as a zip file.ExtractResourceWithChangesSCM SCM
useful for testing that extracts the given resource as a zip file.FailureBuilder MockBuilder
that always cause a build to fail.FailureBuilder.DescriptorImpl FakeChangeLogSCM Fake SCM implementation that can report arbitrary commits from arbitrary users.FakeChangeLogSCM.ChangelogAction FakeChangeLogSCM.EntryImpl FakeChangeLogSCM.FakeChangeLogParser FakeChangeLogSCM.FakeChangeLogSet FakeLauncher.FinishedProc FakeProc
implementation that represents a completed process.FlagRule<T> Saves and restores sort of a flag, such as astatic
field or system property.GroovyHudsonTestCase Deprecated. UseGroovyJenkinsRule
instead.GroovyJenkinsRule JenkinsRule
variant with special options for tests written in Groovy.HudsonHomeLoader.CopyExisting Allocates a new directory by copying from an existing directory, or unzipping from a zip file.HudsonHomeLoader.Local Allocates a new directory by copying from a test resourceHudsonPageCreator PageCreator
that understands JNLP file.HudsonTestCase Deprecated. New code should useJenkinsRule
.HudsonTestCase.TestBuildWrapper HudsonTestCase.TestBuildWrapper.TestBuildWrapperDescriptor InboundAgentRule Manages inbound agents.InboundAgentRule.AgentArguments InboundAgentRule.Options The options used to (re)start an inbound agent.InboundAgentRule.Options.Builder A builder ofInboundAgentRule.Options
.JavaNetReverseProxy Acts as a reverse proxy, so that during a test we can avoid hitting updates.jenkins.io.JellyTestSuiteBuilder Builds up aTestSuite
for performing static syntax checks on Jelly scripts.JenkinsComputerConnectorTester Test bed to verify the configuration roundtripness of theComputerConnector
.JenkinsComputerConnectorTester.DescriptorImpl JenkinsMatchers Some handy matchers.JenkinsRecipe.Runner<T extends Annotation> The code that implements the recipe semantics.JenkinsRule JUnit rule to allow test cases to fire up a Jenkins instance.JenkinsRule.DummySecurityRealm JenkinsRule.JSONWebResponse Convenience wrapper for JSON responses.JenkinsRule.TestBuildWrapper JenkinsRule.TestBuildWrapper.TestBuildWrapperDescriptor JenkinsSessionRule Simpler alternative toRestartableJenkinsRule
.LoggerRule A test rule which allows you to easily enable one or more loggers for the duration of a test.MemoryAssert Static utility methods for verifying heap memory usage.MemoryAssert.HistogramElement MockAuthorizationStrategy An authorization strategy configured in a fluent style from test code.MockBuilder Forces the build result to be some pre-configured value.MockBuilder.DescriptorImpl MockFolder Minimal implementation of a modifiable item group akin to the CloudBees Folders plugin.MockFolder.DescriptorImpl MockQueueItemAuthenticator Allows testing of anything related toQueueItemAuthenticator
.MockQueueItemAuthenticator.DescriptorImpl NoListenerConfiguration Kills off theWebAppMain
ServletContextListener
.PluginAutomaticTestBuilder Called by the code generated by maven-hpi-plugin to build tests for plugins.PluginAutomaticTestBuilder.OtherTests PrefixedOutputStream DecoratingOutputStream
which prefixes lines of text with an identifier and optional color.PrefixedOutputStream.Builder PretendSlave Slave that pretends to fork processes.PretendSlave.DescriptorImpl PropertiesTestSuite Checks things about*.properties
.RealJenkinsRule LikeJenkinsSessionRule
but running Jenkins in a more realistic environment.RealJenkinsRule.CustomJenkinsRule RealJenkinsRule.Endpoint RealJenkinsRule.Init2 RemainingActivityListener Checks for any ongoing activity (queue, builds) that might interfere withTemporaryDirectoryAllocator.dispose()
.RestartableJenkinsRule Provides a pattern for executing a sequence of steps.RestartableJenkinsRule.Builder RunLoadCounter Utility to determine when a build record is loaded.RunLoadCounter.Marker Used internally.RunLoadCounter.MarkerAdder Used internally.SecuredMockFolder Deprecated. UseMockAuthorizationStrategy
plusMockFolder
instead.SecuredMockFolder.DescriptorImpl SequenceLock Lock mechanism to let multiple threads execute phases sequentially.SimpleCommandLauncher Stripped-down clone ofCommandLauncher
.SimpleCommandLauncher.DescriptorImpl SingleFileSCM SCM
useful for testing that puts just one file in the workspace.SleepBuilder Builder
that just sleeps for the specified amount of milli-seconds.SleepBuilder.DescriptorImpl TailLog Utility to display the log of a build in real time.TemporaryDirectoryAllocator Allocates temporary directories and cleans it up at the end.TestBuilder PartialBuilder
implementation for writing a one-off throw-away builder used during tests.TestCrumbIssuer A crumb issuer that issues a constant crumb value.TestCrumbIssuer.DescriptorImpl TestEnvironment TestExtensionLoader LoadsTestExtension
s.TestNotifier PartialNotifier
implementation to facilitate notifier implementation for testing.TestPluginManager PluginManager
to speed up unit tests.ThreadPoolImpl TouchBuilder UnitTestSupportingPluginManager PluginManager
that can work with unit tests where dependencies are just jars.UnstableBuilder MockBuilder
that always cause a build to fail.UnstableBuilder.DescriptorImpl WarExploder Ensures thatjenkins.war
is exploded.WithoutJenkins.RunnerImpl WorkspaceCopyFileBuilder Test Builder, which copies a file from a workspace of another job.WorkspaceCopyFileBuilder.DescriptorImpl -
Enum Summary Enum Description PrefixedOutputStream.Color -
Exception Summary Exception Description HudsonTestCase.BreakException JenkinsRule.BreakException RealJenkinsRule.JenkinsStartupException RealJenkinsRule.ProxyException RealJenkinsRule.StepException -
Annotation Types Summary Annotation Type Description JenkinsRecipe Meta-annotation for recipe annotations, which controls the test environment set up.RandomlyFails Deprecated. Using a 2.x parent POM, Surefire will be configured to retry failing tests automatically.TestExtension Works likeExtension
except used for inserting extensions during unit tests.WithoutJenkins An annotation for test methods that do not require theJenkinsRule
/HudsonTestCase
to create and tear down the jenkins instance.