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: 155418 $
4    * $Date: 2005-02-26 08:01:52 -0500 (Sat, 26 Feb 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: 155418 $ $Date: 2005-02-26 08:01:52 -0500 (Sat, 26 Feb 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(TestResponseHeaders.suite());
64          suite.addTest(TestRequestHeaders.suite());
65          suite.addTest(TestStreams.suite());
66          suite.addTest(TestParameterParser.suite());
67          suite.addTest(TestNVP.suite());
68          suite.addTest(TestMethodCharEncoding.suite());
69          suite.addTest(TestHttpVersion.suite());
70          suite.addTest(TestEffectiveHttpVersion.suite());
71          suite.addTest(TestHttpParser.suite());
72          suite.addTest(TestBadContentLength.suite());
73          suite.addTest(TestEquals.suite());
74          // Exceptions
75          suite.addTest(TestExceptions.suite());        
76          // HTTP state management
77          suite.addTest(TestHttpState.suite());
78          suite.addTest(TestCookieAll.suite());
79          // Authentication 
80          suite.addTest(TestCredentials.suite());
81          suite.addTest(TestAuthAll.suite());
82          // Redirects
83          suite.addTest(TestRedirects.suite());
84          // Connection management
85          suite.addTest(TestHttpConnection.suite());
86          suite.addTest(TestConnectionPersistence.suite());
87          suite.addTest(TestIdleConnectionTimeout.suite());
88          suite.addTest(TestMethodAbort.suite());
89          // Preferences
90          suite.addTest(TestParamsAll.suite());
91          suite.addTest(TestVirtualHost.suite());        
92          // URIs
93          suite.addTest(TestURI.suite());
94          suite.addTest(TestURIUtil.suite());
95          suite.addTest(TestURIUtil2.suite());
96          // Method specific
97          suite.addTest(TestPostMethod.suite());
98          suite.addTest(TestPartsNoHost.suite());
99          suite.addTest(TestMultipartPost.suite());
100         // Non compliant behaviour
101         suite.addTest(TestNoncompliant.suite());
102         // Proxy
103         suite.addTest(TestProxy.suite());
104         return suite;
105     }
106 
107     public static void main(String args[]) {
108         String[] testCaseName = { TestNoHost.class.getName() };
109         junit.textui.TestRunner.main(testCaseName);
110     }
111 
112 }