aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2015-03-30 17:13:12 +0300
committerVaadin Code Review <review@vaadin.com>2015-04-07 10:07:58 +0000
commite56d11aa71f88444c3f109c65f0b7424bf2a8638 (patch)
tree81283833ef82f3a88857e13f1df8cd3e6a4f1fff
parentac6e06d57972601b4172b06a59076323e086a8b9 (diff)
downloadvaadin-framework-e56d11aa71f88444c3f109c65f0b7424bf2a8638.tar.gz
vaadin-framework-e56d11aa71f88444c3f109c65f0b7424bf2a8638.zip
Add test for #17267
Change-Id: I0b9e5c1376176e591cb1e13bfbd9594f54409e56
-rw-r--r--server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java b/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java
index 05b2484767..9b01188aea 100644
--- a/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java
+++ b/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java
@@ -227,6 +227,25 @@ public class DesignFormatterTest {
assertEquals(zone, result);
}
+ @Test
+ public void testExternalResource() {
+ String url = "://example.com/my%20icon.png?a=b";
+
+ for (String scheme : new String[] { "http", "https", "ftp", "ftps" }) {
+ Resource resource = formatter.parse(scheme + url, Resource.class);
+
+ assertTrue(scheme + " url should be parsed as ExternalResource",
+ resource instanceof ExternalResource);
+ assertEquals("parsed ExternalResource", scheme + url,
+ ((ExternalResource) resource).getURL());
+
+ String formatted = formatter.format(new ExternalResource(scheme
+ + url));
+
+ assertEquals("formatted ExternalResource", scheme + url, formatted);
+ }
+ }
+
/**
* A static method to allow comparison two different actions.
*