diff options
author | Denis <denis@vaadin.com> | 2016-12-16 15:33:07 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2016-12-16 15:33:07 +0200 |
commit | 52decf5e2b32116deb5de32b7706cda198c52347 (patch) | |
tree | 8c7538e089e1e254a30ad74b816948ab4bf8eff4 | |
parent | 5b7ecd61c1cc108be3186cf88b7e0a8d9374b92b (diff) | |
download | vaadin-framework-52decf5e2b32116deb5de32b7706cda198c52347.tar.gz vaadin-framework-52decf5e2b32116deb5de32b7706cda198c52347.zip |
Fix for PushLargeData test. (#8019)
* Fix for PushLargeData test.
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/push/PushLargeData.java | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/push/PushLargeData.java b/uitest/src/main/java/com/vaadin/tests/push/PushLargeData.java index 2d4a1a0fc8..8617d8f88d 100644 --- a/uitest/src/main/java/com/vaadin/tests/push/PushLargeData.java +++ b/uitest/src/main/java/com/vaadin/tests/push/PushLargeData.java @@ -84,8 +84,8 @@ public abstract class PushLargeData extends AbstractTestUIWithLog { Integer pushSize = (Integer) dataSize.getConvertedValue(); Integer pushInterval = (Integer) interval.getConvertedValue(); Integer pushDuration = (Integer) duration.getConvertedValue(); - PushRunnable r = new PushRunnable(pushSize, pushInterval, - pushDuration); + PushRunnable r = new PushRunnable(getUI(), pushSize, + pushInterval, pushDuration); executor.execute(r); log.log("Starting push, size: " + pushSize + ", interval: " + pushInterval + "ms, duration: " + pushDuration @@ -115,11 +115,14 @@ public abstract class PushLargeData extends AbstractTestUIWithLog { private Integer size; private Integer interval; private Integer duration; + private final UI ui; - public PushRunnable(Integer size, Integer interval, Integer duration) { + public PushRunnable(UI ui, Integer size, Integer interval, + Integer duration) { this.size = size; this.interval = interval; this.duration = duration; + this.ui = ui; } @Override @@ -129,15 +132,15 @@ public abstract class PushLargeData extends AbstractTestUIWithLog { int packageIndex = 1; while (System.currentTimeMillis() < endTime) { final int idx = packageIndex++; - UI.getCurrent().access(new Runnable() { + ui.access(new Runnable() { @Override public void run() { - PushLargeData ui = (PushLargeData) UI.getCurrent(); + PushLargeData pushUi = (PushLargeData) ui; // Using description as it is not rendered to the DOM // immediately - ui.getDataLabel().setDescription( + pushUi.getDataLabel().setDescription( System.currentTimeMillis() + ": " + data); - ui.log("Package " + idx + " pushed"); + pushUi.log("Package " + idx + " pushed"); } }); try { @@ -146,11 +149,11 @@ public abstract class PushLargeData extends AbstractTestUIWithLog { return; } } - UI.getCurrent().access(new Runnable() { + ui.access(new Runnable() { @Override public void run() { - PushLargeData ui = (PushLargeData) UI.getCurrent(); - ui.log("Push complete"); + PushLargeData pushUi = (PushLargeData) ui; + pushUi.log("Push complete"); } }); |