[richfaces-planning-issues] [JBoss JIRA] Commented: (RFPL-320) rf-demo ftest - patch Wait.until() method to test conditions on the start of the loop
Lukas Fryc (JIRA)
jira-events at lists.jboss.org
Fri Jan 15 07:26:35 EST 2010
[ https://jira.jboss.org/jira/browse/RFPL-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12506242#action_12506242 ]
Lukas Fryc commented on RFPL-320:
---------------------------------
Added methods (noDelay(), withDelay(boolean)) to allow enabling/disabling start of testing conditions on the start of the loop
> rf-demo ftest - patch Wait.until() method to test conditions on the start of the loop
> -------------------------------------------------------------------------------------
>
> Key: RFPL-320
> URL: https://jira.jboss.org/jira/browse/RFPL-320
> Project: RichFaces Planning
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: QA
> Affects Versions: 3.3.3.BETA1
> Reporter: Lukas Fryc
> Assignee: Lukas Fryc
> Priority: Minor
> Fix For: 3.3.3.CR1
>
>
> Originally was: RF-8177
> Use following patch after solving related issues - some tests needs to be modifies (mainly widely used abstractTestSource()):
> Index: src/main/java/org/jboss/test/selenium/waiting/Wait.java
> ===================================================================
> --- src/main/java/org/jboss/test/selenium/waiting/Wait.java (revision 16033)
> +++ src/main/java/org/jboss/test/selenium/waiting/Wait.java (revision 16037)
> @@ -373,8 +373,28 @@
> }
>
> /**
> - * Stars loop waiting to satisfy condition.
> + * <p>Stars loop waiting to satisfy condition.</p>
> *
> + * <p>The condition will be tested</p>
> + *
> + * <ul>
> + * <li>on the start,</li>
> + * <li>every time interval after last try</li>
> + * <li>and also once after timeout when finishes interval since last try before timeout.</li>
> + * </ul>
> + *
> + * <p>Scheme:</p>
> + *
> + * <p><pre>S ..int.. T ..int.. T ..int1..timeout..int2.. L</pre></p>
> + *
> + * <p>
> + * <div>S - starting try</div>
> + * <div>T - try within intervals</div>
> + * <div>L - last try after timeout</div>
> + * <div>int - one interval</div>
> + * <div>int = int1 + int2</div>
> + * </p>
> + *
> * @param condition
> * what wait for to be satisfied
> */
> @@ -382,13 +402,17 @@
> long start = System.currentTimeMillis();
> long end = start + timeout;
> while (System.currentTimeMillis() < end) {
> + if (condition.isTrue())
> + return;
> try {
> Thread.sleep(interval);
> } catch (InterruptedException e) {
> throw new RuntimeException(e);
> }
> - if (condition.isTrue())
> - return;
> + if (System.currentTimeMillis() >= end) {
> + if (condition.isTrue())
> + return;
> + }
> }
> fail();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the richfaces-planning-issues
mailing list