camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: CamelTestSupport for junit 4 (re)starting context per class instead of per method
Date Fri, 05 Mar 2010 11:34:40 GMT
Sure you can get strange behaviour in some cases but I think if the 
Developer of the test knows that his context is per class it should be ok.
I am not proposing to change the default as current tests sometimes will 
rely on running isolated. I rather propose to write new tests
with one context per class where possible and of course to rewrite old 
tests over time.

While you are right that per method will avoid most side effects I think 
the test time could be the more important argument. Currently the
whole camel build takes way tool long and perhaps this is one way to 
bring the time down.

Greetings

Christian



Am 05.03.2010 12:16, schrieb Claus Ibsen:
> -1
>
> All tests should run isolated.
>
> If you start to keep the JVM up for each test method you can really
> get some strange and subtle side effects with testing.
>
>
> On Fri, Mar 5, 2010 at 11:52 AM, Christian Schneider
> <chris@die-schneider.net>  wrote:
>    
>> Hi all,
>>
>> I am currently debugging a little in the tests for jetty because I got an
>> error in a test.
>> While doing so I found out that the camel context or even the spring context
>> is (re)started for each test method. Wouldn´t it be much more efficient to
>> do this only per class?
>> I guess the tests could take less then half the time after this change. What
>> do you think?
>>
>> Greetings
>>
>> Christian
>>
>> --
>>
>> Christian Schneider
>> ---
>> http://www.liquid-reality.de
>>
>>
>>      
>
>
>    


-- 

Christian Schneider
---
http://www.liquid-reality.de


Mime
View raw message