diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2014-06-03 16:20:37 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-06-04 06:05:27 +0000 |
commit | 2ff67edb7281960ffeebad27d730d81d7dbbfafc (patch) | |
tree | 8cc4d5f1fedcbbb3a68ad29b96bc53a40d79a992 /uitest | |
parent | 8cf3339c56c694b1f716995813064a2212ad93c4 (diff) | |
download | vaadin-framework-2ff67edb7281960ffeebad27d730d81d7dbbfafc.tar.gz vaadin-framework-2ff67edb7281960ffeebad27d730d81d7dbbfafc.zip |
Pass useLocalWebDriver parameter to JUnit.
Change-Id: I4840da6281c8be676384aa5b71bf689f7083ee36
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java | 4 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/TB3Runner.java | 8 | ||||
-rw-r--r-- | uitest/tb3test.xml | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index 3745d60fd8..c8e4e3c9a9 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -51,6 +51,8 @@ import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.tests.tb3.MultiBrowserTest.Browser; import com.vaadin.ui.UI; +import static com.vaadin.tests.tb3.TB3Runner.localWebDriverIsUsed; + /** * Base class for TestBench 3+ tests. All TB3+ tests in the project should * extend this class. @@ -126,7 +128,7 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { } else { capabilities = getDesiredCapabilities(); - if (System.getProperty("useLocalWebDriver") != null) { + if (localWebDriverIsUsed()) { setupLocalDriver(capabilities); } else { WebDriver dr = TestBench.createDriver(new RemoteWebDriver( diff --git a/uitest/src/com/vaadin/tests/tb3/TB3Runner.java b/uitest/src/com/vaadin/tests/tb3/TB3Runner.java index 69880008ff..4d29e479e2 100644 --- a/uitest/src/com/vaadin/tests/tb3/TB3Runner.java +++ b/uitest/src/com/vaadin/tests/tb3/TB3Runner.java @@ -61,7 +61,7 @@ public class TB3Runner extends BlockJUnit4ClassRunner { private static final ExecutorService service; static { - if (System.getProperty("useLocalWebDriver") != null) { + if (localWebDriverIsUsed()) { MAX_CONCURRENT_TESTS = 10; } else { MAX_CONCURRENT_TESTS = 50; @@ -69,6 +69,12 @@ public class TB3Runner extends BlockJUnit4ClassRunner { service = Executors.newFixedThreadPool(MAX_CONCURRENT_TESTS); } + protected static boolean localWebDriverIsUsed() { + String useLocalWebDriver = System.getProperty("useLocalWebDriver"); + + return useLocalWebDriver != null && useLocalWebDriver.toLowerCase().equals("true"); + } + public TB3Runner(Class<?> klass) throws InitializationError { super(klass); setScheduler(new ParallelScheduler(service)); diff --git a/uitest/tb3test.xml b/uitest/tb3test.xml index 6e0f25a8f7..a39725f1bb 100644 --- a/uitest/tb3test.xml +++ b/uitest/tb3test.xml @@ -7,6 +7,7 @@ <property name="browsers.exclude" value="" /> <property name="categories.include" value="" /> <property name="categories.exclude" value="" /> + <property name="useLocalWebDriver" value="false" /> <ivy:resolve file="${tb3test.dir}/ivy.xml" conf="build, build-provided" /> <ivy:cachepath pathid="classpath.tb3.lib" conf="build, build-provided" /> @@ -37,6 +38,7 @@ <jvmarg value="-Dbrowsers.exclude=${browsers.exclude}" /> <jvmarg value="-Dcategories.include=${categories.include}" /> <jvmarg value="-Dcategories.exclude=${categories.exclude}" /> + <jvmarg value="-DuseLocalWebDriver=${useLocalWebDriver}" /> <test name="${junit.test.suite}" todir="${report.dir}" /> </junit> |