From 6ae7843e46ee906adfc99bde71ded5f296caea74 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Tue, 22 Jul 2014 10:24:57 +0300 Subject: Simulate @RunLocally using eclipse-run-selected-test.properties (#14272) Change-Id: I4eb9409629f64c17f39b1560062e763270f1f582 --- uitest/src/com/vaadin/tests/tb3/TB3Runner.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'uitest/src/com/vaadin/tests/tb3/TB3Runner.java') diff --git a/uitest/src/com/vaadin/tests/tb3/TB3Runner.java b/uitest/src/com/vaadin/tests/tb3/TB3Runner.java index 4d29e479e2..5b5a6dcf39 100644 --- a/uitest/src/com/vaadin/tests/tb3/TB3Runner.java +++ b/uitest/src/com/vaadin/tests/tb3/TB3Runner.java @@ -37,7 +37,7 @@ import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.tests.annotations.TestCategory; import com.vaadin.tests.tb3.AbstractTB3Test.BrowserUtil; -import com.vaadin.tests.tb3.AbstractTB3Test.RunLocally; +import com.vaadin.tests.tb3.MultiBrowserTest.Browser; /** * This runner is loosely based on FactoryTestRunner by Ted Young @@ -185,17 +185,17 @@ public class TB3Runner extends BlockJUnit4ClassRunner { /* * Returns a list of desired browser capabilities according to browsers * defined in the test class, filtered by possible filter parameters. Use - * {@code @RunLocally} annotation to override all capabilities. + * {@code @RunLocally} annotation or com.vaadin.testbench.runLocally + * property to override all capabilities. */ private Collection getDesiredCapabilities( AbstractTB3Test testClassInstance) { Collection desiredCapabilites = getFilteredCapabilities(testClassInstance); - if (isRunLocally(testClassInstance)) { + Browser runLocallyBrowser = testClassInstance.getRunLocallyBrowser(); + if (runLocallyBrowser != null) { desiredCapabilites = new ArrayList(); - desiredCapabilites.add(testClassInstance.getClass() - .getAnnotation(RunLocally.class).value() - .getDesiredCapabilities()); + desiredCapabilites.add(runLocallyBrowser.getDesiredCapabilities()); } return desiredCapabilites; @@ -237,10 +237,6 @@ public class TB3Runner extends BlockJUnit4ClassRunner { return filteredCapabilities; } - private boolean isRunLocally(AbstractTB3Test testClassInstance) { - return testClassInstance.getClass().getAnnotation(RunLocally.class) != null; - } - private AbstractTB3Test getTestClassInstance() throws InstantiationException, IllegalAccessException, InvocationTargetException { -- cgit v1.2.3