From: Sauli Tähkäpää Date: Fri, 3 Oct 2014 05:14:48 +0000 (+0300) Subject: Fix ContainerSizeChangeTest not to produce failure shots every time. X-Git-Tag: 7.4.0.beta1~182 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=71e16a6bfaafb51c623f64b84d711ce1385106e6;p=vaadin-framework.git Fix ContainerSizeChangeTest not to produce failure shots every time. Change-Id: I3cacc581d6991e6b760e2b3ae43a63dafac071b3 --- diff --git a/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeTest.java b/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeTest.java index 041b23749c..e13238e10d 100644 --- a/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeTest.java +++ b/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeTest.java @@ -1,5 +1,6 @@ package com.vaadin.tests.components.table; +import static junit.framework.TestCase.fail; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -19,9 +20,6 @@ import com.vaadin.tests.tb3.MultiBrowserTest; public class ContainerSizeChangeTest extends MultiBrowserTest { - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test public void tableShouldLoadCorrectItems() throws IOException, InterruptedException { @@ -52,11 +50,12 @@ public class ContainerSizeChangeTest extends MultiBrowserTest { } private void assertRowDoesNotExist(TableElement table, int rowIndex) { - // This is a really crappy way to workaround JUnit's limitation to - // provide a proper assert.throws method... - thrown.expect(NoSuchElementException.class); - table.getCell(rowIndex, 0); + try { + table.getCell(rowIndex, 0); + + fail(String.format("Row %s should not exists.", rowIndex)); + } catch (NoSuchElementException e) { - Assert.fail(String.format("Row %s should not exists.", rowIndex)); + } } }