| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
package org.fest.swing.driver; |
| 16 |
|
|
| 17 |
|
import static org.fest.swing.driver.JProgressBarValueQuery.valueOf; |
| 18 |
|
import static org.fest.swing.format.Formatting.format; |
| 19 |
|
import static org.fest.swing.timing.Pause.pause; |
| 20 |
|
import static org.fest.util.Strings.concat; |
| 21 |
|
|
| 22 |
|
import javax.swing.JProgressBar; |
| 23 |
|
|
| 24 |
|
import org.fest.assertions.Description; |
| 25 |
|
import org.fest.swing.annotation.RunsInEDT; |
| 26 |
|
import org.fest.swing.edt.GuiLazyLoadingDescription; |
| 27 |
|
import org.fest.swing.timing.Condition; |
| 28 |
|
import org.fest.swing.timing.Timeout; |
| 29 |
|
|
| 30 |
|
|
| 31 |
|
@link |
| 32 |
|
|
| 33 |
|
|
| 34 |
|
@author |
| 35 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 4 |
Complexity Density: 1 |
|
| 36 |
|
final class JProgressBarWaitUntilValueIsEqualToExpectedTask { |
| 37 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 38 |
4
|
@RunsInEDT... |
| 39 |
|
static void waitUntilValueIsEqualToExpected(final JProgressBar progressBar, final int expected, final Timeout timeout) { |
| 40 |
4
|
pause(new Condition(untilValueIsEqualTo(progressBar, expected)) { |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 41 |
3473
|
public boolean test() {... |
| 42 |
3473
|
return valueOf(progressBar) == expected; |
| 43 |
|
} |
| 44 |
|
}, timeout); |
| 45 |
|
} |
| 46 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 47 |
4
|
private static Description untilValueIsEqualTo(final JProgressBar progressBar, final int expected) {... |
| 48 |
4
|
return new GuiLazyLoadingDescription() { |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 49 |
2
|
protected String loadDescription() {... |
| 50 |
2
|
return concat("value of ", format(progressBar), " to be equal to ", expected); |
| 51 |
|
} |
| 52 |
|
}; |
| 53 |
|
} |
| 54 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 55 |
|
private JProgressBarWaitUntilValueIsEqualToExpectedTask() {}... |
| 56 |
|
} |