org.jvnet.hudson.test
Class GroovyJenkinsRule

java.lang.Object
  extended by org.jvnet.hudson.test.JenkinsRule
      extended by org.jvnet.hudson.test.GroovyJenkinsRule
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Action, hudson.model.ModelObject, hudson.model.RootAction, org.junit.rules.MethodRule, org.junit.rules.TestRule

public class GroovyJenkinsRule
extends JenkinsRule

JenkinsRule variant with special options for tests written in Groovy.

Since:
1.535

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jvnet.hudson.test.JenkinsRule
JenkinsRule.BreakException, JenkinsRule.DummySecurityRealm, JenkinsRule.TestBuildWrapper, JenkinsRule.WebClient
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class org.jvnet.hudson.test.JenkinsRule
computerConnectorTester, contextPath, env, homeLoader, hudson, jenkins, jsDebugger, localPort, MIME_TYPES, NO_PROPERTIES, recipes, server, SLAVE_DEBUG_PORT, tearDowns, testDescription, timeout, useLocalPluginManager
 
Constructor Summary
GroovyJenkinsRule()
           
 
Method Summary
 hudson.tasks.Builder builder(groovy.lang.Closure c)
          Wraps a closure as a Builder.
 Object executeOnServer(groovy.lang.Closure c)
          Executes the given closure on the server, in the context of an HTTP request.
 
Methods inherited from class org.jvnet.hudson.test.JenkinsRule
after, apply, apply, assertAllImageLoadSuccessfully, assertBuildStatus, assertBuildStatusSuccess, assertBuildStatusSuccess, assertEqualBeans, assertEqualDataBoundBeans, assertEqualDataBoundBeans, assertGoodStatus, assertHelpExists, assertLogContains, assertLogNotContains, assertStringContains, assertStringContains, assertXPath, assertXPath, assertXPathResultsContainText, assertXPathValue, assertXPathValueContains, before, buildAndAssertSuccess, buildAndAssertSuccess, buildAndAssertSuccess, buildAndAssertSuccess, configRoundtrip, configRoundtrip, configRoundtrip, configRoundtrip, configRoundtrip, configRoundtrip, configRoundtrip, configRoundtrip, configRoundtrip, configureDefaultAnt, configureDefaultMaven, configureDefaultMaven, configureMaven3, configureUpdateCenter, configureUserRealm, createComputerLauncher, createDummySecurityRealm, createFolder, createFreeStyleProject, createFreeStyleProject, createLocalLauncher, createMatrixProject, createMatrixProject, createMavenProject, createMavenProject, createOnlineSlave, createOnlineSlave, createOnlineSlave, createPretendSlave, createSlave, createSlave, createSlave, createSlave, createSlave, createSlave, createTaskListener, createTmpDir, createUniqueProjectName, createWebClient, createWebServer, executeOnServer, findDataBoundConstructor, findPreviousInputElement, get, getButtonByCaption, getDisplayName, getIconFileName, getInstance, getLog, getPluginManager, getTestDescription, getURL, getUrlName, getWebAppRoot, interactiveBreak, isGoodHttpStatus, isSomethingHappening, last, newHudson, pause, recipe, recipeLoadCurrentPlugin, search, setPluginManager, setQuietPeriod, setUpTimeout, submit, submit, waitUntilNoActivity, waitUntilNoActivityUpTo, with, with, withExistingHome, withNewHome, withPresetData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyJenkinsRule

public GroovyJenkinsRule()
Method Detail

executeOnServer

public Object executeOnServer(groovy.lang.Closure c)
                       throws Exception
Executes the given closure on the server, in the context of an HTTP request. This is useful for testing some methods that require StaplerRequest and StaplerResponse.

The closure will get the request and response as parameters.

Throws:
Exception

builder

public hudson.tasks.Builder builder(groovy.lang.Closure c)
Wraps a closure as a Builder.



Copyright © 2004-2014. All Rights Reserved.