myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Dudney <bdud...@mac.com>
Subject cactus tests and debugging...
Date Wed, 28 Sep 2005 01:31:56 GMT
Hi All,

Most of you have probably see the fast and furious emails going on  
about issue #623. I wanted to drop you a quick note on how to debug a  
failing cactus test.

First you need to have tomcat setup to run in debug mode and then  
attach to it via your IDE. That process is explained in an old post  
on my blog;

http://bill.dudney.net/roller/page/bill/20040210

the content is a bit dated but it works like a champ for tomcat 5.5.9.

Once you are connected to tomcat running in the debug-able vm you can  
set breakpoints in the server side code (such as ValueBindingImpl for  
bug #623) and merrily debug away with a quick simple means to repeat  
the buggy code (i.e. no more wading through a JSP to invoke the buggy  
code). You can run the cactus tests in Eclipse as JUnit tests so it  
appears that everything is happening right in eclipse but half of the  
code is running on the server.

You have to deploy the cactus tests into your running version of  
tomcat for all this to work. I was thinking of adding build stuff to  
accomplish that as well if there is enough interest. In the mean time  
you can simply startup tomcat as described in the blog post and copy  
the cactus-app.war file into the auto deploy directory (usually  
webapps) then connect Eclipse to the debug-able jvm running tomcat  
(also described earlier in the blog post). You also need to specify  
the following property;

cactus.contextURL=http://localhost:8080/cactus-app

You can specify this in your launch specification in Eclipse or  
create a cactus.properties file in the Eclipse output folder (where  
the projects compiled classes end up). The file should contain a  
single line defining cactus.contextURL. Cactus will look for this  
property either specified on the command line or in a file called  
'cactus.properties' in the class path so either way will work. I find  
it easier to manually create the file in the Eclipse output directory  
but do what you like :)

Anyway I should probably put this on the Wiki but its too manual IMO  
right now. If there is enough interest I'll generalize it so that you  
can deploy the cactus tests from the build file.

TTFN,

-bd-

Mime
View raw message