Creating the cactus.properties File
Problem
You are
setting up your Cactus environment and
need to create the cactus.properties file.
Solution
Create a file called cactus.properties and place
it on the client classpath.
Discussion
Cactus uses a Java properties file called
cactus.properties to specify client-side
attributes needed to successfully execute your tests. This file must
be located on the client classpath, and simply tells Cactus the web
context of your test application and the redirector values. The
redirector values are URL patterns used in the deployment descriptor
that point to a particular Cactus redirector proxy.
Here’s an example of the
cactus.properties file:
cactus.contextURL=http://localhost:8080/xptest cactus.servletRedirectorName=ServletRedirector cactus.jspRedirectorName=JspRedirector cactus.filterRedirectorName=FilterRedirector
Here’s the corresponding deployment
descriptor
web.xml file:[36]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<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> ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access