|
Cactus從1.2版本開始提供了與HttpUnit的整合,在之前曾經使用過endXXX(),當時所使用的WebResponse物件是org.apache.cactus.WebResponse,您可以使用它來傳回一些簡單的訊息進行測試。 public void endXXX(
org.apache.cactus.WebResponse theResponse) { .... } 如果您需要更多的分析資料,您可以使用HttpUnit,同樣也是在撰寫endXXX()方法,所不同的是在參數列,這一次您傳遞的參數是com.meterware.httpunit.WebResponse。 public void endXXX(
com.meterware.httpunit.WebResponse theResponse) { .... } 當您在Cactus中使用HttpUnit整合時,記得您的CLASSPATH中還必須包括httpunit.jar與適當的HTML剖析器,像是 tidy.jar。 |
|