| Summary: | SWTBotHyperlink.click() fails to notify listeners | ||
|---|---|---|---|
| Product: | [Technology] SWTBot | Reporter: | Elias Volanakis <elias> |
| Component: | SWTBot | Assignee: | Project Inbox <swtbot-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | KetanPadegaonkar |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
| Bug Depends on: | 320778 | ||
| Bug Blocks: | |||
|
Description
Elias Volanakis
I like your neat stub listener.
Since the listener is notified in another thread, this test may at times generate false failures when the assertion runs on the mock but the UI thread has not notified it yet.
A better alternative IMHO might be something like.
assertWaitForTrue(new DefaultCondition(){
public boolean test(){
return listener.whatever;
}
});
public assertWaitForTrue(condition){
// throws TimeoutException if the condition fails!
try{
bot.waitUntil(condition);
} catch(TimeoutException e){
fail("Timed out waiting for listener to be notified!");
}
}
|