summaryrefslogtreecommitdiffstats
path: root/tests/server-side
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2012-06-19 14:48:49 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2012-06-19 14:48:49 +0300
commita821f9fdd5b853409c7f7c3a22eba0733e2900c6 (patch)
tree94afcb8342d1e7174741e90fa0bd20c0b0d51bfc /tests/server-side
parentd3a13928a8f856ae3bff668db7f13d6f60f7a358 (diff)
parent1401003a10eb328995b92351e9f716fce705dfc8 (diff)
downloadvaadin-framework-a821f9fdd5b853409c7f7c3a22eba0733e2900c6.tar.gz
vaadin-framework-a821f9fdd5b853409c7f7c3a22eba0733e2900c6.zip
Merge branch '6.8'
Conflicts: src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/VDragAndDropWrapper.java src/com/vaadin/terminal/gwt/client/ui/form/VForm.java src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java tests/server-side/com/vaadin/tests/VaadinClasses.java Removed Java5-incompatible @Override annotations
Diffstat (limited to 'tests/server-side')
-rw-r--r--tests/server-side/com/vaadin/tests/VaadinClasses.java14
-rw-r--r--tests/server-side/com/vaadin/tests/server/TestThemeNames.java38
2 files changed, 50 insertions, 2 deletions
diff --git a/tests/server-side/com/vaadin/tests/VaadinClasses.java b/tests/server-side/com/vaadin/tests/VaadinClasses.java
index b74af660e4..0ee193e8f1 100644
--- a/tests/server-side/com/vaadin/tests/VaadinClasses.java
+++ b/tests/server-side/com/vaadin/tests/VaadinClasses.java
@@ -15,8 +15,6 @@ import java.util.Enumeration;
import java.util.List;
import java.util.jar.JarEntry;
-import org.junit.Test;
-
import com.vaadin.Application;
import com.vaadin.ui.Component;
import com.vaadin.ui.ComponentContainer;
@@ -29,6 +27,9 @@ import com.vaadin.ui.PopupView;
import com.vaadin.ui.Root;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.ui.Window;
+import com.vaadin.ui.themes.BaseTheme;
+
+import org.junit.Test;
@SuppressWarnings("deprecation")
public class VaadinClasses {
@@ -71,6 +72,15 @@ public class VaadinClasses {
}
}
+ public static List<Class<? extends BaseTheme>> getThemeClasses() {
+ try {
+ return findClasses(BaseTheme.class, "com.vaadin.ui.themes");
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
public static List<Class<? extends Object>> getAllServerSideClasses() {
try {
return findClassesNoTests(Object.class, "com.vaadin", new String[] {
diff --git a/tests/server-side/com/vaadin/tests/server/TestThemeNames.java b/tests/server-side/com/vaadin/tests/server/TestThemeNames.java
new file mode 100644
index 0000000000..22fe315730
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/server/TestThemeNames.java
@@ -0,0 +1,38 @@
+package com.vaadin.tests.server;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import com.vaadin.tests.VaadinClasses;
+import com.vaadin.ui.themes.BaseTheme;
+
+public class TestThemeNames extends TestCase {
+ public void testThemeNames() {
+ File baseDir = new File(SourceFileChecker.getBaseDir()
+ + "WebContent/VAADIN/themes/");
+
+ List<Class<? extends BaseTheme>> themeClasses = VaadinClasses
+ .getThemeClasses();
+ for (Class<? extends BaseTheme> themeClass : themeClasses) {
+ try {
+ Field field = themeClass.getField("THEME_NAME");
+ String themeName = (String) field.get(null);
+
+ File themeDir = new File(baseDir, themeName);
+ File styleFile = new File(themeDir, "styles.css");
+
+ assertTrue("Can't find " + styleFile + " for theme "
+ + themeClass.getName(), styleFile.exists());
+
+ // Test that casing matches
+ assertEquals(themeDir.getCanonicalFile().getName(), themeName);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+}