You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Scott Morgan <mo...@gmail.com> on 2005/02/22 17:49:08 UTC

How to test ?

Hi,

I've recently started using tapestry.  Impressive so far.  

The only problem I'm having is how to test the page classes.  I've
found Howard's AbstractInstantiator which is helpful to get around the
abstract class problem.  But I'm unsure how to test validation.

I've been looking Tapestry in Action which is a pretty good read, but
I cannot believe that there are only 2 pages (out of 500+) that
mention testing, and these don't really go into any detail.

Anybody have some examples?

thanks in advance
scott

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to test ?

Posted by Per Olesen <po...@nordija.com>.
On Thursday 24 February 2005 09:57, David Leangen wrote:
> I have been waiting a bit before replying, just to see if anybody else had
> any comments.

We've also had problems testing pages as there is so much to mock. Tapestry is 
very good to use interfaces which should make it easy to mock, but there 
seems to be very much mocking to be done as there is so many interfaces with 
so many methods.

We also tried inheriting the pages and test through that, but it proved to be 
hard to test, as Tapestry does a lot of setup work runtime when a request 
comes in. Naturally, that is one of the reasons we like Tapestry, that it 
does all this for us at submit. But it also makes it quite hard to unit test.

Instead, we started using jwebunit (http://jwebunit.sourceforge.net/) to test 
the pages as a webclient. This is a different kind of testing, as it tests 
real functionality and integration instead of the unit testing of pages. But 
it works quite well.

> I, too, am very interested in this topic. Does anybody have any practical
> examples that they could show? Or, is there a detailed wiki page or
> something that could help me get started with Tapestry testing?
>
>
> Are there others on the list who are also interested in this topic?

Very much so! We've also tried the AbstractInstantiator, but it really does'nt 
help us that much.

A nice thing would be to have a real unit testing helper class, which 
fakes/mocks some of all the processing that Tapestry performs at submit. A 
little like StrutsTestCase (http://strutstestcase.sourceforge.net/) do for 
struts. It can fake input parameters, URLs etc. to make it look like a submit 
was performed.

I guess this would require calling code deep inside Tapestry; the code that 
actually does all the plumbing when a submit occurs into Tapestry at runtime. 
I do not know if this can be easily reused in such a testcase. Anyone here 
fluid enough in the Tapestry sources to give a clue about if this can be 
done? This should be based in the 3.1 sources should it not?

/Per

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: How to test ?

Posted by David Leangen <dl...@canada.com>.
I have been waiting a bit before replying, just to see if anybody else had
any comments.

I, too, am very interested in this topic. Does anybody have any practical
examples that they could show? Or, is there a detailed wiki page or
something that could help me get started with Tapestry testing?


Are there others on the list who are also interested in this topic?



Cheers,
David




> -----Original Message-----
> From: Daniel Daniel [mailto:hotmailwork@hotmail.com]
> Sent: 23 February 2005 08:51
> To: morgandev@gmail.com
> Cc: tapestry-user@jakarta.apache.org
> Subject: RE: How to test ?
>
>
> Hi Scott,
>
> As for the page components I have created and inner class to
> extend the page
> object and then used that for testing.
>
> The other part of the testing has been using was using httpUnit
> to automate
> movements around the application while it is running. This can be a bit
> finicky at times but it also has been a good indicator of bugs.
>
> Cheers,
> Daniel
>
>
>
> >From: Scott Morgan <mo...@gmail.com>
> >Reply-To: Scott Morgan <mo...@gmail.com>
> >To: tapestry-user@jakarta.apache.org
> >Subject: How to test ?
> >Date: Tue, 22 Feb 2005 10:49:08 -0600
> >
> >Hi,
> >
> >I've recently started using tapestry.  Impressive so far.
> >
> >The only problem I'm having is how to test the page classes.  I've
> >found Howard's AbstractInstantiator which is helpful to get around the
> >abstract class problem.  But I'm unsure how to test validation.
> >
> >I've been looking Tapestry in Action which is a pretty good read, but
> >I cannot believe that there are only 2 pages (out of 500+) that
> >mention testing, and these don't really go into any detail.
> >
> >Anybody have some examples?
> >
> >thanks in advance
> >scott
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>
> _________________________________________________________________
> Searching for that dream home? Try
> http://ninemsn.realestate.com.au  for
> all your property needs.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: How to test ?

Posted by Daniel Daniel <ho...@hotmail.com>.
Hi Scott,

As for the page components I have created and inner class to extend the page 
object and then used that for testing.

The other part of the testing has been using was using httpUnit to automate 
movements around the application while it is running. This can be a bit 
finicky at times but it also has been a good indicator of bugs.

Cheers,
Daniel



>From: Scott Morgan <mo...@gmail.com>
>Reply-To: Scott Morgan <mo...@gmail.com>
>To: tapestry-user@jakarta.apache.org
>Subject: How to test ?
>Date: Tue, 22 Feb 2005 10:49:08 -0600
>
>Hi,
>
>I've recently started using tapestry.  Impressive so far.
>
>The only problem I'm having is how to test the page classes.  I've
>found Howard's AbstractInstantiator which is helpful to get around the
>abstract class problem.  But I'm unsure how to test validation.
>
>I've been looking Tapestry in Action which is a pretty good read, but
>I cannot believe that there are only 2 pages (out of 500+) that
>mention testing, and these don't really go into any detail.
>
>Anybody have some examples?
>
>thanks in advance
>scott
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>

_________________________________________________________________
Searching for that dream home? Try   http://ninemsn.realestate.com.au  for 
all your property needs.


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org