public void testReplacement() throws Exception {
//set the target and the String to replace it with
this.tag.setTarget("@target@");
this.tag.setReplacement("replacement");
//add the tag's body by writing to the BodyContent object created in
//setUp()
this.tagContent.println("@target@ is now @target@");
this.tagContent.println("@target@_@target@");
//none of the other life cycle methods need to be implemented, so they
//do not need to be called.
int result = this.tag.doAfterBody();
assertEquals(BodyTag.SKIP_BODY, result);
}
Sets the replacement target and replacement String on the tag, then calls
doAfterBody(). Most of the assertion work is done in endReplacement(). |