Bug 551211 - Take advantage of lambda in DisplayHelper
Summary: Take advantage of lambda in DisplayHelper
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.12   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.14 M1   Edit
Assignee: Jens Lideström CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, noteworthy, test
Depends on:
Blocks:
 
Reported: 2019-09-18 12:07 EDT by Mickael Istria CLA
Modified: 2019-10-17 11:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2019-09-18 12:07:30 EDT
Having to instantiate a new DisplayHelper everytime generates a lot of noise.
To ease usage, DisplayHelper should provide a static DisplayHelper.waitForCondition(condition, display, timeout)
Comment 1 Eclipse Genie CLA 2019-09-18 12:11:23 EDT
New Gerrit change created: https://git.eclipse.org/r/149787
Comment 4 Eclipse Genie CLA 2019-09-19 11:26:38 EDT
New Gerrit change created: https://git.eclipse.org/r/149856
Comment 6 Mickael Istria CLA 2019-09-19 15:44:40 EDT
I'm going to revert the change I made for this one and adapt a few things, as Jens improvements in bug 412569 (with DisplayHelper.create(BooleanSupplier) do cover the case already perfectly, so no need to add new APIs for that.
Too bad I didn't notice the new change earlier!
Comment 7 Eclipse Genie CLA 2019-09-19 15:52:11 EDT
New Gerrit change created: https://git.eclipse.org/r/149870
Comment 9 Mickael Istria CLA 2019-09-20 17:28:19 EDT
Thanks Jens!
Comment 10 Gautier de SAINT MARTIN LACAZE CLA 2019-09-23 18:56:46 EDT
@Mickael, 

I don't find where to push a patch for N&N but I think there is a type in this source code: 

```
assertTrue(DisplayHelper.waitForCondition()display, 1000, () -> some.boolean() && expression))
```

IIRC it should be:

```
assertTrue(DisplayHelper.waitForCondition(display, 1000, () -> some.boolean() && expression))
```

Check the extra ) in your version between `waitForCondition` and `display`.
Comment 11 Mickael Istria CLA 2019-09-24 01:22:43 EDT
(In reply to Gautier de SAINT MARTIN LACAZE from comment #10)
> I don't find where to push a patch for N&N

https://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/
Comment 12 Gautier de SAINT MARTIN LACAZE CLA 2019-09-27 10:22:08 EDT
Maybe I'm not totally wake up, I can't push to gerrit... 

"Can't connect to any repository: https://git.eclipse.org/r/www.eclipse.org/eclipse/news (https://git.eclipse.org/r/www.eclipse.org/eclipse/news: not authorized)"
Comment 13 Mickael Istria CLA 2019-09-27 10:25:35 EDT
You're using anonymous http, try using ssh remote URI instead.
Comment 14 Jens Lideström CLA 2019-09-27 11:41:45 EDT
Is N&N really for news about tools that are used internally by the platform development team, such as DisplayHelper?

I think N&N is for news about the tools and software that the platform *provides*, not things that are use to develop the platform.
Comment 15 Mickael Istria CLA 2019-09-27 11:44:45 EDT
(In reply to Jens Lideström from comment #14)
> Is N&N really for news about tools that are used internally by the platform
> development team, such as DisplayHelper?
> I think N&N is for news about the tools and software that the platform
> *provides*, not things that are use to develop the platform.


Although it's not officually an API, the test harness bundle and DisplyHelper are very wodely used.by other projects, and this improvements can be profitable beyond Platform. It's IMO worth the note.
Comment 16 Jens Lideström CLA 2019-09-28 06:59:24 EDT
(In reply to Mickael Istria from comment #15)
> the test harness bundle and
> DisplyHelper are very wodely used.by other projects

All right. Had I known that DisplyHelper is used by other projects I would have though twice before adding new methods to it! But I think the additions are okay anyway.
Comment 17 Eclipse Genie CLA 2019-10-17 10:39:11 EDT
New Gerrit change created: https://git.eclipse.org/r/151253