Hi Erik,
Chalk this up to a lack of thoroughness. I had run TestSampleServlet but
never had run TestSampleServletConfig or any of the test classes in the unit
package. Once I got TestSampleServlet running, I had dived into my own test
classes.
To get TestSampleServletConfig running, change test.webapp to define
ServletRedirector this way:
<servlet>
<name>ServletRedirector</name>
<description>Cactus Testing ServletRedirector</description>
<code>org.apache.commons.cactus.server.ServletTestRedirector</code>
<servlet-path>/ServletRedirector</servlet-path>
<autostart>false</autostart>
<init-parameter>
<name>param1</name>
<value>value1 used for testing</value>
</init-parameter>
</servlet>
As you can tell, this doesn't conform to the Servlet 2.2 web application
deployment descriptor. If it did, it would be init-param (plus a lot of
other element name changes). To get this working, you must have also added
the Servlet API Classes project to your resources. Otherwise, you would
have been getting "Failed to invoke suite():java.lang.NoClassDefFoundError".
I also can't get TestJspTestCase to work. I'm getting
"java.io.FileNotFoundException: http://localhost:8080/test/JspRedirector".
The url comes from cactus.properties. It looks like the <code> element used
to define the jsp page in test.webapp doesn't work. In the Servlet 2.2 API,
this should be <jsp-file>. Like init-param, jsp-file isn't supported.
Unfortunately, I haven't been able to find what the Websphere/WTE equivalent
is, if there is an equivalent. If I find it, I'll let you know.
Vincent -- two more changes to the tutorial.
- In step 3, change test.webapp to define ServletRedirector as above.
- In step 4, add to the classpath list "{VAJava
dir}\ide\project_resources\Servlet API Classes\;"
Thanks. I'll let you know if I can find a solution that gets
TestJspTestCase working.
Todd
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 11:20 AM
To: [EMAIL PROTECTED]
Subject: RE: Cactus in VAJ3.5 and WTE
Thanks Todd!
I had test.jsp in test/web as opposed to test/web/test. This got
TestSampleServlet to give me a happy green bar.
My TestSampleServletConfig still has the same problem I describe below....
I don't know how to set up initialization parameters in test.webapp.
And TestJspTestCase gives me another fail with
java.io.FileNotFoundException: http://localhost:8080/JspRedirector. Any
ideas what this could be now that I have TestSampleServlet passing?
Thanks again Todd.
Erik
Erik Howell
CAP Gemini Ernst & Young US, LLC
[EMAIL PROTECTED]
312-879-3351