TestURIUtils.java (httpcomponents-client-5.0.2-src) | : | TestURIUtils.java (httpcomponents-client-5.0.3-src) | ||
---|---|---|---|---|
skipping to change at line 233 | skipping to change at line 233 | |||
Assert.assertEquals(new HttpHost("localhost",8080),URIUtils.extractHost( | Assert.assertEquals(new HttpHost("localhost",8080),URIUtils.extractHost( | |||
new URI("http://@localhost:8080/abcd"))); | new URI("http://@localhost:8080/abcd"))); | |||
Assert.assertEquals(new HttpHost("local_host",8080),URIUtils.extractHost ( | Assert.assertEquals(new HttpHost("local_host",8080),URIUtils.extractHost ( | |||
new URI("http://@local_host:8080/abcd"))); | new URI("http://@local_host:8080/abcd"))); | |||
Assert.assertEquals(new HttpHost("[2a00:1450:400c:c01::69]",8080), | Assert.assertEquals(new HttpHost("[2a00:1450:400c:c01::69]",8080), | |||
URIUtils.extractHost(new URI("http://[2a00:1450:400c:c01::69]:80 80/"))); | URIUtils.extractHost(new URI("http://[2a00:1450:400c:c01::69]:80 80/"))); | |||
Assert.assertEquals(new HttpHost("localhost",8080), | Assert.assertEquals(new HttpHost("localhost",8080), | |||
URIUtils.extractHost(new URI("http://localhost:8080/;sessionid=s tuff/abcd"))); | URIUtils.extractHost(new URI("http://localhost:8080/;sessionid=s tuff/abcd"))); | |||
Assert.assertEquals(new HttpHost("localhost",8080), | Assert.assertEquals(null, | |||
URIUtils.extractHost(new URI("http://localhost:8080;sessionid=st uff/abcd"))); | URIUtils.extractHost(new URI("http://localhost:8080;sessionid=st uff/abcd"))); | |||
Assert.assertEquals(new HttpHost("localhost",-1), | Assert.assertEquals(null, | |||
URIUtils.extractHost(new URI("http://localhost:;sessionid=stuff/ abcd"))); | URIUtils.extractHost(new URI("http://localhost:;sessionid=stuff/ abcd"))); | |||
Assert.assertEquals(null, | Assert.assertEquals(null, | |||
URIUtils.extractHost(new URI("http://:80/robots.txt"))); | URIUtils.extractHost(new URI("http://:80/robots.txt"))); | |||
Assert.assertEquals(null, | Assert.assertEquals(null, | |||
URIUtils.extractHost(new URI("http://some%20domain:80/robots.txt "))); | URIUtils.extractHost(new URI("http://some%20domain:80/robots.txt "))); | |||
Assert.assertEquals(null, | ||||
URIUtils.extractHost(new URI("http://blah@goggle.com:80@google.c | ||||
om/"))); | ||||
} | } | |||
@Test | @Test | |||
public void testHttpLocationWithRelativeFragment() throws Exception { | public void testHttpLocationWithRelativeFragment() throws Exception { | |||
final HttpHost target = new HttpHost("http", "localhost", -1); | final HttpHost target = new HttpHost("http", "localhost", -1); | |||
final URI requestURI = new URI("/stuff#blahblah"); | final URI requestURI = new URI("/stuff#blahblah"); | |||
final URI location = URIUtils.resolve(requestURI, target, null); | final URI location = URIUtils.resolve(requestURI, target, null); | |||
final URI expectedURI = new URIBuilder(requestURI) | final URI expectedURI = new URIBuilder(requestURI) | |||
.setHost(target.getHostName()) | .setHost(target.getHostName()) | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 5 lines changed or added |