Clover Coverage Report - ARESTC 0.1.7-SNAPSHOT
Coverage timestamp: Fri Aug 27 2010 19:12:04 CEST
../../../../img/srcFileCovDistChart9.png 41% of files have more coverage
7   94   7   1
0   28   1   7
7     1  
1    
 
  StandardConnectorResponse       Line # 31 7 0% 7 2 85.7% 0.85714287
 
  (9)
 
1    /*
2    *
3    * (C)opyright 2010, Nikolaos Georgosopoulos
4    *
5    * This file is part of ARESTC.
6    *
7    * ARESTC is free software: you can redistribute it and/or modify it under the
8    * terms of the Lesser General Public License as published by the Free Software
9    * Foundation, either version 3 of the License, or (at your option) any later
10    * version.
11    *
12    * ARESTC is distributed in the hope that it will be useful, but WITHOUT ANY
13    * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14    * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15    *
16    * You should have received a copy of the Lesser General Public License along
17    * with ARESTC. If not, see <http://www.gnu.org/licenses/>.
18    */
19    package net.sf.arestc.core;
20   
21    import java.io.InputStream;
22    import java.util.Collection;
23   
24   
25    import org.apache.commons.httpclient.Header;
26   
27    // TODO: Auto-generated Javadoc
28    /**
29    * The Class StandardConnectorResponse.
30    */
 
31    public class StandardConnectorResponse implements ConnectorResponse {
32   
33    /** The context. */
34    private final ConnectorContext context;
35   
36    /**
37    * Instantiates a new standard connector response.
38    *
39    * @param context
40    * the context
41    */
 
42  11 toggle public StandardConnectorResponse(final ConnectorContext context) {
43  11 this.context = context;
44    }
45   
46    /*
47    * (non-Javadoc)
48    *
49    * @see net.sf.arestc.core.ConnectorResponse#getErrors()
50    */
 
51  0 toggle public Collection<ARESTCError> getErrors() {
52  0 return context.getErrors();
53    }
54   
55    /*
56    * (non-Javadoc)
57    *
58    * @see net.sf.arestc.core.ConnectorResponse#getResponseBody()
59    */
 
60  11 toggle public Object getResponseBody() {
61  11 return context.getReturnedBody();
62    }
63   
64    /*
65    * (non-Javadoc)
66    *
67    * @see net.sf.arestc.core.ConnectorResponse#getResponseHeaders()
68    */
 
69  9 toggle public Header[] getResponseHeaders() {
70  9 return context.getReturnedHeaders();
71    }
72   
73    /*
74    * (non-Javadoc)
75    *
76    * @see net.sf.arestc.core.ConnectorResponse#getStreamedBody()
77    */
 
78  2 toggle public InputStream getStreamedBody() {
79  2 return (InputStream) context.getReturnedBody();
80    }
81   
82    /*
83    * (non-Javadoc)
84    *
85    * @see net.sf.arestc.core.ConnectorResponse#hasErrors()
86    */
 
87  9 toggle public boolean hasErrors() {
88  9 return context.isError_occured();
89    }
90   
 
91  7 toggle public void releaseConnection() {
92  7 context.getMethod().releaseConnection();
93    }
94    }