Clover Coverage Report - Maven HTTP Plugin 1.0.2
Coverage timestamp: Fri Sep 30 2011 01:17:02 EDT
15   33   2   15
0   29   0.13   1
1     2  
1    
 
  HttpClientTest       Line # 9 15 0% 2 6 62.5% 0.625
 
  (1)
 
1    package org.apache.commons.httpclient;
2   
3    import org.apache.commons.httpclient.HttpClient;
4    import org.apache.commons.httpclient.methods.GetMethod;
5    import org.apache.commons.httpclient.params.HttpClientParams;
6    import org.apache.commons.httpclient.params.HttpMethodParams;
7    import org.junit.Test;
8   
 
9    public class HttpClientTest {
10   
 
11  1 toggle @Test
12    public void test1() {
13  1 try {
14  1 String url = "http://localhost:8070";
15  1 GetMethod method = new GetMethod(url);
16  1 HttpClient client = new HttpClient();
17  1 HttpClientParams clientParams = client.getParams();
18  1 HttpMethodRetryHandler retryHandler = new DefaultHttpMethodRetryHandler(0, false);
19  1 clientParams.setParameter(HttpMethodParams.RETRY_HANDLER, retryHandler);
20   
21  1 int result = client.executeMethod(method);
22  0 Header[] headers = method.getResponseHeaders();
23  0 for (Header header : headers) {
24  0 String name = header.getName();
25  0 String value = header.getValue();
26  0 System.out.println(name + "=" + value);
27    }
28  0 System.out.println(result);
29    } catch (Throwable t) {
30  1 t.printStackTrace();
31    }
32    }
33    }