summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-11-29 18:40:35 +0200
committerVaadin Code Review <review@vaadin.com>2013-11-30 07:49:30 +0000
commitea46029ea154cc018525219f06095817339607e8 (patch)
treeaacc7a415f4e42904496d1d92ecd082272ce94c3
parent12b6a8b42f3327e315e617e015304c4cc9dd4fa8 (diff)
downloadvaadin-framework-ea46029ea154cc018525219f06095817339607e8.tar.gz
vaadin-framework-ea46029ea154cc018525219f06095817339607e8.zip
Allow excluding test from the standard test suite
Mostly useful for very long running tests Change-Id: I9027f981da0a1e6ba464196449f2a9c27e965d2f
-rw-r--r--uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java28
-rw-r--r--uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java18
2 files changed, 46 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java b/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java
new file mode 100644
index 0000000000..722b643f78
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.tb3;
+
+/**
+ * Marker interface for a TB3+ test class which will exclude the test from any
+ * test suite which automatically scans for test classes. Mostly useful for long
+ * tests which should not be run in every build.
+ *
+ * @since 7.1.10
+ * @author Vaadin Ltd
+ */
+public @interface ExcludeFromSuite {
+
+}
diff --git a/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java b/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java
index e1c8edfd60..f1576a9393 100644
--- a/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java
+++ b/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java
@@ -223,6 +223,10 @@ public class TB3TestSuite extends Suite {
if (!baseClass.isAssignableFrom(c)) {
return;
}
+ if (!includeInSuite(c)) {
+ return;
+ }
+
if (!Modifier.isAbstract(c.getModifiers()) && !c.isAnonymousClass()) {
result.add((Class<? extends T>) c);
}
@@ -235,4 +239,18 @@ public class TB3TestSuite extends Suite {
}
+ /**
+ * @return true if the class should be included in the suite, false if not
+ */
+ private static boolean includeInSuite(Class<?> c) {
+ if (c.getAnnotation(ExcludeFromSuite.class) != null) {
+ return false;
+ }
+ if (c == Object.class) {
+ return true;
+ }
+
+ return includeInSuite(c.getSuperclass());
+ }
+
} \ No newline at end of file