Java Mailing List Archive

http://www.gg3721.com/

Home » user.jmock »

[jmock-user] jmock

Joshua Toepfer

2010-08-05

Replies: Find Java Web Hosting

Author LoginPost Reply
I have the following test:

public void test...() {

 final Story story = buildStory();

 context.checking(new Expecatations() { {
   one(databaseDao).persist(with(storyMatcher)); will(returnValue(story));
 } } );
}

public interface DatabaseDao {

Story persist(Story story);

}

Is there any way around defining an Story for the return? I wouldn't be so
worried but using hibernate's merge does not update the reference, but returns a
copy of the attached object.

so something like this...

...
 context.checking(new Expecatations() { {
   one(databaseDao).persist(with(storyMatcher)); will(returnReference());
 } } );
...

so that the returned object will be the object that is passed in to the persist
method?


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.