diff options
| author | Michael Peter Christen <mc@yacy.net> | 2024-07-21 18:02:58 +0200 |
|---|---|---|
| committer | Michael Peter Christen <mc@yacy.net> | 2024-07-21 18:02:58 +0200 |
| commit | 910a496c9f657adaa8560d068c5a2e29d9bdd68a (patch) | |
| tree | 290e4dfeb3c1b57e5502add2c225e377b1027e68 /test/java | |
| parent | fd45ccf76ebb7f18f63ce508e43ff66d118f2cc3 (diff) | |
replaced http links with https
Diffstat (limited to 'test/java')
7 files changed, 53 insertions, 54 deletions
diff --git a/test/java/net/yacy/cora/document/id/MultiProtocolURLTest.java b/test/java/net/yacy/cora/document/id/MultiProtocolURLTest.java index c189cb67f..4162096c9 100644 --- a/test/java/net/yacy/cora/document/id/MultiProtocolURLTest.java +++ b/test/java/net/yacy/cora/document/id/MultiProtocolURLTest.java @@ -230,11 +230,11 @@ public class MultiProtocolURLTest { // some test url/uri with problems in the past String[][] testStrings = new String[][]{ // teststring , expectedresultkey, expectedresultvalue - new String[]{"http://yacy.net?&test", "test", ""}, + new String[]{"https://yacy.net?&test", "test", ""}, /* Encoded UTF-8 2 bytes characters parameter value */ new String[]{"https://zh.wikipedia.org/w/index.php?search=encodedlatinchars%C3%A0%C3%A4%C3%A2%C3%A9%C3%A8%C3%AF%C3%AE%C3%B4%C3%B6%C3%B9", "search", "encodedlatincharsàäâéèïîôöù"}, /* Non encoded UTF-8 2 bytes characters parameter value */ - new String[]{"http://yacy.net?query=unencodedlatincharsàäâéèïîôöù", "query", "unencodedlatincharsàäâéèïîôöù"}, + new String[]{"https://yacy.net?query=unencodedlatincharsàäâéèïîôöù", "query", "unencodedlatincharsàäâéèïîôöù"}, /* Encoded UTF-8 3 bytes characters parameter value */ new String[]{"https://zh.wikipedia.org/w/index.php?query=%E6%96%B9%E9%87%9D%E8%88%87%E6%8C%87%E5%BC%95", "query", "方針與指引"}, /* Non encoded UTF-8 3 bytes characters parameter value */ @@ -312,12 +312,12 @@ public class MultiProtocolURLTest { public void testToTokens() throws MalformedURLException { String[][] testStrings = new String[][]{ // test string , "expected tokens" - new String[]{"http://yacy.net?&test", "yacy net test"}, + new String[]{"https://yacy.net?&test", "yacy net test"}, new String[]{"http://example.net/camelCased/subpath1/PATH_EXAMPLE", "example net camelCased subpath1 PATH EXAMPLE camel Cased subpath 1"}, /* Encoded UTF-8 2 bytes characters parameter value */ new String[]{"https://zh.wikipedia.org/w/index.php?search=encodedlatinchars%C3%A0%C3%A4%C3%A2%C3%A9%C3%A8%C3%AF%C3%AE%C3%B4%C3%B6%C3%B9", "zh wikipedia org w index php search encodedlatincharsàäâéèïîôöù"}, /* Non encoded UTF-8 2 bytes characters parameter value */ - new String[]{"http://yacy.net?query=unencodedlatincharsàäâéèïîôöù", "yacy net query unencodedlatincharsàäâéèïîôöù"}, + new String[]{"https://yacy.net?query=unencodedlatincharsàäâéèïîôöù", "yacy net query unencodedlatincharsàäâéèïîôöù"}, /* Encoded UTF-8 3 bytes characters parameter value */ new String[]{"https://zh.wikipedia.org/w/index.php?query=%E6%96%B9%E9%87%9D%E8%88%87%E6%8C%87%E5%BC%95", "zh wikipedia org w index php query 方針與指引"}, /* Non encoded UTF-8 3 bytes characters parameter value */ diff --git a/test/java/net/yacy/crawler/data/CacheTest.java b/test/java/net/yacy/crawler/data/CacheTest.java index 3feb29c23..d1d25ad4b 100644 --- a/test/java/net/yacy/crawler/data/CacheTest.java +++ b/test/java/net/yacy/crawler/data/CacheTest.java @@ -99,7 +99,7 @@ public class CacheTest { @Test public void testGetContent() throws MalformedURLException, IOException { final ResponseHeader okResponse = new ResponseHeader(HttpStatus.SC_OK); - DigestURL url = new DigestURL("http://yacy.net"); + DigestURL url = new DigestURL("https://yacy.net"); byte[] urlHash = url.hash(); byte[] fileContent = TEXT_CONTENT.getBytes(StandardCharsets.UTF_8); @@ -129,10 +129,10 @@ public class CacheTest { * Store an entry larger than backend buffer sizes, likely to be flushed * to the file system */ - url = new DigestURL("http://json.org"); + url = new DigestURL("https://json.org"); urlHash = url.hash(); fileContent = generateFlushableContent(); - Cache.store(new DigestURL("http://json.org"), okResponse, fileContent); + Cache.store(new DigestURL("https://json.org"), okResponse, fileContent); Cache.commit(); /* content is in cache */ assertArrayEquals(fileContent, Cache.getContent(urlHash)); @@ -141,7 +141,7 @@ public class CacheTest { @Test public void testDelete() throws MalformedURLException, IOException { final ResponseHeader okResponse = new ResponseHeader(HttpStatus.SC_OK); - final DigestURL url = new DigestURL("http://yacy.net"); + final DigestURL url = new DigestURL("https://yacy.net"); final byte[] urlHash = url.hash(); final byte[] fileContent = TEXT_CONTENT.getBytes(StandardCharsets.UTF_8); @@ -189,7 +189,7 @@ public class CacheTest { @Test public void testClear() throws MalformedURLException, IOException { final ResponseHeader okResponse = new ResponseHeader(HttpStatus.SC_OK); - final DigestURL url = new DigestURL("http://yacy.net"); + final DigestURL url = new DigestURL("https://yacy.net"); final byte[] urlHash = url.hash(); byte[] fileContent = TEXT_CONTENT.getBytes(StandardCharsets.UTF_8); @@ -494,7 +494,7 @@ public class CacheTest { for (int count = 0; count < threads; count++) { List<DigestURL> urls = new ArrayList<>(); for (int i = 0; i < urlsPerThread; i++) { - urls.add(new DigestURL("http://yacy.net/" + i + "/" + count)); + urls.add(new DigestURL("https://yacy.net/" + i + "/" + count)); } CacheAccessTask thread = new CacheAccessTask(urls, steps, contentSize, sleepTime); thread.start(); diff --git a/test/java/net/yacy/data/wiki/WikiCodeTest.java b/test/java/net/yacy/data/wiki/WikiCodeTest.java index 1bb7c2fec..8a1d69346 100644 --- a/test/java/net/yacy/data/wiki/WikiCodeTest.java +++ b/test/java/net/yacy/data/wiki/WikiCodeTest.java @@ -169,14 +169,14 @@ public class WikiCodeTest { WikiCode wc = new WikiCode();
/* Unamed link */
- String result = wc.transform("http://wiki:8080", "[http://yacy.net]");
+ String result = wc.transform("http://wiki:8080", "[https://yacy.net]");
assertTrue(result.contains("<a"));
- assertTrue(result.contains("href=\"http://yacy.net\""));
+ assertTrue(result.contains("href=\"https://yacy.net\""));
/* Named link */
- result = wc.transform("http://wiki:8080", "[http://yacy.net YaCy]");
+ result = wc.transform("http://wiki:8080", "[https://yacy.net YaCy]");
assertTrue(result.contains("<a"));
- assertTrue(result.contains("href=\"http://yacy.net\""));
+ assertTrue(result.contains("href=\"https://yacy.net\""));
assertTrue(result.contains(">YaCy<"));
/* Lua Script array parameter : should not crash the transform process */
diff --git a/test/java/net/yacy/document/parser/GenericXMLParserTest.java b/test/java/net/yacy/document/parser/GenericXMLParserTest.java index 41115b304..9d84ac73a 100644 --- a/test/java/net/yacy/document/parser/GenericXMLParserTest.java +++ b/test/java/net/yacy/document/parser/GenericXMLParserTest.java @@ -279,7 +279,7 @@ public class GenericXMLParserTest { + "<html xmlns=\"http://www.w3.org/1999/xhtml\">" + "<head>" + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" + "<title>XHTML attributes URLs test</title>" + "</head>" + "<body>" - + "Here are YaCy<a href=\"http://yacy.net\">home page</a> and <a href=\"https://community.searchlab.eu\">International Forum</a>." + + "Here are YaCy<a href=\"https://yacy.net\">home page</a> and <a href=\"https://community.searchlab.eu\">International Forum</a>." + "And this is a relative link to a <a href=\"/document.html\">sub document</a>." + "</body>" + "</html>"; @@ -294,8 +294,8 @@ public class GenericXMLParserTest { final Collection<AnchorURL> detectedAnchors = documents[0].getAnchors(); assertNotNull(detectedAnchors); assertEquals(3, detectedAnchors.size()); - assertTrue(detectedAnchors.contains(new AnchorURL("http://www.w3.org/1999/xhtml"))); - assertTrue(detectedAnchors.contains(new AnchorURL("http://yacy.net"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://www.w3.org/1999/xhtml"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://yacy.net"))); assertTrue(detectedAnchors.contains(new AnchorURL("https://community.searchlab.eu"))); } finally { inStream.close(); @@ -315,7 +315,7 @@ public class GenericXMLParserTest { + "<html xmlns=\"http://www.w3.org/1999/xhtml\">" + "<head>" + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" + "<title>XHTML content URLs test</title>" + "</head>" + "<body>" + "Here are some YaCy links:" + "<dl>" - + "<dt>Home page</dt>" + "<dd>http://yacy.net</dd>" + "<dt>International Forum</dt>" + + "<dt>Home page</dt>" + "<dd>https://yacy.net</dd>" + "<dt>International Forum</dt>" + "<dd>https://community.searchlab.eu</dd>" + "</dl>" + "And this is a mention to a relative link : /document.html " + "</body>" + "</html>"; @@ -330,8 +330,8 @@ public class GenericXMLParserTest { final Collection<AnchorURL> detectedAnchors = documents[0].getAnchors(); assertNotNull(detectedAnchors); assertEquals(3, detectedAnchors.size()); - assertTrue(detectedAnchors.contains(new AnchorURL("http://www.w3.org/1999/xhtml"))); - assertTrue(detectedAnchors.contains(new AnchorURL("http://yacy.net"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://www.w3.org/1999/xhtml"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://yacy.net"))); assertTrue(detectedAnchors.contains(new AnchorURL("https://community.searchlab.eu"))); } finally { inStream.close(); @@ -373,7 +373,7 @@ public class GenericXMLParserTest { + "<html xmlns=\"http://www.w3.org/1999/xhtml\">" + "<head>" + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" + "<title>XHTML content URLs test</title>" + "</head>" + "<body>" + "<p>Here are some YaCy URLs: " - + "Home page : http://yacy.net - International Forum : " + + "Home page : https://yacy.net - International Forum : " + "https://community.searchlab.eu " + "and this is a mention to a relative URL : /document.html</p>" + "<p>Here are YaCy<a href=\"http://mantis.tokeek.de\">bug tracker</a> and <a href=\"https://wiki.yacy.net/index.php/\">Wiki</a>." @@ -395,10 +395,9 @@ public class GenericXMLParserTest { final Collection<AnchorURL> detectedAnchors = documents[0].getAnchors(); assertNotNull(detectedAnchors); assertEquals(5, detectedAnchors.size()); - assertTrue(detectedAnchors.contains(new AnchorURL("http://www.w3.org/1999/xhtml"))); - assertTrue(detectedAnchors.contains(new AnchorURL("http://yacy.net"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://www.w3.org/1999/xhtml"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://yacy.net"))); assertTrue(detectedAnchors.contains(new AnchorURL("https://community.searchlab.eu"))); - assertTrue(detectedAnchors.contains(new AnchorURL("http://mantis.tokeek.de"))); assertTrue(detectedAnchors.contains(new AnchorURL("https://wiki.yacy.net/index.php/"))); } finally { inStream.close(); @@ -418,8 +417,8 @@ public class GenericXMLParserTest { final Collection<AnchorURL> detectedAnchors = documents[0].getAnchors(); assertNotNull(detectedAnchors); assertEquals(2, detectedAnchors.size()); - assertTrue(detectedAnchors.contains(new AnchorURL("http://www.w3.org/1999/xhtml"))); - assertTrue(detectedAnchors.contains(new AnchorURL("http://yacy.net"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://www.w3.org/1999/xhtml"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://yacy.net"))); } finally { inStream.close(); } @@ -433,7 +432,7 @@ public class GenericXMLParserTest { .append("<title>XHTML content URLs test</title>") .append("</head>") .append("<body><p>Here are some YaCy URLs: ") - .append("Home page : http://yacy.net - International Forum : ") + .append("Home page : https://yacy.net - International Forum : ") .append("https://community.searchlab.eu ") .append("and this is a mention to a relative URL : /document.html</p>"); @@ -458,8 +457,8 @@ public class GenericXMLParserTest { final Collection<AnchorURL> detectedAnchors = documents[0].getAnchors(); assertNotNull(detectedAnchors); assertEquals(3, detectedAnchors.size()); - assertTrue(detectedAnchors.contains(new AnchorURL("http://www.w3.org/1999/xhtml"))); - assertTrue(detectedAnchors.contains(new AnchorURL("http://yacy.net"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://www.w3.org/1999/xhtml"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://yacy.net"))); assertTrue(detectedAnchors.contains(new AnchorURL("https://community.searchlab.eu"))); } finally { inStream.close(); diff --git a/test/java/net/yacy/document/parser/html/ContentScraperTest.java b/test/java/net/yacy/document/parser/html/ContentScraperTest.java index cdb4f3951..92ecfb072 100644 --- a/test/java/net/yacy/document/parser/html/ContentScraperTest.java +++ b/test/java/net/yacy/document/parser/html/ContentScraperTest.java @@ -173,7 +173,7 @@ public class ContentScraperTest { */ @Test public void testFindAbsoluteURLs() throws MalformedURLException { - final String[] urlStrings = { "http://yacy.net", "https://community.searchlab.eu", "https://en.wikipedia.org" }; + final String[] urlStrings = { "https://yacy.net", "https://community.searchlab.eu", "https://en.wikipedia.org" }; final List<AnchorURL> urls = new ArrayList<>(); for (final String urlString : urlStrings) { urls.add(new AnchorURL(urlString)); @@ -196,39 +196,39 @@ public class ContentScraperTest { } /* URLs surrounded with parenthesis */ - final String[] texts = { "(http://yacy.net)", "YaCy home page (http://yacy.net)", - "Nested parentheses (YaCy home page (http://yacy.net))", - "Text in parenthesis (example : http://yacy.net)", "A markdown link [YaCy home page](http://yacy.net)", - "A markdown [example](http://yacy.net \"YaCy home page\") inline link" }; + final String[] texts = { "(https://yacy.net)", "YaCy home page (https://yacy.net)", + "Nested parentheses (YaCy home page (https://yacy.net))", + "Text in parenthesis (example : https://yacy.net)", "A markdown link [YaCy home page](https://yacy.net)", + "A markdown [example](https://yacy.net \"YaCy home page\") inline link" }; for (final String text : texts) { final Collection<AnchorURL> detectedURLs = new ArrayList<>(); ContentScraper.findAbsoluteURLs(text, detectedURLs, null); Assert.assertEquals(1, detectedURLs.size()); - Assert.assertEquals(new AnchorURL("http://yacy.net"), detectedURLs.iterator().next()); + Assert.assertEquals(new AnchorURL("https://yacy.net"), detectedURLs.iterator().next()); } /* URLs surrounded with square brackets */ //http://[abcd:ef01:2345:6789:abcd:ef01:2345:6789]/ - final String[] squareBracketsTexts = { "[http://yacy.net]", "YaCy home page [http://yacy.net]", - "Nested brackets [YaCy home page [http://yacy.net]]", - "A mediawiki external link with different label [http://yacy.net YaCy home page]" }; + final String[] squareBracketsTexts = { "[https://yacy.net]", "YaCy home page [https://yacy.net]", + "Nested brackets [YaCy home page [https://yacy.net]]", + "A mediawiki external link with different label [https://yacy.net YaCy home page]" }; for(final String text : squareBracketsTexts) { final Collection<AnchorURL> detectedURLs = new ArrayList<>(); ContentScraper.findAbsoluteURLs(text, detectedURLs, null); Assert.assertEquals(1, detectedURLs.size()); - Assert.assertEquals(new AnchorURL("http://yacy.net"), detectedURLs.iterator().next()); + Assert.assertEquals(new AnchorURL("https://yacy.net"), detectedURLs.iterator().next()); } /* URLs surrounded with curly brackets */ //http://[abcd:ef01:2345:6789:abcd:ef01:2345:6789]/ - final String[] curlyBracketsTexts = { "{http://yacy.net}", "YaCy home page {http://yacy.net}", - "Nested brackets {YaCy home page {http://yacy.net}}", - "Text in brackets {example : http://yacy.net}" }; + final String[] curlyBracketsTexts = { "{https://yacy.net}", "YaCy home page {https://yacy.net}", + "Nested brackets {YaCy home page {https://yacy.net}}", + "Text in brackets {example : https://yacy.net}" }; for(final String text : curlyBracketsTexts) { final Collection<AnchorURL> detectedURLs = new ArrayList<>(); ContentScraper.findAbsoluteURLs(text, detectedURLs, null); Assert.assertEquals(1, detectedURLs.size()); - Assert.assertEquals(new AnchorURL("http://yacy.net"), detectedURLs.iterator().next()); + Assert.assertEquals(new AnchorURL("https://yacy.net"), detectedURLs.iterator().next()); } /* URL with parenthesis */ @@ -277,7 +277,7 @@ public class ContentScraperTest { */ @Test public void testFindAbsoluteURLsMaxURLs() throws MalformedURLException { - final String text = "Some test URLS : http://yacy.net - https://community.searchlab.eu - https://en.wikipedia.org"; + final String text = "Some test URLS : https://yacy.net - https://community.searchlab.eu - https://en.wikipedia.org"; /* No limit */ ArrayList<AnchorURL> detectedURLs = new ArrayList<>(); diff --git a/test/java/net/yacy/document/parser/html/IconEntryTest.java b/test/java/net/yacy/document/parser/html/IconEntryTest.java index ee4317735..3461cee75 100644 --- a/test/java/net/yacy/document/parser/html/IconEntryTest.java +++ b/test/java/net/yacy/document/parser/html/IconEntryTest.java @@ -81,7 +81,7 @@ public class IconEntryTest { sizes.add(new Dimension(16,16)); Dimension preferredSize = new Dimension(16, 16); - IconEntry icon = new IconEntry(new DigestURL("http://yacy.net"), rels, sizes); + IconEntry icon = new IconEntry(new DigestURL("https://yacy.net"), rels, sizes); Dimension result = icon.getClosestSize(preferredSize); Assert.assertEquals(preferredSize, result); @@ -103,14 +103,14 @@ public class IconEntryTest { /* Sizes set contains only one item */ sizes = new HashSet<>(); sizes.add(new Dimension(128,128)); - icon = new IconEntry(new DigestURL("http://yacy.net"), rels, sizes); + icon = new IconEntry(new DigestURL("https://yacy.net"), rels, sizes); preferredSize = new Dimension(1992, 1024); result = icon.getClosestSize(preferredSize); Assert.assertEquals(new Dimension(128, 128), result); /* Empty sizes set */ sizes = new HashSet<>(); - icon = new IconEntry(new DigestURL("http://yacy.net"), rels, sizes); + icon = new IconEntry(new DigestURL("https://yacy.net"), rels, sizes); preferredSize = new Dimension(16, 16); result = icon.getClosestSize(preferredSize); Assert.assertNull(result); @@ -120,7 +120,7 @@ public class IconEntryTest { sizes.add(new Dimension(128,128)); sizes.add(new Dimension(256,512)); sizes.add(new Dimension(16,16)); - icon = new IconEntry(new DigestURL("http://yacy.net"), rels, sizes); + icon = new IconEntry(new DigestURL("https://yacy.net"), rels, sizes); preferredSize = null; result = icon.getClosestSize(preferredSize); Assert.assertNull(result); @@ -137,7 +137,7 @@ public class IconEntryTest { sizes.add(new Dimension(256,512)); sizes.add(new Dimension(16,16)); - IconEntry icon = new IconEntry(new DigestURL("http://yacy.net"), rels, sizes); + IconEntry icon = new IconEntry(new DigestURL("https://yacy.net"), rels, sizes); String sizesStr = icon.sizesToString(); /* The set is not ordered, only check result contains what we expect */ Assert.assertTrue(sizesStr.contains("128x128")); @@ -149,14 +149,14 @@ public class IconEntryTest { sizes = new HashSet<>(); sizes.add(new Dimension(128,128)); - icon = new IconEntry(new DigestURL("http://yacy.net"), rels, sizes); + icon = new IconEntry(new DigestURL("https://yacy.net"), rels, sizes); sizesStr = icon.sizesToString(); Assert.assertEquals("128x128", sizesStr); /* Empty sizes set */ sizes = new HashSet<>(); - icon = new IconEntry(new DigestURL("http://yacy.net"), rels, sizes); + icon = new IconEntry(new DigestURL("https://yacy.net"), rels, sizes); sizesStr = icon.sizesToString(); Assert.assertTrue(sizesStr.isEmpty()); } @@ -172,7 +172,7 @@ public class IconEntryTest { Set<Dimension> sizes = new HashSet<>(); sizes.add(new Dimension(128,128)); - IconEntry icon = new IconEntry(new DigestURL("http://yacy.net"), rels, sizes); + IconEntry icon = new IconEntry(new DigestURL("https://yacy.net"), rels, sizes); String relStr = icon.relToString(); /* The set is not ordered, only check result contains what we expect */ Assert.assertTrue(relStr.contains(IconLinkRelations.ICON.getRelValue())); @@ -184,7 +184,7 @@ public class IconEntryTest { rels = new HashSet<>(); rels.add(IconLinkRelations.ICON.getRelValue()); - icon = new IconEntry(new DigestURL("http://yacy.net"), rels, sizes); + icon = new IconEntry(new DigestURL("https://yacy.net"), rels, sizes); relStr = icon.relToString(); Assert.assertEquals(IconLinkRelations.ICON.getRelValue(), relStr); } diff --git a/test/java/net/yacy/document/parser/ooxmlParserTest.java b/test/java/net/yacy/document/parser/ooxmlParserTest.java index 12d30dee2..9d3c2a6e9 100644 --- a/test/java/net/yacy/document/parser/ooxmlParserTest.java +++ b/test/java/net/yacy/document/parser/ooxmlParserTest.java @@ -152,7 +152,7 @@ public class ooxmlParserTest { final Collection<AnchorURL> anchors = docs[0].getAnchors(); assertNotNull("Detected URLs must not be null", anchors); assertEquals("2 URLs should be detected", 2, anchors.size()); - assertTrue("YaCy home page URL should have been parsed: " + anchors.toString(), anchors.contains(new AnchorURL("http://yacy.net/"))); + assertTrue("YaCy home page URL should have been parsed: " + anchors.toString(), anchors.contains(new AnchorURL("https://yacy.net/"))); assertTrue("YaCy forum URL should have been parsed: " + anchors.toString(), anchors.contains(new AnchorURL("https://community.searchlab.eu/"))); } } |
