]> source.dussan.org Git - vaadin-framework.git/commitdiff
Pass useLocalWebDriver parameter to JUnit.
authorSauli Tähkäpää <sauli@vaadin.com>
Tue, 3 Jun 2014 13:20:37 +0000 (16:20 +0300)
committerVaadin Code Review <review@vaadin.com>
Wed, 4 Jun 2014 06:05:27 +0000 (06:05 +0000)
Change-Id: I4840da6281c8be676384aa5b71bf689f7083ee36

uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
uitest/src/com/vaadin/tests/tb3/TB3Runner.java
uitest/tb3test.xml

index 3745d60fd82991a1a8fab9cbc81b02605919e48e..c8e4e3c9a9d8a0bd3bc3f5f5ee08b464c8cb4965 100644 (file)
@@ -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(
index 69880008ffc5ccaa3767d78d4f9ca96f05730c3b..4d29e479e2c0d736a75a972cdc9e33772e062b5a 100644 (file)
@@ -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));
index 6e0f25a8f7065d971f0191ab64932c7d698d348a..a39725f1bb72ac1aa8548fa4714b5ce3e1faec77 100644 (file)
@@ -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>