"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java" between
httpcomponents-client-4.5.7-src.tar.gz and httpcomponents-client-4.5.8-src.tar.gz

About: HttpComponents is an Apache project responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. Java sources.

TestProtocolExec.java  (httpcomponents-client-4.5.7-src):TestProtocolExec.java  (httpcomponents-client-4.5.8-src)
skipping to change at line 107 skipping to change at line 107
Assert.assertEquals(route, context.getHttpRoute()); Assert.assertEquals(route, context.getHttpRoute());
Assert.assertSame(request, context.getRequest()); Assert.assertSame(request, context.getRequest());
Assert.assertSame(response, context.getResponse()); Assert.assertSame(response, context.getResponse());
} }
@Test @Test
public void testRewriteAbsoluteRequestURI() throws Exception { public void testRewriteAbsoluteRequestURI() throws Exception {
final HttpRoute route = new HttpRoute(target); final HttpRoute route = new HttpRoute(target);
final HttpRequestWrapper request = HttpRequestWrapper.wrap( final HttpRequestWrapper request = HttpRequestWrapper.wrap(
new HttpGet("http://foo/test")); new HttpGet("http://foo/test"));
protocolExec.rewriteRequestURI(request, route); protocolExec.rewriteRequestURI(request, route, true);
Assert.assertEquals(new URI("/test"), request.getURI()); Assert.assertEquals(new URI("/test"), request.getURI());
} }
@Test @Test
public void testRewriteEmptyRequestURI() throws Exception { public void testRewriteEmptyRequestURI() throws Exception {
final HttpRoute route = new HttpRoute(target); final HttpRoute route = new HttpRoute(target);
final HttpRequestWrapper request = HttpRequestWrapper.wrap( final HttpRequestWrapper request = HttpRequestWrapper.wrap(
new HttpGet("")); new HttpGet(""));
protocolExec.rewriteRequestURI(request, route); protocolExec.rewriteRequestURI(request, route, true);
Assert.assertEquals(new URI("/"), request.getURI()); Assert.assertEquals(new URI("/"), request.getURI());
} }
@Test @Test
public void testRewriteAbsoluteRequestURIViaPRoxy() throws Exception { public void testRewriteAbsoluteRequestURIViaPRoxy() throws Exception {
final HttpRoute route = new HttpRoute(target, proxy); final HttpRoute route = new HttpRoute(target, proxy);
final HttpRequestWrapper request = HttpRequestWrapper.wrap( final HttpRequestWrapper request = HttpRequestWrapper.wrap(
new HttpGet("http://foo/test")); new HttpGet("http://foo/test"));
protocolExec.rewriteRequestURI(request, route); protocolExec.rewriteRequestURI(request, route, true);
Assert.assertEquals(new URI("http://foo/test"), request.getURI()); Assert.assertEquals(new URI("http://foo/test"), request.getURI());
} }
@Test @Test
public void testRewriteRelativeRequestURIViaPRoxy() throws Exception { public void testRewriteRelativeRequestURIViaPRoxy() throws Exception {
final HttpRoute route = new HttpRoute(target, proxy); final HttpRoute route = new HttpRoute(target, proxy);
final HttpRequestWrapper request = HttpRequestWrapper.wrap( final HttpRequestWrapper request = HttpRequestWrapper.wrap(
new HttpGet("/test")); new HttpGet("/test"));
protocolExec.rewriteRequestURI(request, route); protocolExec.rewriteRequestURI(request, route, true);
Assert.assertEquals(new URI("http://foo:80/test"), request.getURI()); Assert.assertEquals(new URI("http://foo:80/test"), request.getURI());
} }
@Test @Test
public void testHostHeaderUriRequest() throws Exception { public void testHostHeaderUriRequest() throws Exception {
final HttpRoute route = new HttpRoute(target); final HttpRoute route = new HttpRoute(target);
final HttpRequestWrapper request = HttpRequestWrapper.wrap( final HttpRequestWrapper request = HttpRequestWrapper.wrap(
new HttpGet("http://bar/test")); new HttpGet("http://bar/test"));
final HttpClientContext context = HttpClientContext.create(); final HttpClientContext context = HttpClientContext.create();
protocolExec.execute(route, request, context, execAware); protocolExec.execute(route, request, context, execAware);
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)