Mercurial > hg > release > icedtea-web-1.8
changeset 593:4d294d8ea881
PR909: Unit test fix
author | Saad Mohammad <smohammad@redhat.com> |
---|---|
date | Thu, 20 Dec 2012 15:51:45 -0500 |
parents | 95fc28e972ad |
children | a24c48429ff1 |
files | ChangeLog tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java |
diffstat | 2 files changed, 12 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Dec 20 15:46:26 2012 -0500 +++ b/ChangeLog Thu Dec 20 15:51:45 2012 -0500 @@ -1,3 +1,8 @@ +2012-12-20 Saad Mohammad <smohammad@redhat.com> + + * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: + Added test and changes to work better with PR909 fix. + 2012-12-20 Saad Mohammad <smohammad@redhat.com> Fix PR909 - URL is invalid after normalization.
--- a/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java Thu Dec 20 15:46:26 2012 -0500 +++ b/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java Thu Dec 20 15:51:45 2012 -0500 @@ -38,6 +38,7 @@ import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; +import java.net.URISyntaxException; import java.net.URL; import org.junit.Assert; import org.junit.Test; @@ -61,22 +62,23 @@ } } - private static URL normalizeUrl(URL uRL) throws MalformedURLException, UnsupportedEncodingException { + private static URL normalizeUrl(URL uRL) throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { return ResourceTracker.normalizeUrl(uRL, false); } - public static final int CHANGE_BORDER = 7; + public static final int CHANGE_BORDER = 6; public static URL[] getUrls() throws MalformedURLException { URL[] u = { /*constant*/ null, - new URL("http://localhost:44321/Spaces%20Can%20Be%20Everyw%2Fhere1.jnlp"), new URL("file:///home/jvanek/Desktop/icedtea-web/tests.build/jnlp_test_server/Spaces%20can%20be%20everywhere2.jnlp"), - new URL("http://localhost/Spaces+Can+Be+Everywhere1.jnlp"), new URL("http://localhost:44321/SpacesCanBeEverywhere1.jnlp"), new URL("http:///SpacesCanBeEverywhere1.jnlp"), new URL("file://localhost/home/jvanek/Desktop/icedtea-web/tests.build/jnlp_test_server/Spaces can be everywhere2.jnlp"), + new URL("http://localhost:44321/testpage.jnlp?applicationID=25"), /*changing*/ + new URL("http://localhost:44321/Spaces%20Can%20Be%20Everyw%2Fhere1.jnlp"), + new URL("http://localhost/Spaces+Can+Be+Everywhere1.jnlp"), new URL("http://localhost/SpacesC anBeEverywhere1.jnlp?a=5&b=10#df"), new URL("http:///oook.jnlp?a=5&b=ahoj šš dd#df"), new URL("http://localhost/Spacesěčšžšřýžčřú can !@^*(){}[].jnlp?a=5&ahoj šš dd#df"), @@ -85,7 +87,7 @@ return u; } - public static URL[] getNormalizedUrls() throws MalformedURLException, UnsupportedEncodingException { + public static URL[] getNormalizedUrls() throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { URL[] u = getUrls(); URL[] n = new URL[u.length];