diff options
author | Artur Signell <artur@vaadin.com> | 2016-09-09 14:54:43 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2016-09-09 14:57:26 +0300 |
commit | 4ee640120878974fedff271691700cad3d198547 (patch) | |
tree | e01c81eb45ee025b1cc22bdbcf1f20016b64ccec /uitest | |
parent | 61aff6078ce7fda5aba4c423ae6f78c4e3fd8cab (diff) | |
download | vaadin-framework-4ee640120878974fedff271691700cad3d198547.tar.gz vaadin-framework-4ee640120878974fedff271691700cad3d198547.zip |
Make sleep in tests throw RuntimeException to avoid try catches
Change-Id: I7ef3cca8271ae9f725d8530793543253c216e6bc
Diffstat (limited to 'uitest')
6 files changed, 5 insertions, 30 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowedTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowedTest.java index 4483c27240..6adb68f933 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowedTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowedTest.java @@ -267,10 +267,7 @@ public class ComboBoxSelectingWithNewItemsAllowedTest extends MultiBrowserTest { private void assertInitialItemCount() { // wait for a bit in case the count is updating - try { - sleep(1000); - } catch (InterruptedException ignore) { - } + sleep(1000); assertThat("Wrong initial item count.", labelElement.getText(), is("2600")); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/panel/PanelRemoveShortcutListenerTest.java b/uitest/src/test/java/com/vaadin/tests/components/panel/PanelRemoveShortcutListenerTest.java index 756a55f3c5..45f3828dd1 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/panel/PanelRemoveShortcutListenerTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/panel/PanelRemoveShortcutListenerTest.java @@ -81,10 +81,7 @@ public class PanelRemoveShortcutListenerTest extends MultiBrowserTest { attemptShortcut("A on"); // add a bit more delay to make sure the caption doesn't change later - try { - sleep(2000); - } catch (InterruptedException ignore) { - } + sleep(2000); assertThat(panel.findElement(By.className("v-panel-caption")) .findElement(By.tagName("span")).getText(), is("A on")); diff --git a/uitest/src/test/java/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java b/uitest/src/test/java/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java index 807c097c16..ab4aeabaa2 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java @@ -49,15 +49,6 @@ public class ExpandingContainerVisibleRowRaceConditionTest assertScrollPositionIsNotVisible(); } - @Override - protected void sleep(int milliseconds) { - try { - super.sleep(milliseconds); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - private void assertFirstRowIdIs(String expected) { List<WebElement> cellsOfFirstColumn = getCellsOfFirstColumn(); WebElement first = cellsOfFirstColumn.get(0); diff --git a/uitest/src/test/java/com/vaadin/tests/components/window/ModalWindowFocusTest.java b/uitest/src/test/java/com/vaadin/tests/components/window/ModalWindowFocusTest.java index 50136759c1..b01a9ded14 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/window/ModalWindowFocusTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/window/ModalWindowFocusTest.java @@ -93,10 +93,7 @@ public class ModalWindowFocusTest extends MultiBrowserTest { private void pressEscAndWait() { new Actions(driver).sendKeys(Keys.ESCAPE).build().perform(); - try { - sleep(100); - } catch (InterruptedException e) { - } + sleep(100); } } diff --git a/uitest/src/test/java/com/vaadin/tests/requesthandlers/AppResource404Test.java b/uitest/src/test/java/com/vaadin/tests/requesthandlers/AppResource404Test.java index 1b8d002236..74af445b3c 100644 --- a/uitest/src/test/java/com/vaadin/tests/requesthandlers/AppResource404Test.java +++ b/uitest/src/test/java/com/vaadin/tests/requesthandlers/AppResource404Test.java @@ -48,10 +48,6 @@ public class AppResource404Test extends MultiBrowserTest { protected void disableWaitingAndWait() { testBench().disableWaitForVaadin(); - try { - sleep(500); - } catch (InterruptedException e) { - e.printStackTrace(); - } + sleep(500); } } diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java b/uitest/src/test/java/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java index 3abcdf76b8..51f281f6de 100755 --- a/uitest/src/test/java/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java +++ b/uitest/src/test/java/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java @@ -87,10 +87,7 @@ public abstract class MultiBrowserTestWithProxy extends MultiBrowserTest { createProxy(getProxyPort()); break; } catch (JSchException e) { - try { - sleep(500); - } catch (InterruptedException e1) { - } + sleep(500); if (i == 9) { throw new RuntimeException( "All 10 attempts to connect a proxy failed", e); |