Re: T5: using TapestryTestCase

2008-01-17 Thread Howard Lewis Ship
Just invoke mailer.sendIt() while training your mocks, without an expect() call. Copious examples of this in the Tapestry code base. On Jan 17, 2008 6:06 PM, Angelo Chen <[EMAIL PROTECTED]> wrote: > > Thanks, that works. one related question: > > I have this: > > public interface Mailer { >

Re: T5: using TapestryTestCase

2008-01-17 Thread Andreas Andreou
Actually, take a look at some EasyMock tutorials (that's what's behind) i think their site has a few... Also, use: Mailer mailer = this.newMock(Mailer.class); expect(mailer.sendIt()).andReturn("done"); mailer.send(); On Jan 18, 2008 4:06 AM, Angelo Chen <[EMAIL PROTECTED]>

Re: T5: using TapestryTestCase

2008-01-17 Thread Angelo Chen
Thanks, that works. one related question: I have this: public interface Mailer { public void send(); public String sendIt(); } then somewhere in the test, i'd like to make sure send is called, but it can not passed to expect as the latter expects a object, any way to 'expect' a void

Re: T5: using TapestryTestCase

2008-01-17 Thread Igor Drobiazko
Mock the session and pass through to the constructor: Session session = newMock(Session.class); Service service = new Service(session); On Jan 17, 2008 8:14 AM, Angelo Chen <[EMAIL PROTECTED]> wrote: > > Hi, > > Is there any tutorial on using TapestryTestCase ? say, I'd like to test a > service

T5: using TapestryTestCase

2008-01-16 Thread Angelo Chen
Hi, Is there any tutorial on using TapestryTestCase ? say, I'd like to test a service which has Hibernate's Session injected thru constructor, any idea? Thanks, A.C. -- View this message in context: http://www.nabble.com/T5%3A-using-TapestryTestCase-tp14913469p14913469.html Sent from the Tapes