You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2006/05/14 23:19:53 UTC

svn commit: r406434 - in /jakarta/httpcomponents/httpclient/trunk/src/test/org/apache: http/cookie/impl/TestAllCookieImpl.java httpclient/TestAll.java httpclient/impl/TestAllHttpClientImpl.java httpclient/impl/TestDefaultResponseConsumedWatcher.java

Author: olegk
Date: Sun May 14 14:19:51 2006
New Revision: 406434

URL: http://svn.apache.org/viewcvs?rev=406434&view=rev
Log:
* Added TestAll* test suites
* Fixed broken test cases

Added:
    jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/http/cookie/impl/TestAllCookieImpl.java   (with props)
    jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/TestAll.java   (with props)
    jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestAllHttpClientImpl.java   (with props)
Modified:
    jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestDefaultResponseConsumedWatcher.java

Added: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/http/cookie/impl/TestAllCookieImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/http/cookie/impl/TestAllCookieImpl.java?rev=406434&view=auto
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/http/cookie/impl/TestAllCookieImpl.java (added)
+++ jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/http/cookie/impl/TestAllCookieImpl.java Sun May 14 14:19:51 2006
@@ -0,0 +1,50 @@
+/*
+ * $HeadURL$
+ * $Revision$
+ * $Date$
+ * ====================================================================
+ *
+ *  Copyright 1999-2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http.cookie.impl;
+
+import junit.framework.*;
+
+public class TestAllCookieImpl extends TestCase {
+
+    public TestAllCookieImpl(String testName) {
+        super(testName);
+    }
+
+    public static Test suite() {
+        TestSuite suite = new TestSuite();
+        suite.addTest(TestAbstractCookieSpec.suite());
+        return suite;
+    }
+
+    public static void main(String args[]) {
+        String[] testCaseName = { TestAllCookieImpl.class.getName() };
+        junit.textui.TestRunner.main(testCaseName);
+    }
+
+}

Propchange: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/http/cookie/impl/TestAllCookieImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/http/cookie/impl/TestAllCookieImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/http/cookie/impl/TestAllCookieImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/TestAll.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/TestAll.java?rev=406434&view=auto
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/TestAll.java (added)
+++ jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/TestAll.java Sun May 14 14:19:51 2006
@@ -0,0 +1,54 @@
+/*
+ * $HeadURL$
+ * $Revision$
+ * $Date$
+ * ====================================================================
+ *
+ *  Copyright 1999-2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.httpclient;
+
+import org.apache.http.cookie.impl.TestAllCookieImpl;
+import org.apache.httpclient.impl.TestAllHttpClientImpl;
+
+import junit.framework.*;
+
+public class TestAll extends TestCase {
+
+    public TestAll(String testName) {
+        super(testName);
+    }
+
+    public static Test suite() {
+        TestSuite suite = new TestSuite();
+        suite.addTest(TestAllCookieImpl.suite());
+        suite.addTest(TestAllHttpClientImpl.suite());
+        return suite;
+    }
+
+    public static void main(String args[]) {
+        String[] testCaseName = { TestAll.class.getName() };
+        junit.textui.TestRunner.main(testCaseName);
+    }
+
+}

Propchange: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/TestAll.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/TestAll.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/TestAll.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestAllHttpClientImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestAllHttpClientImpl.java?rev=406434&view=auto
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestAllHttpClientImpl.java (added)
+++ jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestAllHttpClientImpl.java Sun May 14 14:19:51 2006
@@ -0,0 +1,51 @@
+/*
+ * $HeadURL$
+ * $Revision$
+ * $Date$
+ * ====================================================================
+ *
+ *  Copyright 1999-2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.httpclient.impl;
+
+import junit.framework.*;
+
+public class TestAllHttpClientImpl extends TestCase {
+
+    public TestAllHttpClientImpl(String testName) {
+        super(testName);
+    }
+
+    public static Test suite() {
+        TestSuite suite = new TestSuite();
+        suite.addTest(TestAutoCloseInputStream.suite());
+        suite.addTest(TestDefaultResponseConsumedWatcher.suite());
+        return suite;
+    }
+
+    public static void main(String args[]) {
+        String[] testCaseName = { TestAllHttpClientImpl.class.getName() };
+        junit.textui.TestRunner.main(testCaseName);
+    }
+
+}

Propchange: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestAllHttpClientImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestAllHttpClientImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestAllHttpClientImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestDefaultResponseConsumedWatcher.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestDefaultResponseConsumedWatcher.java?rev=406434&r1=406433&r2=406434&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestDefaultResponseConsumedWatcher.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/src/test/org/apache/httpclient/impl/TestDefaultResponseConsumedWatcher.java Sun May 14 14:19:51 2006
@@ -29,6 +29,7 @@
 package org.apache.httpclient.impl;
 
 import java.io.ByteArrayInputStream;
+import java.io.InputStream;
 
 import org.apache.http.Header;
 import org.apache.http.HttpConnection;
@@ -94,10 +95,9 @@
         
         // Wrap the entity input stream 
         ResponseConsumedWatcher watcher = new DefaultResponseConsumedWatcher(conn, response);
-        entity.setContent(new AutoCloseInputStream(entity.getContent(), watcher));
-        
+        InputStream content = new AutoCloseInputStream(entity.getContent(), watcher);
         assertTrue(conn.isOpen());
-        while (entity.getContent().read() != -1) {}
+        while (content.read() != -1) {}
         assertFalse(conn.isOpen());
     }
 
@@ -117,10 +117,10 @@
         
         // Wrap the entity input stream 
         ResponseConsumedWatcher watcher = new DefaultResponseConsumedWatcher(conn, response);
-        entity.setContent(new AutoCloseInputStream(entity.getContent(), watcher));
+        InputStream content = new AutoCloseInputStream(entity.getContent(), watcher);
         
         assertTrue(conn.isOpen());
-        while (entity.getContent().read() != -1) {}
+        while (content.read() != -1) {}
         assertTrue(conn.isOpen());
     }
 }