aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-10-17 15:21:09 +0300
committerArtur Signell <artur@vaadin.com>2013-10-17 15:44:07 +0300
commita4211dc5e92cc48ff06bac46615bf486c59f64ed (patch)
tree8217c0c455c760c24bd59564918bd44f54f231d7
parent7ee11a71262e748246bae800fbccd306937669c0 (diff)
downloadvaadin-framework-a4211dc5e92cc48ff06bac46615bf486c59f64ed.tar.gz
vaadin-framework-a4211dc5e92cc48ff06bac46615bf486c59f64ed.zip
Resolve concurrency issue in running TB3 tests
Ensure nobody can update the static collections of browsers to run on but that sub classes can restrict which browsers to run on using super.getBrowersToTest().remove(something) Change-Id: Iad520840801fbeb719bae51050714c0e47148804
-rw-r--r--uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java6
-rw-r--r--uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java4
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java6
-rw-r--r--uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java11
-rw-r--r--uitest/src/com/vaadin/tests/tb3/WebsocketTest.java9
5 files changed, 18 insertions, 18 deletions
diff --git a/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java b/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java
index bb2a7d0995..ca00c998a6 100644
--- a/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java
+++ b/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.actions;
-import java.util.Collection;
+import java.util.List;
import org.junit.Assert;
import org.junit.Test;
@@ -15,8 +15,8 @@ public class ActionsOnInvisibleComponentsTest extends MultiBrowserTest {
// This method should be removed once #12785 is fixed
@Override
- public Collection<DesiredCapabilities> getBrowsersToTest() {
- Collection<DesiredCapabilities> browsers = super.getBrowsersToTest();
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ List<DesiredCapabilities> browsers = super.getBrowsersToTest();
// sendKeys does nothing on these browsers
browsers.remove(BrowserUtil.firefox(24));
browsers.remove(BrowserUtil.ie(8));
diff --git a/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java b/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java
index ae4e64ad6b..dd0a147d99 100644
--- a/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java
+++ b/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java
@@ -15,7 +15,7 @@
*/
package com.vaadin.tests.push;
-import java.util.Collection;
+import java.util.List;
import org.openqa.selenium.remote.DesiredCapabilities;
@@ -23,7 +23,7 @@ import com.vaadin.tests.tb3.WebsocketTest;
public class BasicPushWebsocketTest extends BasicPushTest {
@Override
- public Collection<DesiredCapabilities> getBrowsersToTest() {
+ public List<DesiredCapabilities> getBrowsersToTest() {
return WebsocketTest.getWebsocketBrowsers();
}
} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index 7584f36e28..fbb04c2022 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -17,8 +17,8 @@
package com.vaadin.tests.tb3;
import java.net.URL;
-import java.util.Collection;
import java.util.Collections;
+import java.util.List;
import java.util.logging.Logger;
import org.junit.After;
@@ -214,8 +214,8 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
*
* @return The browsers to run the test on
*/
- public Collection<DesiredCapabilities> getBrowsersToTest() {
- return Collections.singleton(BrowserUtil
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ return Collections.singletonList(BrowserUtil
.firefox(MultiBrowserTest.TESTED_FIREFOX_VERSION));
}
diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java
index 4003539782..040d0156a3 100644
--- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java
+++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java
@@ -17,7 +17,7 @@
package com.vaadin.tests.tb3;
import java.util.ArrayList;
-import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import org.openqa.selenium.remote.DesiredCapabilities;
@@ -57,19 +57,20 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration {
// Re-enable this when it is possible to run on a modern Opera version
// (15+)
// allBrowsers.add(BrowserUtil.opera(15));
-
}
/**
* @return all supported browsers which are actively tested
*/
public static List<DesiredCapabilities> getAllBrowsers() {
- return allBrowsers;
+ return Collections.unmodifiableList(allBrowsers);
}
@Override
- public Collection<DesiredCapabilities> getBrowsersToTest() {
- return allBrowsers;
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ // Return a copy so sub classes can do
+ // super.getBrowseresToTest().remove(something)
+ return new ArrayList<DesiredCapabilities>(getAllBrowsers());
}
}
diff --git a/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java b/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java
index 5c6ea329f5..26fef667cd 100644
--- a/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java
+++ b/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java
@@ -20,7 +20,6 @@
package com.vaadin.tests.tb3;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -44,8 +43,8 @@ public abstract class WebsocketTest extends PrivateTB3Configuration {
* @return All supported browsers which are actively tested and support
* websockets
*/
- public static Collection<DesiredCapabilities> getWebsocketBrowsers() {
- return Collections.unmodifiableCollection(websocketBrowsers);
+ public static List<DesiredCapabilities> getWebsocketBrowsers() {
+ return Collections.unmodifiableList(websocketBrowsers);
}
/*
@@ -54,7 +53,7 @@ public abstract class WebsocketTest extends PrivateTB3Configuration {
* @see com.vaadin.tests.tb3.AbstractTB3Test#getBrowserToRunOn()
*/
@Override
- public Collection<DesiredCapabilities> getBrowsersToTest() {
- return getWebsocketBrowsers();
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ return new ArrayList<DesiredCapabilities>(getWebsocketBrowsers());
}
}