Hi Charlene,

My answers below are based on Cactus 1.4.1.

> -----Original Message-----
> From: Charlene Mitchell [mailto:charlene_ml@;yahoo.co.uk]
> Sent: 04 November 2002 15:14
> To: [EMAIL PROTECTED]
> Subject: running from Ant
> 
> Hi,
> 
> I've read the docs (and the previous replies), and
> I've set up the ant task (especially referring to:
> howto_ant_cactus.html).
> Deployed I have a war file containing the specified
> lib files, the web.xml file and my single Cactus Unit
> Test Case (also, of course, I have my application
> deployed in a separate ear file).
> 
> Can someone just confirm that the following classpath
> thinking for the Ant/JUnit task is correct (ie -not-
> what is deployed in the war):
>   * I have to include a cactus and log_client property
> file

The cactus.properties is optional and you can pass Cactus properties as
JVM parameters (-D). See the config howto on the web site.

The log_client properties (and same for log_server) is optional too. It
is only needed if you wish a) to have cactus logs and b) to override the
default logging configuration (which is in the cactus jar). The config
howto should also help you here.

>   * I have to include my Test Case (even though it's
> deployed in the war)

Your test case is run *both* on the client side(for the beginXXX() and
endXXX() methods) and on the server side (for the testXXX() methods). So
yes, it has to be in your client side classpath.

Have you had a look at the Classpath Howto? If something is not clear
(which is very likely) there please tell us and we will fix it.

>   * this means I have to include my application code
> (e.g. home and remote) - else the test can't run

You have to put in the client classpath anything that's needed to make
your class run on the client side. Usually this means the classes under
test and any external jar that these classes use.

>   * this in turn wants me to include the Application
> Server client classes

yep

> 
> Is the above assumption right? (if I do not do all
> this then I cannot get the test to even begin).

yes

> 
> Because there are 2 identical Cactus Unit Test cases
> (one in the JUnit task classpath, the other deployed),
> where do I specify the username/password as mentioned
> in your previous e-mail?
>  request.setAuthentication(new FormAuthentication(
>     System.getProperty("uid"),
> System.getProperty("pwd")));

This code goes in beginXXX(). Thus it is executed on the client side.

> Is this picked up from the Application Server or from
> the Ant task?

Neither. This is picked up by your cactus test case code. The JVM
parameters are sent by you in your ant script (using a <jvmarg> tag if I
remember correctly).

> 
> Even if I hardcode it in the test I'm getting an
> authentication exception that principal = null.

Show us how you pass the JVM system properties to your test case. That's
probably where the problem lies.

I would suggest you quickly read the "How it works" page on the cactus
web site which explains how cactus works. The only hard part is
understanding that there is a client side and a server side (and what
gets executed on both sides).

Hope it helped,
Cheers,
-Vincent

> 
> Thanks
> 
> Charlene
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:cactus-user-
> [EMAIL PROTECTED]>



--
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