diff options
| author | reger <reger18@arcor.de> | 2015-03-15 00:46:07 +0100 |
|---|---|---|
| committer | reger <reger18@arcor.de> | 2015-03-15 00:46:07 +0100 |
| commit | 1d81bd0687674c31482ccd52ba2d291b3cb9346e (patch) | |
| tree | 64eeb0f50bd061c598121c122b6a20f3c46b5358 /test/net | |
| parent | 62087fb8b26252e08c1310f5fb7848d16c2c572d (diff) | |
fix url encoding for path see http://mantis.tokeek.de/view.php?id=559
So far we used same escape procedure for all parts of the url (which includes x-www-form-urlencoded for all url components)
Added capability to use different encoding rules for the different url components (through specific bitset for each component).
(this is inspired by org.apache.http.client and java.net.uri implementation).
- Added test case for http://mantis.tokeek.de/view.php?id=559
Diffstat (limited to 'test/net')
| -rw-r--r-- | test/net/yacy/cora/document/id/MultiProtocolURLTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/net/yacy/cora/document/id/MultiProtocolURLTest.java b/test/net/yacy/cora/document/id/MultiProtocolURLTest.java index e3c7f5a2d..c29b9700b 100644 --- a/test/net/yacy/cora/document/id/MultiProtocolURLTest.java +++ b/test/net/yacy/cora/document/id/MultiProtocolURLTest.java @@ -151,7 +151,8 @@ public class MultiProtocolURLTest { String[][] testStrings = new String[][]{ // teststring , expectedresult new String[]{"http://www.heise.de/newsticker/thema/%23saukontrovers", "http://www.heise.de/newsticker/thema/%23saukontrovers"}, // http://mantis.tokeek.de/view.php?id=519 - new String[]{"http://www.heise.de/newsticker/thema/#saukontrovers", "http://www.heise.de/newsticker/thema/"} + new String[]{"http://www.heise.de/newsticker/thema/#saukontrovers", "http://www.heise.de/newsticker/thema/"}, + new String[]{"http://www.liferay.com/community/wiki/-/wiki/Main/Wiki+Portlet", "http://www.liferay.com/community/wiki/-/wiki/Main/Wiki+Portlet"} // http://mantis.tokeek.de/view.php?id=559 }; for (String[] testString : testStrings) { @@ -159,10 +160,10 @@ public class MultiProtocolURLTest { System.out.print("orig uri: " + testString[0]); String shouldBe = testString[1]; // conversion result - String resolvedHost = new MultiProtocolURL(testString[0]).toNormalform(true); + String resultUrl = new MultiProtocolURL(testString[0]).toNormalform(true); // test if equal - assertEquals(shouldBe, resolvedHost); - System.out.println(" -> " + resolvedHost); + assertEquals(shouldBe, resultUrl); + System.out.println(" -> " + resultUrl); } } } |
