View Full Version : Testing Services
chenrici
Nov 1st, 2004, 04:38 AM
What is the recommended way to test Domain level Classes in a Servlet, which are used as main Entrypoints for Service Facades (Hessian, Axis)?
Is it necessary to bother with for example Cactus?
Rod Johnson
Nov 1st, 2004, 04:42 AM
There are very few situations in which I would use Cactus.
I would go for the following types of testing for your objects:
1. True unit testing. Does not involve any container. Just JUnit, with mock objects or stubs.
2. Integration testing in a Spring container but not in a web container. This is fast, and skips the deployment step. See the superclasses in the org.springframework.test package in the mock JAR shipped with Spring. You can even have the superclasses create and rollback transactions if you like. With appropriate design, you can use virtually the same Spring XML config as in the deployed app.
3. Test your remote entry points remotely, against a deployed app, using a remote client.
Rgds
Rod
chenrici
Nov 1st, 2004, 07:13 AM
2. was the missing link for me.
Just Tried it out. Really Cool.
This makes "easy" to test the domain layer independently of any appserver and/or webcontainer.
Thanx.
Christoph
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.