可选,当测试类继承ServletTestCase时用于指定Cactus Servlet Redirector的映射名称。默认:ServletRedirector
例:cactus.servletRedirectorName = ServletRedirector
cactus.jspRedirectorName可选,当测试类继承ServletTestCase时用于指定Cactus Jsp Redirector的映射名称。默认:ServletRedirector
例:cactus.jspRedirectorName = JspRedirector
cactus.filterRedirectorName (For J2EE API 1.3 only)可选,当测试类继承ServletTestCase时用于指定Cactus Filter Redirector的映射名称。默认:ServletRedirector
例:cactus.filterRedirectorName = FilterRedirector
Cactus.properties你可以放置在WEB-INF/classes/下。
web.xml
在web.xml里要为相应的测试类指定相应的Cactus Redirector。
ServletTestCase对应org.apache.cactus.server.ServletTestRedirector
JspTestCase对应/jspRedirector.jsp
FilterTestCase对应org.apache.cactus.server.FilterTestRedirector
<web-app>
<filter>
<filter-name>FilterRedirector</filter-name>
<filter-class>org.apache.cactus.server.FilterTestRedirector</filter-class>
</filter>
<filter-mapping>
<filter-name>FilterRedirector</filter-name>
<url-pattern>/FilterRedirector</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>
文章来源于领测软件测试网 https://www.ltesting.net/