You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Anatol Pomazau <An...@epam.com> on 2003/05/03 11:05:38 UTC
Unit test framework
I've just start to use unit tests for my aplications and I have a
questions (& topic for discuss) to developers (those who develop web
applications)
Q1) What unit test framework best suits for web application?
I've found 2 resembling frameworks HttpUnit and HtmlUnit - which
frw better and what differense between them.
Q2) Is anywhere analogues StrutsTestCase
(http://strutstestcase.sourceforge.net/) for Tapestry.
Q3) Where can I get examples of "real" unit testing, not only simple
praxis.
Sorry for my English and thx for future answers.
Sincerely,
Anatol Pomazau
<epam>
EPAM Systems, Minsk, Belarus
Re: Unit test framework
Posted by Dirk Olmes <di...@xanthippe.ping.de>.
Anatol Pomazau wrote:
> I've just start to use unit tests for my aplications and I have a
> questions (& topic for discuss) to developers (those who develop web
> applications)
Well, first of all make sure that you partition your app properly: model
code in its own classes, gui code just uses that. Then you can unit-test
your model with plain junit and there's not much left for testing the
gui (hopefully).
> Q1) What unit test framework best suits for web application?
> I've found 2 resembling frameworks HttpUnit and HtmlUnit - which
> frw better and what differense between them.
I stumbled over HtmlUnit just recently and had a quick look at it. I
worked with HttpUnit much more before and like it better.
Sidenote for those not knowing the two frameworks: HtmlUnit has an API
where you work with browser-like constructs (Buttons, TextFields etc.)
where HttpUnit works more like generating requests and getting
responses. HttpUnit can be programmed like HtmlUnit, though.
Personally, I like HttpUnit better. The fact that you can always get the
complete HTML Source of any page in the testing progress is a big
advantage over HtmlUnit.
For real testing convenience check out WebTest
(http://webtest.canoo.com). They built a layer on top of HttpUnit so you
can write your gui tests as a series of ant scripts.
HTH,
-dirk