Cactus Frequently Asked Questions
This FAQ is complementary to the
one located on the Cactus web site. The idea is that this FAQ is fed by Cactus users and from time to time we will take FAQ entries here and move them to the Cactus web site.
If you do not see your question below, you may want to first ask it on the
cactus-user email list. There will be a much quicker response time. Then, after you get an answer, come back to this page and add it to the list for future reference.
Some frequently asked questions (FAQs):
|
Question |
Answer |
|
How do I call Cactus from Ant? |
Please see |
|
Why would I use Cactus rather than JUnit? |
Use Cactus when you want to test Servlets, JSPs or anything that needs to run within a servlet container. Use JUnit for anything else(!) |
|
I'm using Cactus to test a servlet. Can I test multiple methods of the servlet in one test-case class? Also, it seems that after I run the test-case, the connection(s) to the container remain open, eventually blocking subsequent connection attempts when I try to run the tests again. How can I stop this happening? I'm using Ant & JBoss 3.2. |
<insert answer here> |
|
Where are the Eclipse integration downloads? |
The Eclipse plugin has been removed. Please see the note on |
|
I am not using a J2EE distro to run my Tomcat 5 server, just J2SE. Which version of Catus do I download? |
Tomcat 5 implements versions 2.4 and 2.0 of the Servlet and JSP specs respectively. These are part of J2EE 1.4 (for which Cactus does not have a specific distribution). However, you should be able to use the Cactus distribution targeted at J2EE 1.3 successfully for most tests. - NicholasLesiecki |
|
When using the <cactifywar> and/or the <cactus> task I get a java.lang.NoClassDefFoundError: org/apache/xml/serialize/OutputFormat |
These tasks require the Xerces jar to be present in the Ant classpath. Ensure that the Xerces jar is present in your ANTHOME/lib directory and if you're running it under Eclipse, ensure that it is in the Ant runtime CP (Window|Preferences|Ant|Runtime and then in the Classpath tab. - VincentMassol |
|
How can I transform resulted xml-style report to HTML one on the server side? |
You must place style-sheet in you web-content directory and add the following init parametr to ServletTestRunner in you cactus-web.xml <init-param><param-name>xsl-stylesheet</param-name><param-value>cactus-report.xsl</param-value></init-param> |