ndlesiecki 01/09/25 00:07:56
Modified: src/sample/share/org/apache/cactus/sample
TestSampleBodyTag.java
Log:
works on Tomcat and Orion 1.5.2 now...
Revision Changes Path
1.2 +14 -11
jakarta-cactus/src/sample/share/org/apache/cactus/sample/TestSampleBodyTag.java
Index: TestSampleBodyTag.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/src/sample/share/org/apache/cactus/sample/TestSampleBodyTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestSampleBodyTag.java 2001/09/24 11:13:20 1.1
+++ TestSampleBodyTag.java 2001/09/25 07:07:56 1.2
@@ -67,7 +67,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Nciholas Lesiecki</a>
*
- * @version $Id: TestSampleBodyTag.java,v 1.1 2001/09/24 11:13:20 vmassol Exp $
+ * @version $Id: TestSampleBodyTag.java,v 1.2 2001/09/25 07:07:56 ndlesiecki Exp $
*/
public class TestSampleBodyTag extends JspTestCase
{
@@ -136,12 +136,19 @@
//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@");
+ 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);
+
+ }
+
+ public void tearDown()
+ {
+ //necessary for tag to output anything on most servlet engines.
+ this.pageContext.popBody();
}
/**
@@ -150,17 +157,13 @@
*/
public void endReplacement(WebResponse theResponse)
{
- String[] contentArray = theResponse.getTextAsArray();
- assert("Response contains [" + contentArray.length + "]. It should " +
- "have contained 2 lines !", contentArray.length == 2);
- String firstLine = contentArray[0];
- String secondLine = contentArray[1];
+ String content = theResponse.getText();
- assert("Line [" + firstLine + "] should have contained the [" +
+ assert("Response should have contained the [" +
"replacement is now replacement] string",
- firstLine.indexOf("replacement is now replacement") > -1);
- assert("Line [" + secondLine + "] should have contained the [" +
- "replacement] string", secondLine.indexOf("replacement") > -1);
+ content.indexOf("replacement is now replacement") > -1);
+ assert("Response should have contained the [" +
+ "replacement_replacement] string", content.indexOf("replacement") > -1);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]