diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-02-02 12:48:02 +0200 |
---|---|---|
committer | Denis <denis@vaadin.com> | 2017-02-02 12:48:02 +0200 |
commit | 59211beda0aaee3469336a671de5a7ccfb62f014 (patch) | |
tree | 32096f7a38ff0887ec1511acf37cbbd1e0b1898d /uitest-common/src/main/java | |
parent | 700742c85872c018af017f757fde64d564050811 (diff) | |
download | vaadin-framework-59211beda0aaee3469336a671de5a7ccfb62f014.tar.gz vaadin-framework-59211beda0aaee3469336a671de5a7ccfb62f014.zip |
Handle system properties for failsafe plugin (#8414)
* Handle system properties for failsafe plugin
Diffstat (limited to 'uitest-common/src/main/java')
-rw-r--r-- | uitest-common/src/main/java/com/vaadin/tests/tb3/RetryOnFail.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/RetryOnFail.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/RetryOnFail.java index bd3300e54f..cd735ae76b 100644 --- a/uitest-common/src/main/java/com/vaadin/tests/tb3/RetryOnFail.java +++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/RetryOnFail.java @@ -15,11 +15,14 @@ */ package com.vaadin.tests.tb3; +import java.util.logging.Logger; + import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; public class RetryOnFail implements TestRule { + @Override public Statement apply(Statement base, Description description) { return statement(base, description); @@ -53,8 +56,15 @@ public class RetryOnFail implements TestRule { String retryCount = System .getProperty("com.vaadin.testbench.max.retries"); - if (retryCount != null && retryCount != "") { - return Integer.parseInt(retryCount); + if (retryCount != null && !retryCount.trim().isEmpty()) { + try { + return Integer.parseInt(retryCount); + } catch (NumberFormatException e) { + // TODO: See how this was implemented in TestBench + Logger.getLogger(RetryOnFail.class.getName()).warning( + "Could not parse max retry count. Retry count set to 0. Failed value: " + + retryCount); + } } return 0; |