--- "J. B. Rainsberger" <[EMAIL PROTECTED]> wrote:

> First, I apologize for taking this long to get to
> this message.
>
> Shane Mingins wrote:
>
> > Our app is a Swing client calling WebServices
> running in WebSphere.
> > The Webservices uses a DAO object which extends
> the
> > HibernateDaoSupport class provided by the Spring
> framework.
> >
> > Now according to the contractor, the way we have
> the transaction
> > manager setup in our applicationContext.xml file
> > using "PROPAGATION_REQUIRED" for our
> get/save/update/delete
> > operations means that the "commit" of the
> transaction will only occur
> > when the starting method is finished.
> >
> > So if we were to create a JUnit test:
> >
> > public void testUpdate()
> > {
> >         InvestorWebServices iws = new
> InvestorWebServices();
> >         InvestorDTO identity =
> iws.getInvestorByPK(new Integer
> > (7000011));
> >         identity.setName("Bob);
> >
> >         iws.updateInvestor(identity);
> > }
> >
> > He is telling me that the commit to the Db will
> not have happened
> > until the testUpdate method has completed.
> >
> > As part of the test we want to be able to assert
> that the record in
> > the db has indeed been updated so in our current
> situation we could
> > not do that within the testUpdate method.
>
> What is your goal here? Are you trying to test end
> to end? Are you
> trying to test your integration with some part of
> the framework? Is this
> a Learning Test?
>
> What are you afraid is broken right now?
>
> > I was wondering if anyone with more experience
> than us is doing
> > similar testing with Spring/Hibernate and how are
> the doing such
> > testing?
>
> I have no experience, but I have ideas. You said
> that you want to verify
> that data makes it to the database. Who's
> responsible for making sure
> the data gets into the database? (Your code?
> Hibernate? WebSphere?) If
> you still need to/want to solve this problem, then
> I'd like to start by
> establishing who has which responsibilities.
> --

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

I left the original msg unsnipped for reference.

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.

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.

The InvestorWebService is responsible for updating an
investor from a passed DTO.  It uses a DAO object
(this is instantiated using Spring) to update an
investor business object.  The DAO uses Hibernate to
update the requested investor object.

Hibernate ultimately updates the database.

Is that enough to start some discussion on your ideas?

Cheers
Shane





=====

Shane Mingins

[EMAIL PROTECTED]

please remove clothes before emailing


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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=267217113


Yahoo! Groups Links

Reply via email to