From f03e488f206c92f321e7e79bfb9c86c56077b341 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 4 Sep 2015 12:53:03 +0300 Subject: [PATCH] Additional fixes related to ParameterizedTB3Runner and Nginx + Wildfly 9 test changes Change-Id: Ib6740b10fe773c2d54973ea45a1aca0d29afeb49 --- .../LongPollingProxyServerTest.java | 22 +++++++++---------- .../integration/ParameterizedTB3Runner.java | 7 +++--- .../vaadin/tests/tb3/IncludeIfProperty.java | 11 ++++++++++ .../vaadin/tests/tb3/ScreenshotTB3Test.java | 2 +- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/uitest/src/com/vaadin/tests/integration/LongPollingProxyServerTest.java b/uitest/src/com/vaadin/tests/integration/LongPollingProxyServerTest.java index 58c4198ec0..16c599641b 100644 --- a/uitest/src/com/vaadin/tests/integration/LongPollingProxyServerTest.java +++ b/uitest/src/com/vaadin/tests/integration/LongPollingProxyServerTest.java @@ -67,31 +67,29 @@ public class LongPollingProxyServerTest extends AbstractIntegrationTest { actionAfterFirstTimeout("nonbuffering-timeout"); } + private String getUrl(String bufferingOrNot) { + return getBaseURL() + "/" + bufferingOrNot + "/demo" + + getDeploymentPath(); + } + private void actionAfterFirstTimeout(String bufferingOrNot) throws Exception { - String url = getBaseURL() + "/" + bufferingOrNot + "/demo" - + getDeploymentPath(); + String url = getUrl(bufferingOrNot); getDriver().get(url); - Thread.sleep(15000); // Server Timeout is 10s + // The wildfly9-nginx server has a configured timeout of 10s for + // *-timeout urls + Thread.sleep(15000); Assert.assertEquals(0, BasicPushTest.getClientCounter(this)); BasicPushTest.getIncrementButton(this).click(); Assert.assertEquals(1, BasicPushTest.getClientCounter(this)); } private void basicPush(String bufferingOrNot) throws Exception { - String url = getBaseURL() + "/" + bufferingOrNot + "/demo" - + getDeploymentPath(); + String url = getUrl(bufferingOrNot); getDriver().get(url); Assert.assertEquals(0, BasicPushTest.getServerCounter(this)); BasicPushTest.getServerCounterStartButton(this).click(); - waitUntil(new ExpectedCondition() { - @Override - public Boolean apply(WebDriver input) { - return BasicPushTest - .getServerCounter(LongPollingProxyServerTest.this) > 0; - } - }); waitUntil(new ExpectedCondition() { @Override public Boolean apply(WebDriver input) { diff --git a/uitest/src/com/vaadin/tests/integration/ParameterizedTB3Runner.java b/uitest/src/com/vaadin/tests/integration/ParameterizedTB3Runner.java index 59870a59a8..b051fb51db 100644 --- a/uitest/src/com/vaadin/tests/integration/ParameterizedTB3Runner.java +++ b/uitest/src/com/vaadin/tests/integration/ParameterizedTB3Runner.java @@ -99,13 +99,14 @@ public class ParameterizedTB3Runner extends TB3Runner { try { values = (Collection) m.invoke(null); if (!values.isEmpty()) { - // Ignore any empty collections to allow e.g. intergration + // Ignore any empty collections to allow e.g. integration // tests to use "/demo" path by default without adding that - // to the screnshot name + // to the screenshot name parameters.put(setterMethod, values); } } catch (Exception e) { - e.printStackTrace(); + throw new IllegalStateException("The setter " + m.getName() + + " could not be invoked", e); } } diff --git a/uitest/src/com/vaadin/tests/tb3/IncludeIfProperty.java b/uitest/src/com/vaadin/tests/tb3/IncludeIfProperty.java index cb04b4f2e8..789422c0c6 100644 --- a/uitest/src/com/vaadin/tests/tb3/IncludeIfProperty.java +++ b/uitest/src/com/vaadin/tests/tb3/IncludeIfProperty.java @@ -21,6 +21,17 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +/** + * Annotation to control inclusion of a test into a test suite. + *

+ * The test will be included in the suite only if the given System property + * {@code property} has the given {@code value}. + *

+ * Used by {@link TB3TestLocator} + * + * @since + * @author Vaadin Ltd + */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Inherited diff --git a/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java b/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java index 78266e9a9d..1c24720075 100644 --- a/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java @@ -439,7 +439,7 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test { // Windows_Firefox_24_bufferingdemo_valo if (versionOverride != null) { - // Windows_Firefox_17_-buffering-demo_valo + // Windows_Firefox_17_bufferingdemo_valo parameters = parameters.replaceFirst("_" + getDesiredCapabilities().getVersion(), "_" + versionOverride); -- 2.39.5