|
|
|
Re: *Wrong Thread* debug message [message #7767 is a reply to message #7725] |
Tue, 09 December 2008 17:10 |
Ketan Padegaonkar Messages: 873 Registered: July 2009 |
Senior Member |
|
|
Joe,
There is no defect, please log a defect for any such anomalies you see.
I'm sure there are many.
Thanks.
-- Ketan
On 9/12/08 22:28, Joe Luebker wrote:
> Thanks Ketan. Is there a defect reported against this? The logging
> output in this case can misdirect someone trying to debug (using logging
> output) how SWTBot is executing tests.
>
> Joe
>
> Ketan Patel wrote:
>> This is really not failure issue, but it's a "bug" in the following
>> log statement in the click method of SWTBotButton:
>> log.debug(MessageFormat.format("Clicking on {0}", widget));
>>
>> Notice that MessageFormat's format is going to call toString method of
>> widget, which is going to happen on non-ui thread. So it will print
>> the message you see. Maybe is should use SWTUtils.getText(widget)
>> instead of passing widget only.
>> Joe Luebker wrote:
>>
>>> Hello,
>>
>>> I am getting started with creating some tests using SWTBot. While
>>> executing very simple test I noticed the following debug message.
>>
>>> 08 Dec 2008 17:19:47.078 - Workbench Test Thread - DEBUG -
>>> SWTBotButton - (SWTBotButton.java:45) - Clicking on Button {*Wrong
>>> Thread*}
>>
>>> My test method is very simple
>>
>>> public void test()
>>> {
>>> bot.menu("Run").menu("Open Run Dialog...").click();
>>> bot.button("Close").click();
>>> }
>>
>>> A bit of background: In my test environment we have a test suite
>>> class that extends the JUnit TestSuite class. We have overridden the
>>> run() method so that we can output messages before testing starts and
>>> run the tests in a separate thread (avoiding deadlocks while testing
>>> some parts of the UI).
>>
>>> What is causing SWTBot to indicate that the SWT operation occurred on
>>> a wrong thread? Is there something with this test environment that is
>>> causing issues for SWTBot?
>>
>>> I did experiment with wrapping the SWTBot calls in syncExecs but
>>> seemed to get unexpected behavior, a hang in one case in a shell's
>>> event dispatcher. I need to experiment with this more but figured I
>>> should first ask what is the correct approach in this situation.
>>
>>> Thanks,
>>> Joe
>>
>>
|
|
|
Re: *Wrong Thread* debug message [message #7929 is a reply to message #7767] |
Wed, 10 December 2008 21:02 |
Joe Luebker Messages: 36 Registered: July 2009 |
Member |
|
|
Thanks Ketan. I just logged a bug for this,
http://swtbot.org/bugzilla/show_bug.cgi?id=147
Joe
Ketan Padegaonkar wrote:
> Joe,
>
> There is no defect, please log a defect for any such anomalies you see.
> I'm sure there are many.
>
> Thanks.
>
> -- Ketan
>
> On 9/12/08 22:28, Joe Luebker wrote:
>> Thanks Ketan. Is there a defect reported against this? The logging
>> output in this case can misdirect someone trying to debug (using logging
>> output) how SWTBot is executing tests.
>>
>> Joe
>>
>> Ketan Patel wrote:
>>> This is really not failure issue, but it's a "bug" in the following
>>> log statement in the click method of SWTBotButton:
>>> log.debug(MessageFormat.format("Clicking on {0}", widget));
>>>
>>> Notice that MessageFormat's format is going to call toString method of
>>> widget, which is going to happen on non-ui thread. So it will print
>>> the message you see. Maybe is should use SWTUtils.getText(widget)
>>> instead of passing widget only.
>>> Joe Luebker wrote:
>>>
>>>> Hello,
>>>
>>>> I am getting started with creating some tests using SWTBot. While
>>>> executing very simple test I noticed the following debug message.
>>>
>>>> 08 Dec 2008 17:19:47.078 - Workbench Test Thread - DEBUG -
>>>> SWTBotButton - (SWTBotButton.java:45) - Clicking on Button {*Wrong
>>>> Thread*}
>>>
>>>> My test method is very simple
>>>
>>>> public void test()
>>>> {
>>>> bot.menu("Run").menu("Open Run Dialog...").click();
>>>> bot.button("Close").click();
>>>> }
>>>
>>>> A bit of background: In my test environment we have a test suite
>>>> class that extends the JUnit TestSuite class. We have overridden the
>>>> run() method so that we can output messages before testing starts and
>>>> run the tests in a separate thread (avoiding deadlocks while testing
>>>> some parts of the UI).
>>>
>>>> What is causing SWTBot to indicate that the SWT operation occurred on
>>>> a wrong thread? Is there something with this test environment that is
>>>> causing issues for SWTBot?
>>>
>>>> I did experiment with wrapping the SWTBot calls in syncExecs but
>>>> seemed to get unexpected behavior, a hang in one case in a shell's
>>>> event dispatcher. I need to experiment with this more but figured I
>>>> should first ask what is the correct approach in this situation.
>>>
>>>> Thanks,
>>>> Joe
>>>
>>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02818 seconds