This aproach does not test deployment descriptors. I've had quite a few problems with missing ejb-ref, resource-ref, etc. What is especially bad is that you do not know if your deployment descriptor has a problem until you actually try to execute line of code that uses missing resource.

Demyanovich, Craig - Apogent wrote:
Jim,

I currently do not unit test either Entity or Session Beans.  Entity Beans
are trivial to write, and I trust that the application server will persist
them as advertised.  To unit test Session Beans would require that they be
deployed.  Since deployment complicates unit testing and complicated or
difficult unit tests suggest that the design could be done
differently/better, I design Session Beans to be controllers of a number of
collaborating objects.  These objects are simply business objects that
encode the business logic of the system.  Since they are plain Java classes,
I can unit test them very easily.

Consider a message-driven bean.  As I generally design them, MDBs receive a
message, hand it to a parser, hand the results of parsing to other objects
that do something with the message contents, hand the results of that work
to a communictator, which knows how to send the final results where they
need to go.  So, I don't test any part of the MDB; rather, I test the
various collaborating business objects.  If I'm confident that they all
behave as expected, I'm confident that they will also do so when they
interact via one another's interface.

Hope that helps,
Craig
--
Igor Fedorenko
Think smart. Think automated. Think Dynamics.
www.thinkdynamics.com



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to