|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NestedTag
NestedTag
is used to simulate tags with static body
content and child tags. It can be used to test the interaction
of different tags. A NestedTag
always wraps a real tag
class (the actual testee).
TagTestModule
works with NestedTag
instances
internally. If you only want to test the ouptput of one single tag
without interaction with other tags, you do not have to care about
NestedTag
. Use it, if you want to write sophisticated
tests of body tags. NestedTag
instances are created using
TagTestModule.createNestedTag(java.lang.Class)
. You do not need to create them
on your own in the tests.
Method Summary | |
---|---|
void |
addDynamicChild(DynamicChild child)
Adds a dynamic child simulating scriptlets and EL expressions. |
NestedTag |
addTagChild(java.lang.Class tag)
Adds a tag child simulating nested tags. |
NestedTag |
addTagChild(java.lang.Class tag,
java.util.Map attributeMap)
Adds a tag child simulating nested tags. |
NestedTag |
addTagChild(javax.servlet.jsp.tagext.JspTag tag)
Adds a tag child simulating nested tags. |
NestedTag |
addTagChild(javax.servlet.jsp.tagext.JspTag tag,
java.util.Map attributeMap)
Adds a tag child simulating nested tags. |
NestedTag |
addTagChild(javax.servlet.jsp.tagext.TagSupport tag)
Adds a tag child simulating nested tags. |
NestedTag |
addTagChild(javax.servlet.jsp.tagext.TagSupport tag,
java.util.Map attributeMap)
Adds a tag child simulating nested tags. |
void |
addTextChild(java.lang.String text)
Adds a text child simulating static body content. |
int |
doLifecycle()
Performs the tag lifecycle. |
java.lang.Object |
getChild(int index)
Returns a child specified by its index. |
java.util.List |
getChilds()
Returns the List of childs. |
javax.servlet.jsp.tagext.TagSupport |
getTag()
Returns the wrapped tag (the testee). |
javax.servlet.jsp.tagext.JspTag |
getWrappedTag()
Returns the wrapped tag (the testee). |
void |
populateAttributes()
Populates the attributes of the underlying tag. |
void |
removeChilds()
Removes all childs. |
void |
setDoRelease(boolean doRelease)
Specify if the release method should be called
after processing the tag lifecycle. |
void |
setDoReleaseRecursive(boolean doRelease)
Specify if the release method should be called
after processing the tag lifecycle. |
Method Detail |
---|
void setDoRelease(boolean doRelease)
release
method should be called
after processing the tag lifecycle. Defaults to false
.
It's the container behaviour to call release
when the tag
goes back to the pool. It's usually not necessary in the tests
to call this method, because the tag instances are not pooled and
reused during a test run.
This method sets the doRelease
flag for this tag but
does not set the flag for child tags.
doRelease
- should release be called, default is false
void setDoReleaseRecursive(boolean doRelease)
release
method should be called
after processing the tag lifecycle. Defaults to false
.
It's the container behaviour to call release
when the tag
goes back to the pool. It's usually not necessary in the tests
to call this method, because the tag instances are not pooled and
reused during a test run.
This method sets the doRelease
flag for this
tag and all child tags recursively.
doRelease
- should release be called, default is false
void populateAttributes()
int doLifecycle() throws javax.servlet.jsp.JspException
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
. Calls release
on the tag after
processing the tag lifecycle, if doRelease
is true
(use setDoRelease(boolean)
).
doEndTag
call
javax.servlet.jsp.JspException
javax.servlet.jsp.tagext.TagSupport getTag()
javax.servlet.jsp.tagext.JspTag getWrappedTag()
void removeChilds()
java.util.List getChilds()
List
of childs.
List
of childsjava.lang.Object getChild(int index)
index
- the index
void addTextChild(java.lang.String text)
text
- the static textvoid addDynamicChild(DynamicChild child)
TagUtil.evalBody(List, Object)
for details about child handling.
child
- the dynamic child instanceNestedTag addTagChild(java.lang.Class tag)
NestedTag
will be created
automatically wrapping the specified tag. An empty attribute
Map
will be used for the tag.
tag
- the tag classNestedTag addTagChild(java.lang.Class tag, java.util.Map attributeMap)
NestedTag
will be created
automatically wrapping the specified tag. The attributes
Map
contains the attributes of this tag
(propertyname maps to propertyvalue).
tag
- the tag classattributeMap
- the attribute mapNestedTag addTagChild(javax.servlet.jsp.tagext.TagSupport tag)
NestedTag
will be created automatically
wrapping the specified tag. An empty attribute Map
will be used for the tag.
tag
- the tagNestedTag addTagChild(javax.servlet.jsp.tagext.TagSupport tag, java.util.Map attributeMap)
NestedTag
will be created
automatically wrapping the specified tag. The attributes
Map
contains the attributes of this tag
(propertyname maps to propertyvalue).
tag
- the tagattributeMap
- the attribute mapNestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag)
NestedTag
will be created automatically
wrapping the specified tag. An empty attribute Map
will be used for the tag.
tag
- the tagNestedTag addTagChild(javax.servlet.jsp.tagext.JspTag tag, java.util.Map attributeMap)
NestedTag
will be created
automatically wrapping the specified tag. The attributes
Map
contains the attributes of this tag
(propertyname maps to propertyvalue).
tag
- the tagattributeMap
- the attribute map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |