| com.mockrunner.base.HTMLOutputModule com.mockrunner.tag.TagTestModule
TagTestModule | public class TagTestModule extends HTMLOutputModule (Code) | | Module for custom tag tests. Simulates the container by
performing the tag lifecycle.
|
clearOutput | public void clearOutput()(Code) | | Resets the output buffer.
|
createTag | public TagSupport createTag(Class tagClass)(Code) | | Creates a tag. Internally a
NestedTag is created but the wrapped tag is returned. If you
simply want to test the output of the tag without
nesting other tags, you do not have to care about the
NestedTag , just use the returned instance.
An empty attribute Map will be used for
the tag.
Parameters: tagClass - the class of the tag instance of TagSupport or BodyTagSupport RuntimeException , if the created tagis not an instance of TagSupport |
createTag | public TagSupport createTag(Class tagClass, Map attributes)(Code) | | Creates a tag. Internally a
NestedTag is created but the wrapped tag is returned. If you
simply want to test the output of the tag without
nesting other tags, you do not have to care about the
NestedTag , just use the returned instance.
The attributes Map contains the attributes
of this tag (propertyname maps to propertyvalue).
The attributes are populated (i.e. the tags setters are called)
during the lifecycle or with an explicit call of
TagTestModule.populateAttributes .
Parameters: tagClass - the class of the tag Parameters: attributes - the attribute map instance of TagSupport or BodyTagSupport RuntimeException , if the created tagis not an instance of TagSupport |
doAfterBody | public int doAfterBody()(Code) | | Calls the doAfterBody method of the current tag.
the result of doAfterBody RuntimeException , if the tagis a simple tag |
doEndTag | public int doEndTag()(Code) | | Calls the doEndTag method of the current tag.
the result of doEndTag RuntimeException , if the tagis a simple tag |
doInitBody | public void doInitBody()(Code) | | Calls the doInitBody method of the current tag.
throws: RuntimeException - if the current tag is no body tag RuntimeException , if the tagis a simple tag |
doStartTag | public int doStartTag()(Code) | | Calls the doStartTag method of the current tag.
the result of doStartTag RuntimeException , if the tagis a simple tag |
getTag | public TagSupport getTag()(Code) | | Returns the current wrapped tag.
instance of TagSupport or BodyTagSupport RuntimeException , if the wrapped tagis not an instance of TagSupport |
populateAttributes | public void populateAttributes()(Code) | | Populates the attributes of the underlying tag by
calling
NestedTag.populateAttributes . The setters
of the tag are called. Please note that child tags are not
populated. This is done during the lifecycle.
|
processTagLifecycle | public int processTagLifecycle()(Code) | | Performs the tags lifecycle by calling
NestedTag.doLifecycle .
All doBody and doTag methods are called as
in the real web container. The evaluation of the body is simulated
by performing the lifecycle recursively for all childs of the
NestedTag .
the result of the final doEndTag call or -1 inthe case of a simple tag |
release | public void release()(Code) | | Calls the release method of the current tag.
RuntimeException , if the tagis a simple tag |
setBody | public void setBody(String body)(Code) | | Sets the body of the tag as a static string. Please
note that all childs of the underlying
NestedTag are deleted and the static content is set. If you want
to use nested tags, please use the method
NestedTag.addTextChild to set static content.
Parameters: body - the static body content |
setDoRelease | public void setDoRelease(boolean doRelease)(Code) | | Specify if the release method should be called
after processing the tag lifecycle. Delegates to
NestedTag.setDoRelease Defaults to false . It's the container behaviour to call
release , but it's usually not necessary in the tests,
because the tag instances are not reused during a test run.
Parameters: doRelease - should release be called |
setDoReleaseRecursive | public void setDoReleaseRecursive(boolean doRelease)(Code) | | Specify if the release method should be called
after processing the tag lifecycle. Delegates to
NestedTag.setDoReleaseRecursive Defaults to false . It's the container behaviour to call
release , but it's usually not necessary in the tests,
because the tag instances are not reused during a test run.
Parameters: doRelease - should release be called |
|
|