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

Method expandUrl

src/test/java/org/htmlunit/WebClientTest.java:1100–1108  ·  view source on GitHub ↗

Test WebClient#expandUrl(URL,String) for the case where an anchor name was specified. @throws Exception if the test fails

()

Source from the content-addressed store, hash-verified

1098 * @throws Exception if the test fails
1099 */
1100 @Test
1101 public void expandUrl() throws Exception {
1102 final String prefix = URL_FIRST.toExternalForm();
1103 assertEquals(prefix + "#second", WebClient.expandUrl(URL_FIRST, "#second"));
1104 assertEquals(prefix + "?a=1&b=2", WebClient.expandUrl(new URL(prefix + "?a=1&b=2"), ""));
1105 assertEquals(prefix + "?b=2&c=3", WebClient.expandUrl(new URL(prefix + "?a=1&b=2"), "?b=2&c=3"));
1106 assertEquals("file:/home/myself/test.js",
1107 WebClient.expandUrl(new URL("file:/home/myself/myTest.html"), "test.js"));
1108 }
1109
1110 /**
1111 * @throws Exception if the test fails

Callers

nothing calls this directly

Calls 2

expandUrlMethod · 0.95
assertEqualsMethod · 0.45

Tested by

no test coverage detected