You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Dennis Byrne <de...@dbyrne.net> on 2006/02/21 06:20:59 UTC

Re: FactoryFinder.releaseFactories() - was [continuum] BUILD FAILURE: API

John,

Do you guys have anything fancy for ThreadLocal references of FacesContext?  Did you set this to null per TestSuite? per TestCase? per test method ?

Dennis Byrne

>-----Original Message-----
>From: John Fallows [mailto:john.r.fallows@gmail.com]
>Sent: Tuesday, February 21, 2006 12:07 AM
>To: 'MyFaces Development'
>Subject: Re: FactoryFinder.releaseFactories() - was [continuum] BUILD FAILURE: API
>
>fyi - IIRC we tackled this problem slightly differently in the ADF Faces
>codebase.
>
>In an effort to fully isolate anything that might be keyed by
>ContextClassLoader (including FactoryFinder internal state), we created a
>trivial wrapper ClassLoader to provide a unique ContextClassLoader in
>setUp() and restore it back to the original in tearDown().
>
>Kind Regards,
>John Fallows.
>
>On 2/20/06, Sean Schofield <se...@gmail.com> wrote:
>>
>> > The call is required in the setUp() method to make things work correctly
>> on
>> > the *first* test, when you have the MyFaces implementation in the
>> classpath
>> > of the tests.  Calling it in tearDown() doesn't hurt anything, but
>> protects
>> > test developers who try to subvert the JUnit test lifecycle stuff.
>>
>> Exactly.  I don't think its necessary in the teardown but it won't
>> hurt.  Its *defnitely* needed in the setup for the reason you
>> mentioned.
>>
>> > Craig
>>
>> Sean
>>
>
>
>
>--
>http://apress.com/book/bookDisplay.html?bID=10044
>Author: Pro JSF and Ajax: Building Rich Internet Components, Apress
>



Re: FactoryFinder.releaseFactories() - was [continuum] BUILD FAILURE: API

Posted by John Fallows <jo...@gmail.com>.
Hi Dennis,

On 2/20/06, Dennis Byrne <de...@dbyrne.net> wrote:
>
> Do you guys have anything fancy for ThreadLocal references of
> FacesContext?  Did you set this to null per TestSuite? per TestCase? per
> test method ?


Yes, IIRC there is a TestFacesContextFactory implicitly registered with the
FactoryFinder by controlling the ContextClassLoader.getResource(), and that
TestFacesContextFactory manages the ThreadLocal FacesContext reference to
make sure it gets cleaned up during FacesTestCase.tearDown().

Kind Regards,
John Fallows.

Dennis Byrne
>
> >-----Original Message-----
> >From: John Fallows [mailto:john.r.fallows@gmail.com]
> >Sent: Tuesday, February 21, 2006 12:07 AM
> >To: 'MyFaces Development'
> >Subject: Re: FactoryFinder.releaseFactories() - was [continuum] BUILD
> FAILURE: API
> >
> >fyi - IIRC we tackled this problem slightly differently in the ADF Faces
> >codebase.
> >
> >In an effort to fully isolate anything that might be keyed by
> >ContextClassLoader (including FactoryFinder internal state), we created a
> >trivial wrapper ClassLoader to provide a unique ContextClassLoader in
> >setUp() and restore it back to the original in tearDown().
> >
> >Kind Regards,
> >John Fallows.
> >
> >On 2/20/06, Sean Schofield <se...@gmail.com> wrote:
> >>
> >> > The call is required in the setUp() method to make things work
> correctly
> >> on
> >> > the *first* test, when you have the MyFaces implementation in the
> >> classpath
> >> > of the tests.  Calling it in tearDown() doesn't hurt anything, but
> >> protects
> >> > test developers who try to subvert the JUnit test lifecycle stuff.
> >>
> >> Exactly.  I don't think its necessary in the teardown but it won't
> >> hurt.  Its *defnitely* needed in the setup for the reason you
> >> mentioned.
> >>
> >> > Craig
> >>
> >> Sean
> >>
> >
> >
> >
> >--
> >http://apress.com/book/bookDisplay.html?bID=10044
> >Author: Pro JSF and Ajax: Building Rich Internet Components, Apress
> >
>
>
>


--
http://apress.com/book/bookDisplay.html?bID=10044
Author: Pro JSF and Ajax: Building Rich Internet Components, Apress