]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add favicon.ico to Valo. (#14781)
authorSauli Tähkäpää <sauli@vaadin.com>
Wed, 1 Oct 2014 13:01:17 +0000 (16:01 +0300)
committerVaadin Code Review <review@vaadin.com>
Tue, 7 Oct 2014 13:10:37 +0000 (13:10 +0000)
Change-Id: Ic0c5152d634dfc8f07890cfee18bbebd6e54bbc3

WebContent/VAADIN/themes/valo/favicon.ico [new file with mode: 0644]
uitest/src/com/vaadin/tests/themes/FaviconTest.java [new file with mode: 0644]

diff --git a/WebContent/VAADIN/themes/valo/favicon.ico b/WebContent/VAADIN/themes/valo/favicon.ico
new file mode 100644 (file)
index 0000000..ffb34a6
Binary files /dev/null and b/WebContent/VAADIN/themes/valo/favicon.ico differ
diff --git a/uitest/src/com/vaadin/tests/themes/FaviconTest.java b/uitest/src/com/vaadin/tests/themes/FaviconTest.java
new file mode 100644 (file)
index 0000000..31134f6
--- /dev/null
@@ -0,0 +1,60 @@
+package com.vaadin.tests.themes;
+
+import com.vaadin.tests.tb3.SingleBrowserTest;
+import org.junit.Test;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.fail;
+
+//Extending SingleBrowserTest just to include the test into our test suites.
+public class FaviconTest extends SingleBrowserTest {
+
+    @Test
+    public void chameleonHasFavicon() {
+        assertThatThemeHasFavicon("chameleon");
+    }
+
+    @Test
+    public void liferayHasFavicon() {
+        assertThatThemeHasFavicon("liferay");
+    }
+
+    @Test
+    public void runoHasFavicon() {
+        assertThatThemeHasFavicon("runo");
+    }
+
+    @Test
+    public void reindeerHasFavicon() {
+        assertThatThemeHasFavicon("reindeer");
+    }
+
+    @Test
+    public void valoHasFavicon() {
+        assertThatThemeHasFavicon("valo");
+    }
+
+    private void assertThatThemeHasFavicon(String theme) {
+        assertThat(getResponseCode(theme), is(200));
+    }
+
+    private int getResponseCode(String theme) {
+        try {
+            URL url = new URL(String.format("%s/VAADIN/themes/%s/favicon.ico", getBaseURL(), theme));
+            HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+            connection.setRequestMethod("GET");
+            connection.connect();
+
+            return connection.getResponseCode();
+
+        } catch (Exception e) {
+            fail(e.getMessage());
+        }
+
+        return 0;
+    }
+}