summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2014-11-20 13:04:08 +0200
committerSauli Tähkäpää <sauli@vaadin.com>2014-11-20 13:04:08 +0200
commitbd4c7aa5407951f635e4af17436a6b00e4a8c130 (patch)
tree295bc597d603c6494b13571354e2ca3a433f3659 /uitest
parentacf88c8ea269404b38e13ae94ad570b3e091a003 (diff)
downloadvaadin-framework-bd4c7aa5407951f635e4af17436a6b00e4a8c130.tar.gz
vaadin-framework-bd4c7aa5407951f635e4af17436a6b00e4a8c130.zip
Fix duplicate detection in test locator.
Change-Id: I9a6ebfda4e8b09927eb22bec6ddf2989b8104070
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AffectedTB3TestLocator.java21
-rw-r--r--uitest/src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java5
-rw-r--r--uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java2
3 files changed, 12 insertions, 16 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/AffectedTB3TestLocator.java b/uitest/src/com/vaadin/tests/tb3/AffectedTB3TestLocator.java
index a3bee26675..9dfae77ca5 100644
--- a/uitest/src/com/vaadin/tests/tb3/AffectedTB3TestLocator.java
+++ b/uitest/src/com/vaadin/tests/tb3/AffectedTB3TestLocator.java
@@ -17,7 +17,9 @@ package com.vaadin.tests.tb3;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
public class AffectedTB3TestLocator extends TB3TestLocator {
@@ -42,21 +44,14 @@ public class AffectedTB3TestLocator extends TB3TestLocator {
private <T> List<Class<? extends T>> getAffectedTestClasses(
List<Class<? extends T>> allTestClasses,
List<Class<? extends T>> changedTestClasses) throws IOException {
- List<Class<? extends T>> affectedWithPackageTestClasses = getTestClassesWithAffectedPackageName(allTestClasses);
- List<Class<? extends T>> affectedTestClasses = new ArrayList<Class<? extends T>>();
- affectedTestClasses.addAll(affectedWithPackageTestClasses);
- // Removing duplicate entries before adding changed test classes.
- for (Class<? extends T> changedTestClass : changedTestClasses) {
- for (Class<? extends T> affectedTestClass : affectedWithPackageTestClasses) {
- if (!changedTestClass.getName().equals(
- affectedTestClass.getName())) {
- affectedTestClasses.add(changedTestClass);
+ Set testClasses = new HashSet(changedTestClasses);
+ testClasses
+ .addAll(getTestClassesWithAffectedPackageName(allTestClasses));
+
+ List<Class<? extends T>> affectedTestClasses = new ArrayList<Class<? extends T>>();
+ affectedTestClasses.addAll(testClasses);
- break;
- }
- }
- }
return affectedTestClasses;
}
diff --git a/uitest/src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java b/uitest/src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java
index a2f8ceeefa..a6f2e5191a 100644
--- a/uitest/src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java
+++ b/uitest/src/com/vaadin/tests/tb3/ChangedTB3TestLocator.java
@@ -113,13 +113,14 @@ public class ChangedTB3TestLocator extends TB3TestLocator {
}
private boolean pathIsExcluded(String path) {
- // Exclude temporary junit files and screeenshots.
+ // Exclude temporary junit files and screenshots.
return path.startsWith("uitest/junit")
|| getScreenshotDirectory().contains(path);
}
private String getScreenshotDirectory() {
- return System.getProperty(PrivateTB3Configuration.SCREENSHOT_DIRECTORY);
+ return PrivateTB3Configuration
+ .getProperty(PrivateTB3Configuration.SCREENSHOT_DIRECTORY);
}
private List<DiffEntry> getDiffsInHead(Repository repository)
diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
index f2f4af3910..32d0f1065c 100644
--- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
+++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
@@ -67,7 +67,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
}
}
- private static String getProperty(String name) {
+ protected static String getProperty(String name) {
String property = properties.getProperty(name);
if (property == null) {
property = System.getProperty(name);