myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Winer" <awi...@gmail.com>
Subject Re: FactoryFinder.releaseFactories() - was [continuum] BUILD FAILURE: API
Date Mon, 20 Feb 2006 06:20:12 GMT
Purely speaking, FactoryFinder.releaseFactories() should
only be necessary in tearDown() - which is where it makes
the most sense, since releasing factories is cleanup, which
is the job of tearDown().

Practically speaking, it's simplest and safest to call it
in both methods - which means that your test is
doing the right thing (by calling it in tearDown() to clean up
properly), and is guarding against other tests doing
the wrong thing (by calling it in setUp()).  If all tests
followed the rules, you'd only need to call it in one,
but you're better off not assuming that all tests will.

-- Adam

On 2/19/06, Craig McClanahan <craigmcc@apache.org> wrote:
>
>
>
> On 2/19/06, Dennis Byrne <dennis@dbyrne.net> wrote:
> > >I updated the Shale snapshots about half an hour ago... coincidence?
> > >Wendy
> >
> > This would have happened w/ or w/out your update.
> >
> > The fix for this was to put FactoryFinder.releaseFactories() in setup()
> and in tearDown() .  This setup() call is to clear configured Factory info
> from previous tests ( which taints the first test of the current running
> TestCase ).  The tearDown() call is to prevent interference w/ subsequent
> TestCases.
> >
> > In an offlist conversation, Sean and I recently came to the agreement that
> AbstractJsfTestCase should be calling FactoryFinder.releaseFactories() .
> This is important because AbstractJsfTestCase.setup() configures each
> Factory, and AFAIK, it was interfering w/ his tests, which were children of
> AbstractJsfTestCase.  Sean ended up putting this in
> AbstractJsfTestCase.setup(), probably for the same reason it needs to now go
> in some of ours.
> >
> > @ Sean or Wendy or Craig - can one of you please put
> FactoryFinder.releaseFactories() in AbstractJsfTestCase.tearDown() also ?
>
> In the current code, FactoryFinder.releaseFactories() is called at the
> *beginning* of the setUp() method.  Doesn't that make calling it in
> tearDown() redundant, because every test (including the first one) is going
> to call it as part of the setup process anyway?
>
> > Dennis Byrne
> >
> >
> >
> Craig
>
>

Mime
View raw message