Hi Marcelo,

> -----Original Message-----
> From: Marcelo R�mulo Fernandes [mailto:marcelo@;neus.com.br]
> Sent: 01 October 2002 02:23
> To: [EMAIL PROTECTED]
> Subject: Problems with Cactus + Ant
> 
> Hi,
> 
>     I've adapted the sample servlet build scripts that comes with
> cactus  to test my application. It works, but I've got two problems:
>     1 - Every time I run the test, I must restart the server
> application. Is it necessary?

No. The runservertests ant tasks supports already running servers.

>     2 - If I run the tests by "JUnit 3.7 by Kent Beck and Erich Gamma"
> swing, it's ok with release jakarta-cactus-13-1.3. However, if I use
> release jakarta-cactus-13-1.4.1, I got the following error:
>       junit.framework.AssertionFailedError: Exception in constructor:
> testTeste (org.apache.commons.logging.LogConfigurationException:
> java.lang.ClassCastException
>         The  works ok.

[snip]

Yes, please see the cactus FAQ:
http://jakarta.apache.org/cactus/faq.html#faq8

>     3 - If I run tomcat by myself before running the tests, it's ok.
But
> if I run tomcat from ant, I got the following error:

The scripts provided by cactus are just examples. You need to adapt them
to what you want to do. The only thing I can think of is that:

    <target name="start.tomcat.40">

        <java classname="org.apache.catalina.startup.Bootstrap"
fork="yes">

            <jvmarg value="-Dcatalina.home=${tomcat.home.40}"/>
            <jvmarg value="-Dcatalina.base=${target.tomcat40.dir}"/>
[...]

is using an ant property called target.tomcat40.dir and if you haven�t
defined it before you run start.tomcat.40 it will fail ...

So running "ant prepare.test.tomcat.40 start.tomcat.40" should work. But
again, you need to understand what you are doing as it depends on what
you want to achieve.

You could also try the Cactus plugin for Maven which is great in that it
hides everything and make the whole process automatic and transparent
(http://jakarta.apache.org/turbine/maven/reference/plugins/cactus).

Hope it helps,
-Vincent



--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@;jakarta.apache.org>

Reply via email to