Thanks for your help,

but in this particular case i have a lot of stuff in the application module
and i would like to avoid duplicating that code.

On Tue, Feb 24, 2009 at 2:29 AM, dhning <ningd...@gmail.com> wrote:

> What I do is, for test, to create a new application module almost the same
> as the one used in production, and then replace
> with mock dao if necessary. So the mock dao can be put in the test sources.
>
> Thanks!
>
> DH
>
>
> ----- Original Message -----
> From: "Hugo Palma" <hugo.m.pa...@gmail.com>
> To: "Tapestry users" <users@tapestry.apache.org>
> Sent: Tuesday, February 24, 2009 8:06 AM
> Subject: Providing service mocks for integration tests
>
>
> > I'm implementing my user interface tests using selenium and the provided
> > AbstractIntegrationTestSuite class. Everything is working fine.
> >
> > Still, i'd like to replace my DAO services implementation with some mock
> > ones when i run the tests. The problem is that the services are declared
> in
> > the application module so how do i override those declarations for
> testing
> > purposes ?
> > One workaround i found was to pass a VM parameter when i run the test
> goal
> > and then in the bind method implementation i check for the parameter and
> > declare either the prodution implementation or the mock one. Although
> this
> > works it forces me to implement the mock objects in the main sources and
> not
> > on the test sources where they should be.
> >
> > I was wondering if anyone had a better way to do this.
> > Thanks.
> >
>

Reply via email to