Clover Coverage Report - ARESTC 0.1.7-SNAPSHOT
Coverage timestamp: Fri Aug 27 2010 19:12:04 CEST
../../../../img/srcFileCovDistChart8.png 54% of files have more coverage
4   53   2   4
2   20   0.5   1
1     2  
1    
 
  DeleteNodeHandler       Line # 34 4 0% 2 2 71.4% 0.71428573
 
  (1)
 
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.testserver;
20   
21    import java.io.IOException;
22   
23    import org.apache.http.HttpException;
24    import org.apache.http.HttpRequest;
25    import org.apache.http.HttpResponse;
26    import org.apache.http.HttpStatus;
27    import org.apache.http.protocol.HttpContext;
28    import org.apache.http.protocol.HttpRequestHandler;
29   
30    // TODO: Auto-generated Javadoc
31    /**
32    * The Class DeleteNodeHandler.
33    */
 
34    public class DeleteNodeHandler implements HttpRequestHandler {
35   
36    /** The Constant URL. */
37    public static final String URL = "/alfresco/service/api/node/workspace/SpacesStore/85cdb8d8-3e77-4916-9674-0a7da5164bb7/descendants";
38   
39    /* (non-Javadoc)
40    * @see org.apache.http.protocol.HttpRequestHandler#handle(org.apache.http.HttpRequest, org.apache.http.HttpResponse, org.apache.http.protocol.HttpContext)
41    */
 
42  1 toggle public void handle(final HttpRequest request, final HttpResponse response,
43    final HttpContext context) throws HttpException, IOException {
44  1 if ("DELETE".equals(request.getRequestLine().getMethod())) {
45  1 response.setStatusCode(HttpStatus.SC_OK);
46  1 response.addHeader("Content-Type", "text/plain");
47   
48    } else {
49  0 response.setStatusCode(HttpStatus.SC_METHOD_FAILURE);
50    }
51    }
52   
53    }