myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Dudney <bdud...@mac.com>
Subject Re: [proposal] use EasyMock for mocking
Date Thu, 21 Jul 2005 11:27:33 GMT
The dependency will only be at development time.

I've added them to the 'download-dependency' target in the build.xml  
file so you won't even have to know they are there :-)

TTFN,

-bd-

On Jul 21, 2005, at 5:23 AM, Manfred Geiler wrote:

> +1
>
> dependencies for test compiling are ok, as long as there is no need to
> add them to our bin-releases!  :-)))
>
> -Manfred
>
>
> 2005/7/21, Bill Dudney <bdudney@mac.com>:
>
>> 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
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>


Mime
View raw message