I would agree with the "smell" idea about testing Actions..  I find them
difficult to test even with Cactus because of all the parameter setup
required.

I love POJO objects, and that is why I am very excited about Hibernate.
Previously, Torque and testing actons seemed the way life was..  But now
with Hibernate and POJO database objects, my directory structure is moving
towards this:

om/                             Where my POJO objects mapped onto database
are
om/persist              Various hibernate "Managers" that wrap all my calls
to the database.  Also frequently called "DAO" objects I believe.

modules/actions         Where my actions are
bizobj/                         Where my business objects taht take om/ POJO
objects and process them.

My question for Jeff, I work with lots of very database centric objects, and
I hate creating a ton of test objects..  Instead, I use DBUnit, create a
test set of data, and then interface with a real database to get my POJO's
to test..  How does that strike you?  How much defining of test objects do
you have to do?  I guess this more impacts the testing of bizobj classes
wthat need good solid data objects to manipulate..

Hope I am being clear...,
Eric Pugh

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 3:29 PM
To: Turbine Users List
Subject: Re: Testing -- Cactus v EasyMock



We've used mock objects, via easy mock for testing.  Instead of cactus,
we just use junit and startup turbine in standalone mode for some of
our tests.  But, I really try to avoid using either of these
techniques if possible, they are slow and I consider them deep in my
bag of testing tricks.  We try to write plain old java objects, tested
with junit.  Fast, simple, easy.  I've been starting to consider the
urge to test actions a 'code/design smell'.  I try to write actions and
my pull tools so simple that they don't need to be tested.  Mostly
they delagate to a POJO with ample tests.

Now for functional ( customer ) tests we've been using FitNesse, the FIT
framework, and jwebfit ( which uses jwebunit, which is a nice api
around httpunit ).  This flexes the entire application, from the
outside ( user's perspective ) and all the integration details.  The
FIT framework can do more that test from the outside, but that was the
easiest place for us to start.

fitnesse.org
fit.c2.com
jwebunit.sf.net

Before FIT, we used straight httpunit for our customer tests, worked
fine, but non-programmers couldn't easily change or write tests as
they potentially can with fit.

>>>>> On Thu, 29 May 2003 12:39:32 -0400, [EMAIL PROTECTED] said:

> Brian, I would argue that Maven is the way to build turbine based
> apps..  It makes life much easier, things like cactus integration is
> provided "out of box"..


> Having said that, there are things I would like to use Mock objects
> for, like testing sending emails, without actually sending them.
> With cactus tests, I spam everybody with my email tests!

> Would you be willing to add to the wiki on EasyMock?  Of share how
> you did it?

I started a application testing page way back here:
http://jakarta.apache.org/turbine/tdk/application-testing.html Maybe
it would make more sense to add to that?

> Sincerely, Eric Pugh

> -----Original Message----- From: brian janaszek
> [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29,
> 2003 11:59 AM To: [EMAIL PROTECTED] Subject: Testing
> -- Cactus v EasyMock


> Howdy

> I'm looking into a testing framework for a web app that's currently
> in the design phase, and right now the choices have been narrowed
> down to Cactus and EasyMock.  I've read through the comparision
> document on the Cactus site, and I've attempted to write some simple
> tests in both frameworks, and here's where I am right now:

> Setting up Cactus to work with Turbine is a pain.  We're not using
> Maven, so I've been trying to tweak the configuration to get the
> tests running, but I haven't had much success.  The HOWTO on the
> wiki was very helpful in writing my test case, but I'm still feeling
> a little lost trying to configure Cactus.  Has any further work been
> done to integrate Cactus with the TDK?  I've been trying to search
> the list, but one of the archive links doesn't work for me
> (www.mail-archives.com) and the other (archives.apache.org) often
> has problems when searching.

> Is anyone using EasyMock with much success?  I've gotten much
> further along with EasyMock, but it obviously has a bit more coding
> overhead for the tests.  But otherwise, it seems to be a good choice
> for testing screens and actions (and I'd assume I could also use it
> to test my OM/Torque layer as well).

> What framework have people had the best luck with?

> TIA bmj


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]

-- 
=====================================================================
Jeffrey D. Brekke                                   [EMAIL PROTECTED]
Wisconsin,  USA                                     [EMAIL PROTECTED]
                                                    [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to