| 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.JProgressBarIndeterminateQuery.isIndeterminate; |
| 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 JProgressBarWaitUntilIsDeterminate { |
| 37 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 38 |
4
|
@RunsInEDT... |
| 39 |
|
static void waitUntilValueIsDeterminate(final JProgressBar progressBar, final Timeout timeout) { |
| 40 |
4
|
pause(new Condition(untilIsDeterminate(progressBar)) { |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 41 |
2988
|
public boolean test() {... |
| 42 |
2988
|
return !isIndeterminate(progressBar); |
| 43 |
|
} |
| 44 |
|
}, timeout); |
| 45 |
|
} |
| 46 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 47 |
4
|
private static Description untilIsDeterminate(final JProgressBar progressBar) {... |
| 48 |
4
|
return new GuiLazyLoadingDescription() { |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 49 |
2
|
protected String loadDescription() {... |
| 50 |
2
|
return concat(format(progressBar), " to be in determinate mode"); |
| 51 |
|
} |
| 52 |
|
}; |
| 53 |
|
} |
| 54 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 55 |
|
private JProgressBarWaitUntilIsDeterminate() {}... |
| 56 |
|
} |