Valentin Olteanu created SLING-6853:
---------------------------------------
Summary: Improve polling capabilities in o.a.s.testing.clients
Key: SLING-6853
URL: https://issues.apache.org/jira/browse/SLING-6853
Project: Sling
Issue Type: Improvement
Components: Apache Sling Testing Clients
Affects Versions: Apache Sling Testing Clients 1.0.1
Reporter: Valentin Olteanu
Polling is an important part of the testing clients, yet the current
implementation lacks homogeneity.
The proposed patch:
# defines a standard way to write {{wait}} methods: {{void wait(long timeout,
long delay) throws TimeoutException, InterruptedException}}
** where parameters are in milliseconds
** that is in line with other java waiting methods (e.g. {{Timer}})
** Throws {{TimeoutException}} instead of returning a status
# brings a new poller called (uninspiredly) {{Polling}}
** extends {{Callable}} to follow the Single Abstract Method paradigm
** can make use of lambda expressions
** simplifies the wait logic, compared to the old Poller: repeat {{call()}}
with fixed delays in between, until it returns true or the timeout is reached
# deprecates confusing methods that were waiting for resources when it was not
the case.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)