1   /*
2    * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/test/org/apache/commons/httpclient/TestNoHost.java,v 1.48 2004/11/20 17:56:39 olegk Exp $
3    * $Revision: 192986 $
4    * $Date: 2005-06-22 15:51:04 -0400 (Wed, 22 Jun 2005) $
5    * ====================================================================
6    *
7    *  Copyright 1999-2004 The Apache Software Foundation
8    *
9    *  Licensed under the Apache License, Version 2.0 (the "License");
10   *  you may not use this file except in compliance with the License.
11   *  You may obtain a copy of the License at
12   *
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   *
15   *  Unless required by applicable law or agreed to in writing, software
16   *  distributed under the License is distributed on an "AS IS" BASIS,
17   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   *  See the License for the specific language governing permissions and
19   *  limitations under the License.
20   * ====================================================================
21   *
22   * This software consists of voluntary contributions made by many
23   * individuals on behalf of the Apache Software Foundation.  For more
24   * information on the Apache Software Foundation, please see
25   * <http://www.apache.org/>.
26   */
27  
28  package org.apache.commons.httpclient;
29  
30  import junit.framework.Test;
31  import junit.framework.TestCase;
32  import junit.framework.TestSuite;
33  
34  import org.apache.commons.httpclient.auth.TestAuthAll;
35  import org.apache.commons.httpclient.cookie.TestCookieAll;
36  import org.apache.commons.httpclient.params.TestParamsAll;
37  
38  /***
39   * Tests that don't require any external host.
40   * I.e., that run entirely within this JVM.
41   *
42   * (True unit tests, by some definitions.)
43   *
44   * @author Rodney Waldhoff
45   * @author <a href="mailto:jsdever@apache.org">Jeff Dever</a>
46   * @version $Revision: 192986 $ $Date: 2005-06-22 15:51:04 -0400 (Wed, 22 Jun 2005) $
47   */
48  public class TestNoHost extends TestCase {
49  
50      public TestNoHost(String testName) {
51          super(testName);
52      }
53  
54      public static Test suite() {
55          TestSuite suite = new TestSuite();
56          // Fundamentals
57          suite.addTest(TestHttpMethodFundamentals.suite());
58          suite.addTest(TestHttpStatus.suite());
59          suite.addTest(TestStatusLine.suite());
60          suite.addTest(TestRequestLine.suite());
61          suite.addTest(TestHeader.suite());
62          suite.addTest(TestHeaderElement.suite());
63          suite.addTest(TestHeaderOps.suite());
64          suite.addTest(TestResponseHeaders.suite());
65          suite.addTest(TestRequestHeaders.suite());
66          suite.addTest(TestStreams.suite());
67          suite.addTest(TestParameterParser.suite());
68          suite.addTest(TestParameterFormatter.suite());
69          suite.addTest(TestNVP.suite());
70          suite.addTest(TestMethodCharEncoding.suite());
71          suite.addTest(TestHttpVersion.suite());
72          suite.addTest(TestEffectiveHttpVersion.suite());
73          suite.addTest(TestHttpParser.suite());
74          suite.addTest(TestBadContentLength.suite());
75          suite.addTest(TestEquals.suite());
76          // Exceptions
77          suite.addTest(TestExceptions.suite());        
78          // HTTP state management
79          suite.addTest(TestHttpState.suite());
80          suite.addTest(TestCookieAll.suite());
81          // Authentication 
82          suite.addTest(TestCredentials.suite());
83          suite.addTest(TestAuthAll.suite());
84          // Redirects
85          suite.addTest(TestRedirects.suite());
86          // Connection management
87          suite.addTest(TestHttpConnection.suite());
88          suite.addTest(TestHttpConnectionManager.suite());
89          suite.addTest(TestConnectionPersistence.suite());
90          suite.addTest(TestIdleConnectionTimeout.suite());
91          suite.addTest(TestMethodAbort.suite());
92          // Preferences
93          suite.addTest(TestParamsAll.suite());
94          suite.addTest(TestVirtualHost.suite());        
95          suite.addTest(TestHostConfiguration.suite());        
96          // URIs
97          suite.addTest(TestURI.suite());
98          suite.addTest(TestURIUtil.suite());
99          suite.addTest(TestURIUtil2.suite());
100         // Method specific
101         suite.addTest(TestEntityEnclosingMethod.suite());
102         suite.addTest(TestPostParameterEncoding.suite());
103         suite.addTest(TestPostMethod.suite());
104         suite.addTest(TestPartsNoHost.suite());
105         suite.addTest(TestMultipartPost.suite());
106         // Non compliant behaviour
107         suite.addTest(TestNoncompliant.suite());
108         // Proxy
109         suite.addTest(TestProxy.suite());
110         suite.addTest(TestProxyWithRedirect.suite());
111         return suite;
112     }
113 
114     public static void main(String args[]) {
115         String[] testCaseName = { TestNoHost.class.getName() };
116         junit.textui.TestRunner.main(testCaseName);
117     }
118 
119 }