Shane Mingins wrote:

> My reply has taken just as long ... I am on leave at
> the moment with child #3 :-)

Enjoy, and good luck.

> To answer your questions:
>
> 1. What was my goal?
>
> It was a type of end to end test.  The test's point of
> entry was the InvestorWebService object.  I asked the
> InvestorWebService for a PersonDTO (a person is one
> investor type), modified it, and sent it to the update
> method on the InvestorWebService. 
>
> To check that this indeed worked as expected, in that
> all the tables in DB were updated as expected, I used
> DbUnit to assert that the tables matched XML datasets.

If you want to test this from end to end, and if Spring/Hibernate's
transaction setting is not allowing you to use automatic transaction
handling for this test as is, then I suppose you'll just have to begin
and end transactions explicitly in the test. I don't know how to do
that, but I don't see any other way.

In my opinion, if you want to test this from end to end, then you're not
testing enough of the application. I imagine that if you tested this
behavior through the application protocol -- using HTTPUnit, say -- then
you wouldn't have this transaction problem.

On the other hand, if you /really/ want to test an individual class, but
don't see how to do so in isolation, then we have more investigating to
do to get to that point, with a copy of "Working Effectively with Legacy
Code" at our side. :)

> 2.  Responsibilities
>
> The InvestorWebService is responsible for returning an
> investor as a DTO.  It uses a DAO object (this is
> instantiated using Spring) to retrieve an investor
> business object.  The DAO uses Hibernate to retreive
> the requested investor object.

InvestorWebService is a web service-based Repository for Investor
objects. Got it.

> Is that enough to start some discussion on your ideas?

You tell me. :)
--
J. B. (Joe) Rainsberger
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Predictable, repeatable, quality delivery

Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=315388.5529720.6602079.3001176/D=groups/S=:HM/A=2372354/rand=965066283


Yahoo! Groups Links

Reply via email to