My point was that it was possible the IoC was being re-initialized on
each test and it wasn't noticeable because its very fast.

On Thu, Dec 4, 2008 at 12:39 PM, Christian Edward Gruber
<[EMAIL PROTECTED]> wrote:
> Oh, not a critique of startup or shutdown performance on T5-ioc, but more of
> a general principle of unit testing components that participate in any IoC
> container.  To test the component, you shouldn't need to use the container,
> because it's a "unit" test.  But he said he was testing the wiring between
> components anyway, rather than the functionality of the units, so my comment
> isn't as relevant.
>
> Christian.
>
> On 4-Dec-08, at 15:23 , Howard Lewis Ship wrote:
>
>> I use a mix of techniques, using a lot of mocks for true unit tests,
>> but also a lot of integration tests.
>>
>> I'm not sure what CEG has actually seen here; Registry.shutdown() is
>> very dramatic, it tears apart the registry (releasing almost
>> everything to the GC) and informs all of the proxies to shutdown as
>> well.  Could he just be missing the re-creation of the services in
>> later tests ... Registry startup is very, very fast once all the
>> underlying classes are instantiated.
>>
>> On Thu, Dec 4, 2008 at 12:04 PM, Christian Edward Gruber
>> <[EMAIL PROTECTED]> wrote:
>>>
>>> FYI, in general, you shouldn't be using the container in your tests,
>>> unless
>>> you're testing the wiring itself.  You should be creating the
>>> component/service under test, and constructing it with fakes.  This isn't
>>> absolute but there is a lot more effort/configuration/overhead if you
>>> want
>>> to use the container infrastructure in your unit test, and you start to
>>> have
>>> subtle interactions that might potentially make it more of an integration
>>> test.  You risk testing more than one thing at a time.
>>>
>>> Christian
>>>
>>> On 4-Dec-08, at 01:28 , Stephan Schwab wrote:
>>>
>>>>
>>>> Hi!
>>>>
>>>> I have several JUnit tests that instantiate
>>>> org.apache.tapestry5.ioc.Registry via the RegistryBuilder before tests
>>>> run.
>>>> Now I'm observing that services registered in one test are still
>>>> available
>>>> in other tests although I did call registry.shutdown(). My test runner
>>>> does
>>>> not fork a new JVM.
>>>>
>>>> Calling registry.shutdown() should cause everything to vanish. Is there
>>>> anything that causes one-registry-per-JVM?
>>>>
>>>> Stephan
>>>>
>>>>
>>>>
>>>> -----
>>>> --
>>>> http://www.caimito.net - Caimito One Team - Agile Collaboration and
>>>> Planning
>>>> tool
>>>> http://www.stephan-schwab.com - Personal blog
>>>> http://code.google.com/p/tapestry-sesame - Authentication extension for
>>>> Tapestry 5
>>>>
>>>> --
>>>> View this message in context:
>>>>
>>>> http://www.nabble.com/IoC-registry-survives-between-JUnit-tests--tp20828078p20828078.html
>>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator Apache Tapestry and Apache HiveMind
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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

Reply via email to