Clover Coverage Report - ARESTC 0.1.7-SNAPSHOT
Coverage timestamp: Fri Aug 27 2010 19:12:04 CEST
10   73   1   10
0   28   0.1   1
1     1  
1    
 
  HTTPMethodsTest       Line # 38 10 0% 1 0 100% 1.0
 
  (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
8    it under the terms of the Lesser General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11   
12    ARESTC is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    GNU General Public License for more details.
16   
17    You should have received a copy of the Lesser General Public License
18    along with ARESTC. If not, see <http://www.gnu.org/licenses/>.
19   
20    */
21    package net.sf.arestc.communication;
22   
23    import junit.framework.TestCase;
24    import net.sf.arestc.core.services.HTTPMethods;
25   
26    import org.apache.commons.httpclient.methods.DeleteMethod;
27    import org.apache.commons.httpclient.methods.GetMethod;
28    import org.apache.commons.httpclient.methods.HeadMethod;
29    import org.apache.commons.httpclient.methods.PostMethod;
30    import org.apache.commons.httpclient.methods.PutMethod;
31   
32    // TODO: Auto-generated Javadoc
33    /**
34    * The Class HTTPMethodsTest.
35    *
36    * @author georgosn
37    */
 
38    public class HTTPMethodsTest extends TestCase {
39   
40    /** The method. */
41    private HTTPMethods method;
42   
43    /**
44    * Test method for.
45    *
46    * {@link lu.ng.urlchecker.communication.HTTPMethods#getMethod(java.lang.String)}
47    * .
48    */
 
49  1 toggle public void testGetMethod() {
50    // Test head method
51  1 method = HTTPMethods.HEAD;
52  1 assertEquals(HeadMethod.class, method.getMethod("http://www.in.gr")
53    .getClass());
54    // Test put method
55  1 method = HTTPMethods.PUT;
56  1 assertEquals(PutMethod.class, method.getMethod("http://www.in.gr")
57    .getClass());
58    // Test delete method
59  1 method = HTTPMethods.DELETE;
60  1 assertEquals(DeleteMethod.class, method.getMethod("http://www.in.gr")
61    .getClass());
62    // Test post method
63  1 method = HTTPMethods.POST;
64  1 assertEquals(PostMethod.class, method.getMethod("http://www.in.gr")
65    .getClass());
66    // Test get method
67  1 method = HTTPMethods.GET;
68  1 assertEquals(GetMethod.class, method.getMethod("http://www.in.gr")
69    .getClass());
70   
71    }
72   
73    }