Sunday, June 22, 2008

Redeploying cactus tests in JBoss

I am experimenting with Cactus in JBoss AS.
(I am using Cactus 1.8.0 and JBoss 4.2.2.GA)

According to the Cactus documentation, there are two ways to deploy your cactus tests:
  • Deploy the cactus jars globaly in your application server and deploy your derived ServletTestCase-Tests with your application.
  • Deploy the cactus jars together with your application.

  • (this documentation refers to tomcat deployment ...)

    I tried to go with the first method, but it didn't work:
    After the first deployment everything ran fine, triggering the ServletTestRunner resulted in a nice report showing the test results.
    But then I changed my tests, redeployed the application and hit the ServletTestRunner again... but nothing changed. The resulting report was still showing the results of the previous deployment.

    When I restarted JBoss, the actual report was shown. But redeploying the app did not update the report.

    So I changed to method two from above and removed the cactus jars from the global JBoss libraries and packaged them into my app (that's what the cactify-ant-task is for anyway).
    After that everything was fine. Redeploying the app resulted in a up-to-date report when hitting the ServletTestRunner.

    My guess is, that the result of the ServletTestRunner is cached if this servlet is deployed globally...?

    Probably there is another way to solve the problem while having the cactus jars deployed globally, but the solution works for my needs...

    The only resource I found on the net was this.

    1 comment:

    1. Hi,
      Nice article. I am trying to deploy and run cactus tests an JBoss 4.x. Could you please post the required JBoss deployment related configurations that are to be made.



    Related Posts Plugin for WordPress, Blogger...