Browse Source

Add test for #17267

Change-Id: I0b9e5c1376176e591cb1e13bfbd9594f54409e56
tags/7.5.0.beta1
Johannes Dahlström 9 years ago
parent
commit
e56d11aa71
1 changed files with 19 additions and 0 deletions
  1. 19
    0
      server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java

+ 19
- 0
server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java View File

@@ -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.
*

Loading…
Cancel
Save