|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object grails.test.mixin.support.GrailsUnitTestMixin grails.test.mixin.web.ControllerUnitTestMixin grails.test.mixin.web.UrlMappingsUnitTestMixin
class UrlMappingsUnitTestMixin extends ControllerUnitTestMixin
A mixin for testing URL mappings in Grails.
Method Summary | |
---|---|
void
|
assertAction(java.lang.Object controller, java.lang.Object action, java.lang.Object url)
Asserts an action exists for the specified controller name, action name and url |
void
|
assertController(java.lang.Object controller, java.lang.Object url)
asserts a controller exists for the specified name and url |
void
|
assertForwardUrlMapping(java.lang.Object assertions, java.lang.Object url)
|
void
|
assertForwardUrlMapping(java.lang.Object assertions, java.lang.Object url, java.lang.Object paramAssertions)
|
void
|
assertReverseUrlMapping(java.util.Map assertions, java.lang.Object url)
Asserts the given controller and action produce the given reverse URL mapping |
void
|
assertReverseUrlMapping(java.util.Map assertions, java.lang.Object url, groovy.lang.Closure paramAssertions)
Asserts the given controller and action produce the given reverse URL mapping |
void
|
assertUrlMapping(java.util.Map assertions, java.lang.Object url)
Asserts a URL mapping maps to the controller and action specified by named parameters. |
void
|
assertUrlMapping(java.util.Map assertions, java.lang.Object url, groovy.lang.Closure paramAssertions)
Asserts a URL mapping maps to the controller and action specified by named parameters. |
void
|
assertView(java.lang.Object controller, java.lang.Object view, java.lang.Object url)
Asserts a view exists for the specified controller name, view name and url |
UrlMappingsHolder
|
getUrlMappingsHolder()
@return The UrlMappingsHolder bean |
java.lang.Object
|
mapURI(java.lang.String uri)
Maps a URI and returns the appropriate controller instance |
UrlMappingsHolder
|
mockUrlMappings(java.lang.Class urlMappingsClass)
Mocks specific URL mappings class |
Methods inherited from class ControllerUnitTestMixin | |
---|---|
bindGrailsWebRequest, cleanupGrailsWeb, clearGrailsWebRequest, configureGrailsWeb, getFlash, getModel, getParams, getSession, getView, mockCommandObject, mockController, testFor |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Method Detail |
---|
void assertAction(java.lang.Object controller, java.lang.Object action, java.lang.Object url)
controller
- The controller nameaction
- The action nameurl
- The URL
void assertController(java.lang.Object controller, java.lang.Object url)
controller
- The controller nameurl
- The url
void assertForwardUrlMapping(java.lang.Object assertions, java.lang.Object url)
void assertForwardUrlMapping(java.lang.Object assertions, java.lang.Object url, java.lang.Object paramAssertions)
void assertReverseUrlMapping(java.util.Map assertions, java.lang.Object url)
assertReverseUrlMapping("/action1", controller: "grailsUrlMappingsTestCaseFake", action: "action1")
assertions
- The assertions as named parametersurl
- The URL as a string
void assertReverseUrlMapping(java.util.Map assertions, java.lang.Object url, groovy.lang.Closure paramAssertions)
assertReverseUrlMapping("/action1", controller: "grailsUrlMappingsTestCaseFake", action: "action1")
assertions
- The assertions as named parametersurl
- The URL as a stringparamAssertions
- The parameters to assert defined in the body of the closure
void assertUrlMapping(java.util.Map assertions, java.lang.Object url)
assertUrlMapping("/action1", controller: "grailsUrlMappingsTestCaseFake", action: "action1")
assertions
- The assertions as named parametersurl
- The URL as a string
void assertUrlMapping(java.util.Map assertions, java.lang.Object url, groovy.lang.Closure paramAssertions)
assertUrlMapping("/action1", controller: "grailsUrlMappingsTestCaseFake", action: "action1")
assertions
- The assertions as named parametersurl
- The URL as a stringparamAssertions
- The parameters to assert defined in the body of the closure
void assertView(java.lang.Object controller, java.lang.Object view, java.lang.Object url)
controller
- The controller nameview
- The view nameurl
- The url
UrlMappingsHolder getUrlMappingsHolder()
java.lang.Object mapURI(java.lang.String uri)
uri
- The URI to map
UrlMappingsHolder mockUrlMappings(java.lang.Class urlMappingsClass)
urlMappingsClass
- The URL mappings class to mock
Groovy Documentation