Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » *Wrong Thread* debug message
*Wrong Thread* debug message [message #7572] Mon, 08 December 2008 23:32 Go to next message
Joe Luebker is currently offline Joe LuebkerFriend
Messages: 36
Registered: July 2009
Member
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 #7593 is a reply to message #7572] Mon, 08 December 2008 23:53 Go to previous messageGo to next message
Ketan Patel is currently offline Ketan PatelFriend
Messages: 68
Registered: July 2009
Member
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 #7725 is a reply to message #7593] Tue, 09 December 2008 16:58 Go to previous messageGo to next message
Joe Luebker is currently offline Joe LuebkerFriend
Messages: 36
Registered: July 2009
Member
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 #7767 is a reply to message #7725] Tue, 09 December 2008 17:10 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
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 Go to previous message
Joe Luebker is currently offline Joe LuebkerFriend
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
>>>
>>>
>
Previous Topic:Invoking SWTBot methods on non-UI threads
Next Topic:Slow execution
Goto Forum:
  


Current Time: Sat Nov 09 01:06:42 GMT 2024

Powered by FUDForum. Page generated in 0.02818 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top