Hi All,
I've got the first of the EasyMock (http://www.easymock.org) tests in
place. I have not commited the changes because I wanted to get
everyone's opinion before introducing a new dependency. There are 4
new jars required to use easymock, ams.jar, cglib.jar, easymock-
classextensions.jar and easymock.jar. The cglib and ams dependency
are used to mock abstract classes (the default easymock.jar is able
to mock interfaces without cglib or ams).
With the EasyMock framework I was able to get to 100% code coverage
of the abstract StateManager class with 5 tests and less than 125
lines of actual test code. I'm a fan and have used it extensively on
other projects. I believe the extra dependencies are worth it to get
the testing done.
As soon as there is consensus I'll commit the changes to build.xml
and the actual test code (or by tomorrow afternoon or so assuming
that a lack of comment is agreement) then move on to the cactus test
stuff.
Sean: I'll try a couple of different approaches to the build and post
in the form of a proposal, so your feedback to that thread will be
most useful :-)
TTFN,
-bd-
On Jul 20, 2005, at 1:39 PM, Bill Dudney wrote:
Hi Grant,
Thanks for your interest in the testing stuff.
Sorry I've not committed the cactus stuff yet. I need to get my
thoughts together in an new thread that Sean can comment on because
there will be additional build stuff in place (cargo to start/stop
containers, packaging a new war file to distribute the cactus tests
in etc.) and I want the changes to fit with Sean's continued vision
of the build process.
In the mean time we could use mock objects. Although the class you
refer to (ServletFacesContextImpl) is particularly hard to test
because the lack of default config setup that happens during out of
container testing.
I have a test for the Factory that could be used as the starting
point of a factory setup so that the rest of the required stuff
could be mocked for the facescontext impl. I will get that checked
in asap (SVN appears to be down again).
TTFN,
-bd-
On Jul 20, 2005, at 11:36 AM, Grant Smith wrote:
Bill,
The current testing setup is great for objects that are container-
independent. Any indication when we'll be able to test things that
need to live in a container, like FacesContextImpl ? I assume
we'll need cactus for that, although if you know of any tricks to
test container-dependent objects, that would be valuable
information :)
Another question for cactus gurus: is cactus portlet friendly ?
Thanks,
Grant