[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.ercp] Re: new junit tests for Control

I concur with the new unit tests, sorry for late response.

-----------
Uriel Liu


"Franck Leveau" <DG.Java-eSWT-Dev@xxxxxxxxx> ¼¶¼g©ó¶l¥ó·s»D:e39pb5$3mp$1@xxxxxxxxxxxxxxxxxxxx
> Hello,
>
> Attached is the source code containing the new Junit tests so that other
> platforms could try to pass these tests against their implementation.
>
> To sum up the explanations given by Ghislain, the new Junit tests check:
> - that one and only one paint event is sent after a call to
> Control.redraw().
> - that one and only one paint event is sent after a call to
> Control.setBounds().
> - that all paint events are dispatched after a call to Control.update() 
> and
> no paint event remains in the event queue after this.
> - that one and only one paint event is sent after a call to
> Control.setLocation().
> - that one and only one paint event is sent after a call to
> Control.setSize().
> - if controlMoved and controlResized of ControlListener are called after
> call to setLocation, setSize or setBounds, depending on the set value (new
> value may be same as old value and then listener shouldn't be called, new
> value may be different than old value and then appropriate method of
> listener should be called).
>
> Best regards,
> Franck
>
>
> "Ghislain Hude" <DG.Java-eSWT-Dev@xxxxxxxxx> wrote in message
> news:e2a9bi$r4m$1@xxxxxxxxxxxxxxxxxxxx
>> Hello all,
>> For the NOKIA implementation of eSWT we used some additional tests.
>> I post them here to know if these are approved and can be committed to 
>> the
>> CVS.
>>
>> We use tests to verify if the controlListener is correctly called when
>> setLocation, setBounds and setSize are called:
>>             test_ControlListener_setLocation
>>                         Verify if ControlListener::controlMoved and
>> ControlListener::controlResized are not called when we call setLocation
> with
>> the current location.
>>                         Verify if ControlListener::controlMoved is called
>> and ControlListener::controlResized is not called when we call 
>> setLocation
>> with a different location.
>>             test_ControlListener_setBounds
>>                         Verify if ControlListener::controlMoved and
>> ControlListener::controlResized are not called when we call setBounds 
>> with
>> the current Bounds.
>>                         Verify if ControlListener::controlMoved is called
>> and ControlListener::controlResized is not called when we call setBounds
>> with a different Location and the current Size.
>>                         Verify if ControlListener::controlMoved is not
>> called and ControlListener::controlResized is called when we call
> setBounds
>> with the current Location and a different Size.
>>                         Verify if ControlListener::controlMoved and
>> ControlListener::controlResized are called when we call setBounds with a
>> different Size and a different Location.
>>             test_ControlListener_setSize
>>                         Verify if ControlListener::controlMoved and
>> ControlListener::controlResized are not called when we call setSize with
> the
>> current size.
>>                         Verify if ControlListener::controlMoved is not
>> called and ControlListener::controlResized is called when we call setSize
>> with a different size.
>>
>> We use tests to verify if the paintListener is correctly called when
> redraw,
>> setLocation, setBounds and setSize are called:
>>             test_PaintListener_setLocation
>>                         Verify if PaintListener::paintControl is called
> when
>> the control is moved.
>>
>>             test_PaintListener_setBounds
>>                         Verify if PaintListener::paintControl is called
> when
>> we call setBounds with a different Size and a different Location.
>>
>>             test_PaintListener_setSize
>>                         Verify if PaintListener::paintControl is called
> when
>> the control is resized.
>>
>>             test_PaintListener_redraw
>>                         Verify if PaintListener::paintControl is called
> when
>> we call the redraw method.
>>
>> We use tests to verify if the paintListener is correctly called when
> update
>> is called (see my post "About paint request, paint listener and update
>> method", on 20.03.2006, for details on how update method should be
>> implemented, hence the following junit test):
>>             test_PaintListener_update
>>                         Verify if PaintListener::paintControl is 
>> correctly
>> called when we call the update method.
>>
>> We use tests to verify if setRedraw is correctly implemented.
>>             This code was added in the "test_setRedrawZ"
>> setRedraw(false) is called and we verify no paint event is sent when
>> setVisible, setFocus, forceFocus, setBounds, and redraw methods are
> called.
>> After we call setRedraw(true) and verify paint event is sent.
>>
>> Thanks.
>>
>>
>
>
>