MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / normalize

Method normalize

src/test/java/org/htmlunit/util/UrlUtilsTest.java:596–622  ·  view source on GitHub ↗

@throws Exception if the test fails

()

Source from the content-addressed store, hash-verified

594 * @throws Exception if the test fails
595 */
596 @Test
597 public void normalize() throws Exception {
598 assertEquals("http://localhost:80/bug.html", UrlUtils.normalize(new URL("http://localhost/bug.html")));
599 assertEquals("https://localhost:443/bug.html", UrlUtils.normalize(new URL("https://localhost/bug.html")));
600
601 assertEquals("http://localhost:80/test/bug.html",
602 UrlUtils.normalize(new URL("http://localhost/test/./bug.html")));
603 assertEquals("http://localhost:80/../bug.html", UrlUtils.normalize(new URL("http://localhost/../bug.html")));
604 assertEquals("http://localhost:80/bug.html", UrlUtils.normalize(new URL("http://localhost/test/../bug.html")));
605
606 assertEquals("http://localhost:80/", UrlUtils.normalize(new URL("http://localhost")));
607 assertEquals("http://localhost:80/", UrlUtils.normalize(new URL("http://localhost/")));
608
609 assertEquals("http://localhost:80/bug.html?test",
610 UrlUtils.normalize(new URL("http://localhost/bug.html?test")));
611 assertEquals("http://localhost:80/bug.html", UrlUtils.normalize(new URL("http://localhost/bug.html#anchor")));
612 assertEquals("http://localhost:80/bug.html?test",
613 UrlUtils.normalize(new URL("http://localhost/bug.html?test#anchor")));
614
615 assertEquals("http://localhost:80/bug.html", UrlUtils.normalize(new URL("http://localhost:80/bug.html")));
616 assertEquals("http://localhost:81/bug.html", UrlUtils.normalize(new URL("http://localhost:81/bug.html")));
617
618 assertEquals("https://localhost:443/bug.html",
619 UrlUtils.normalize(new URL("https://localhost:443/bug.html")));
620 assertEquals("https://localhost:8443/bug.html",
621 UrlUtils.normalize(new URL("https://localhost:8443/bug.html")));
622 }
623
624 /**
625 * @throws Exception if the test fails

Callers 15

makeModuleMapFunction · 0.45
resolvePluginResourceIdFunction · 0.45
makeModuleMapFunction · 0.45
newContextFunction · 0.45
makeModuleMapFunction · 0.45
newContextFunction · 0.45
makeModuleMapFunction · 0.45
newContextFunction · 0.45
resolvePluginResourceIdFunction · 0.45
getRangeFunction · 0.45
getRangeFunction · 0.45

Calls 2

normalizeMethod · 0.95
assertEqualsMethod · 0.45

Tested by

no test coverage detected