You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Nick Phillips <Ni...@stonebow.otago.ac.nz> on 2003/12/11 20:30:31 UTC

Testing

Just wondering whether anyone here has any cunning ways of unit testing 
code
that uses the various Apache:: modules; the only vaguely useful thing 
I've
managed to find so far is Apache::FakeRequest, but that still leaves 
problems
with code that uses Apache::Request, Apache::Cookie etc.

Surely *someone* has done it before?...



Cheers,


Nick
-- 
Nick Phillips / +64 3 479 4195 / nick.phillips@stonebow.otago.ac.nz
# these statements are my own, not those of the University of Otago


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Testing

Posted by andrew dunn <an...@luibh.com>.
> Effectively testing web apps without messing around with parsing HTML 
> is something I've been wondering about for a while.  Anyone solve 
> this problem well?

Not sure if this falls into your parsing HTML category or not but I've
found it to be quite comprehensive when it comes to testing web front
ends from within Perl:
http://search.cpan.org/dist/HTTP-WebTest/

-- 
Luibh.com
E: support@luibh.com
W: http://www.luibh.com

Web Hosting and Development.


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Testing

Posted by Andrew Hurst <hu...@llnl.gov>.
At 8:30 AM +1300 12/12/03, Nick Phillips wrote:
>Just wondering whether anyone here has any cunning ways of unit testing code
>that uses the various Apache:: modules; the only vaguely useful thing I've
>managed to find so far is Apache::FakeRequest, but that still leaves problems
>with code that uses Apache::Request, Apache::Cookie etc.
>
>Surely *someone* has done it before?...

On a related note, I've been wondering if its even necessary to unit 
test web applications.  At least the display part.  You'd essentially 
be testing if the data you put into the page actually got there.  Or 
that it got saved correctly to the database/file/etc.  Sounds 
suspiciously like testing getters and setters to me.

Does anyone 'screen scrape' their output HTML to test their code?  I 
would think it would be much easier/effective to just test the data 
before its passed to tt2 or your templating system of choice.  Or 
maybe for testing just set up templates to dump the raw variables 
passed in as a perl data structure, and have your test suite read 
those from the web page and check for the correct values.

Effectively testing web apps without messing around with parsing HTML 
is something I've been wondering about for a while.  Anyone solve 
this problem well?

-Andrew



-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Testing

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> http://search.cpan.org/search?query=Apache+testing&mode=all
> 
> http://search.cpan.org/~geoff/Apache-Test-1.06/
> 
> http://perl.apache.org/docs/general/testing/testing.html
> 

there's also

http://www.perl.com/pub/a/2003/05/22/testing.html

which might help as well.  and while it's not nearly as good as being there,
here are some slides from my talks at OSCon and ApacheCon:

http://www.modperlcookbook.org/~geoff/slides/ApacheCon/2003/apache-test-printable.ppt.gz

--Geoff


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Testing

Posted by Alexandre Dulaunoy <ad...@foo.be>.
On Fri, 12 Dec 2003, Nick Phillips wrote:

> Just wondering whether anyone here has any cunning ways of unit testing 
> code
> that uses the various Apache:: modules; the only vaguely useful thing 
> I've
> managed to find so far is Apache::FakeRequest, but that still leaves 
> problems
> with code that uses Apache::Request, Apache::Cookie etc.
> 
> Surely *someone* has done it before?...

http://search.cpan.org/search?query=Apache+testing&mode=all

http://search.cpan.org/~geoff/Apache-Test-1.06/

http://perl.apache.org/docs/general/testing/testing.html

-- 
-- 	  	     Alexandre Dulaunoy (adulau) -- http://www.foo.be/
-- 	   http://pgp.ael.be:11371/pks/lookup?op=get&search=0x44E6CBCD
-- 	   "Knowledge can create problems, it is not through ignorance
-- 				  that we can solve them" Isaac Asimov




-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html