summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorluccioman <luccioman@users.noreply.github.com>2017-11-20 18:47:46 +0100
committerluccioman <luccioman@users.noreply.github.com>2017-11-20 18:47:46 +0100
commit7206f1ed711008ef529d6f103f003cccfdab99b2 (patch)
tree8eb88f764da07a1478f47e0e81fe1991f788a2a1 /test
parent398c66f06c9d2db6a2bbd1e873316baebd04a914 (diff)
Do locale neutral case conversions on domain names.
Required to properly run on systems with default locale set to Turkish language, as with this locale the 'i' character has different upper and lower case flavors than with other locales.
Diffstat (limited to 'test')
-rw-r--r--test/java/net/yacy/cora/protocol/DomainsTest.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/java/net/yacy/cora/protocol/DomainsTest.java b/test/java/net/yacy/cora/protocol/DomainsTest.java
index 26bea5fd1..0dc801a5e 100644
--- a/test/java/net/yacy/cora/protocol/DomainsTest.java
+++ b/test/java/net/yacy/cora/protocol/DomainsTest.java
@@ -34,7 +34,7 @@ public class DomainsTest {
*/
@Test
public void testStripToPort() {
- Map<String, Integer> testHost = new HashMap();
+ Map<String, Integer> testHost = new HashMap<>();
// key = teststring, value = expected port
testHost.put("[3ffe:2a00:100:7031::1]:80", 80);
testHost.put("https://[3ffe:2a00:100:7031::1]:80/test.html", 80);
@@ -56,7 +56,7 @@ public class DomainsTest {
*/
@Test
public void testStripToHostName() {
- Map<String, String> testHost = new HashMap();
+ Map<String, String> testHost = new HashMap<>();
// key = teststring, value = expected host
testHost.put("[3ffe:2a00:100:7031::1]:80", "3ffe:2a00:100:7031::1");
testHost.put("https://[3ffe:2a00:100:7032::1]:80/test.html", "3ffe:2a00:100:7032::1");
@@ -75,6 +75,10 @@ public class DomainsTest {
testHost.put("test7.org/test.html", "test7.org");
testHost.put("test8.org:80/test.html", "test8.org");
testHost.put("test9.org:7777/test.html", "test9.org");
+
+ /* Check also host name case incensivity */
+ testHost.put("HTTP://TEST10.INFO/test.html", "test10.info");
+ testHost.put("http://TEST11.IN:7777/test.html", "test11.in");
for (String teststr : testHost.keySet()) {
String host = Domains.stripToHostName(teststr);