From 488b4694519ee5d3451a5a6d70868d74b9cd8682 Mon Sep 17 00:00:00 2001 From: Sauli Tähkäpää Date: Fri, 14 Nov 2014 21:15:55 +0200 Subject: Make junit.test.suite a property. Change-Id: I3dd66e5f11a99efc3777513dc0e2989e8007c9c1 --- .../src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java | 17 ++++++++++++++--- .../com/vaadin/tests/tb3/PrivateTB3Configuration.java | 17 +++++++++++------ uitest/tb3test.xml | 6 ++---- 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 diffsInWorkingTree = new ArrayList(); 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 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="); + "No screenshot directory defined. Use -D" + + SCREENSHOT_DIRECTORY + "="); } 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 @@ + @@ -18,13 +19,10 @@ - - - + - -- cgit v1.2.3