[ENH][TEST] ClassBuilder format tests

ducasse ducasse at iam.unibe.ch
Mon Jan 5 08:20:04 UTC 2004


On 4 janv. 04, at 22:39, Colin Putney wrote:

>
> On Jan 4, 2004, at 12:37 PM, ducasse wrote:
>
>>
>> On 4 janv. 04, at 21:23, Andreas Raab wrote:
>>
>>> Hi Stef,
>>>
>>>> I was looking at your tests. I want them in the image :)
>>>> I was wondering why you do not use tearDown to clean your stuff.
>>>
>>> I needed to clean up inbetween each individual test and tearDown is 
>>> only
>>> called when all the tests are run (e.g., after the entire suite 
>>> completed).
>>
>> No tearDown is run after each tests. I was forced to extend SUnit to 
>> provide the behavior
>> you describe because our test suite was taking too much time, so I'm 
>> really sure about this
>> behavior. In fact setU and tearDown are always run before and after 
>> each tests because they control
>> the contex.
>
> Stéphane,
>
> Why did you extend SUnit? Was there some reason you couldn't use a 
> TestResource to speed up your fixture set up and teardown?

Hi

I already explained that to joseph and alan knight (who was always 
skeptical ;)).
The problems with testResources is that you cannot control when and the 
order when they are setup.
In our system we have a kind of **big** singleton that gets modified by 
different operators. When testing these operators
we have to rebuild a large test context and the operators will annotate 
it. The problems is that each testcase modifies the singleton
in different way so we end up not been able to able a consistent 
context for each of the operator.

I played a lot with TestResources (read the code step it.....) until I 
realised that I could not do what I needed with that.
So I extended SUnit, and proposed some hooks because it was not so well 
to have hardcoded class references in method bodies.
What I did is described in the SUniit Explained tutorial available on 
my web page.

Stef

>
> Coln
>
>
>




More information about the Squeak-dev mailing list