Tony, Jonathan

I read something a few days ago that you were writing some templates for
junit testcases. I was thinking of the same and would like exchange some
ideas.
I had in mind that whenever I create a session bean, that each public method
of this bean should get a test method. Of course by far not suficient, one
method may already need many tests, but a good start to setup a project
structure. All sessionbeans should preferibly talk with the (client)
business delegate via data transfer objects. These data transfer objects are
usually not the same as the entity beans, but will be a combination of
entity data and other data needed in the sessionbean calculations. My best
guess would be to create the DTO classes in the uml diagram, give them a new
stereotype and create with a template the get-and-set methods. How the DTO
inside the sessionbean will be split/combined to entity bean value objects
is business logic to be filled in, cannot be generated in advance. But the
access to the sessionbean�s public methods should be possible.
Now comes the difficulty that I foresee: from the junit testcase one should
call the business delegate with the proper data objects. This could be
strings, ints, etc., but also objects that exist of objecst. How can these
be filled with initial values? My guess was to make a TestDataFiller class
that receives an object and by reflection scans the test values needed. The
junit testcases would then call this class to fill the public method with
the proper data.

What do you think?

Regards, Jan



Jan Kester
Marlborough Stirling Espa�a, S.L. Director de Inform�tica
Gran V�a 62, 10� izq
28013 Madrid
tel: +34-91-5487910
fax: +34-91-5400199
email: [EMAIL PROTECTED]



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Andromda-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to