aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2014-11-14 21:15:55 +0200
committerSauli Tähkäpää <sauli@vaadin.com>2014-11-15 14:00:46 +0200
commit488b4694519ee5d3451a5a6d70868d74b9cd8682 (patch)
treef3c7d2996462848441b77b7fd8b59ca38e64fa50
parentc4075e1f2fe0b35a7f90564c4315f03403826caa (diff)
downloadvaadin-framework-488b4694519ee5d3451a5a6d70868d74b9cd8682.tar.gz
vaadin-framework-488b4694519ee5d3451a5a6d70868d74b9cd8682.zip
Make junit.test.suite a property.
Change-Id: I3dd66e5f11a99efc3777513dc0e2989e8007c9c1
-rw-r--r--uitest/src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java17
-rw-r--r--uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java17
-rw-r--r--uitest/tb3test.xml6
3 files changed, 27 insertions, 13 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java b/uitest/src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java
index b425de48b5..a2f8ceeefa 100644
--- a/uitest/src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java
+++ b/uitest/src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java
@@ -102,15 +102,26 @@ public class ChangedTB3TestLocator extends TB3TestLocator {
List<DiffEntry> diffsInWorkingTree = new ArrayList<DiffEntry>();
for (DiffEntry diff : diffCommand.call()) {
- // Exclude temporary junit files.
- if (!diff.getNewPath().startsWith("uitest/junit")) {
- diffsInWorkingTree.add(diff);
+ if (pathIsExcluded(diff.getNewPath())) {
+ continue;
}
+
+ diffsInWorkingTree.add(diff);
}
return diffsInWorkingTree;
}
+ private boolean pathIsExcluded(String path) {
+ // Exclude temporary junit files and screeenshots.
+ return path.startsWith("uitest/junit")
+ || getScreenshotDirectory().contains(path);
+ }
+
+ private String getScreenshotDirectory() {
+ return System.getProperty(PrivateTB3Configuration.SCREENSHOT_DIRECTORY);
+ }
+
private List<DiffEntry> getDiffsInHead(Repository repository)
throws AmbiguousObjectException, IncorrectObjectTypeException,
IOException, MissingObjectException {
diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
index a4bb85bb53..f2f4af3910 100644
--- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
+++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
@@ -42,10 +42,14 @@ import com.vaadin.tests.tb3.MultiBrowserTest.Browser;
* Provides values for parameters which depend on where the test is run.
* Parameters should be configured in work/eclipse-run-selected-test.properties.
* A template is available in uitest/.
- *
+ *
* @author Vaadin Ltd
*/
public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
+ /**
+ *
+ */
+ public static final String SCREENSHOT_DIRECTORY = "com.vaadin.testbench.screenshot.directory";
private static final String RUN_LOCALLY_PROPERTY = "com.vaadin.testbench.runLocally";
private static final String HOSTNAME_PROPERTY = "com.vaadin.testbench.deployment.hostname";
private static final String PORT_PROPERTY = "com.vaadin.testbench.deployment.port";
@@ -84,10 +88,11 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
@Override
protected String getScreenshotDirectory() {
- String screenshotDirectory = getProperty("com.vaadin.testbench.screenshot.directory");
+ String screenshotDirectory = getProperty(SCREENSHOT_DIRECTORY);
if (screenshotDirectory == null) {
throw new RuntimeException(
- "No screenshot directory defined. Use -Dcom.vaadin.testbench.screenshot.directory=<path>");
+ "No screenshot directory defined. Use -D"
+ + SCREENSHOT_DIRECTORY + "=<path>");
}
return screenshotDirectory;
}
@@ -116,7 +121,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
/**
* Gets the hostname that tests are configured to use.
- *
+ *
* @return the host name configuration value
*/
public static String getConfiguredDeploymentHostname() {
@@ -136,7 +141,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
/**
* Gets the port that tests are configured to use.
- *
+ *
* @return the port configuration value
*/
public static int getConfiguredDeploymentPort() {
@@ -153,7 +158,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
/**
* Tries to automatically determine the IP address of the machine the test
* is running on.
- *
+ *
* @return An IP address of one of the network interfaces in the machine.
* @throws RuntimeException
* if there was an error or no IP was found
diff --git a/uitest/tb3test.xml b/uitest/tb3test.xml
index 975298926e..ecacf43ee2 100644
--- a/uitest/tb3test.xml
+++ b/uitest/tb3test.xml
@@ -9,6 +9,7 @@
<property name="categories.exclude" value="" />
<property name="useLocalWebDriver" value="false" />
<property name="com.vaadin.testbench.max.retries" value="0" />
+ <property name="junit.test.suite" value="com.vaadin.tests.tb3.AllTB3Tests" />
<ivy:resolve file="${tb3test.dir}/ivy.xml" conf="build, build-provided" />
<ivy:cachepath pathid="classpath.tb3.lib" conf="build, build-provided" />
@@ -18,13 +19,10 @@
</path>
<target name="run-all-tb3-tests" unless="tests.tb3.skip" description="Run all the TB3 tests (except server tests) in the project">
- <antcall target="run-tb3-suite">
- <param name="junit.test.suite" value="com.vaadin.tests.tb3.AllTB3Tests" />
- </antcall>
+ <antcall target="run-tb3-suite" />
</target>
<target name="run-tb3-suite">
- <fail unless="junit.test.suite" message="Define suite to run using junit.test.suite" />
<fail unless="com.vaadin.testbench.screenshot.directory" message="Define screenshot directory using -Dcom.vaadin.testbench.screenshot.directory" />
<delete dir="${report.dir}" />
<mkdir dir="${report.dir}" />