hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r528428 - in /jakarta/httpcomponents/httpcore/trunk/module-main/src: examples/org/apache/http/examples/ main/java/org/apache/http/ main/java/org/apache/http/message/ test/java/org/apache/http/message/ test/java/org/apache/http/protocol/
Date Fri, 13 Apr 2007 10:26:12 GMT
Author: olegk
Date: Fri Apr 13 03:26:04 2007
New Revision: 528428

URL: http://svn.apache.org/viewvc?view=rev&rev=528428
Log:
Removed HttpGet, HttpHead, and HttpPost classes from HttpCore. To be moved to HttpClient.

Removed:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/HttpGet.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/HttpHead.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/HttpPost.java
Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpGet.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpPost.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpRequest.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicMessages.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/protocol/TestHttpServiceAndExecutor.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpGet.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpGet.java?view=diff&rev=528428&r1=528427&r2=528428
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpGet.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpGet.java
Fri Apr 13 03:26:04 2007
@@ -40,7 +40,7 @@
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.params.BasicHttpParams;
-import org.apache.http.message.HttpGet;
+import org.apache.http.message.BasicHttpRequest;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.BasicHttpProcessor;
@@ -104,7 +104,7 @@
                     Socket socket = new Socket(host.getHostName(), host.getPort());
                     conn.bind(socket, params);
                 }
-                HttpGet request = new HttpGet(targets[i]);
+                BasicHttpRequest request = new BasicHttpRequest("GET", targets[i]);
                 System.out.println(">> Request URI: " + request.getRequestLine().getUri());
                 HttpResponse response = httpexecutor.execute(request, conn, context);
                 System.out.println("<< Response: " + response.getStatusLine());

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpPost.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpPost.java?view=diff&rev=528428&r1=528427&r2=528428
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpPost.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpPost.java
Fri Apr 13 03:26:04 2007
@@ -45,7 +45,7 @@
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.params.BasicHttpParams;
-import org.apache.http.message.HttpPost;
+import org.apache.http.message.BasicHttpEntityEnclosingRequest;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.BasicHttpProcessor;
@@ -116,7 +116,8 @@
                     Socket socket = new Socket(host.getHostName(), host.getPort());
                     conn.bind(socket, params);
                 }
-                HttpPost request = new HttpPost("/servlets-examples/servlet/RequestInfoExample");
+                BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST",

+                        "/servlets-examples/servlet/RequestInfoExample");
                 request.setEntity(requestBodies[i]);
                 System.out.println(">> Request URI: " + request.getRequestLine().getUri());
                 HttpResponse response = httpexecutor.execute(request, conn, context);

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpRequest.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpRequest.java?view=diff&rev=528428&r1=528427&r2=528428
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpRequest.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpRequest.java
Fri Apr 13 03:26:04 2007
@@ -48,6 +48,4 @@
      */
     RequestLine getRequestLine();
     
-    //TODO add a setter for request line?
-    
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicMessages.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicMessages.java?view=diff&rev=528428&r1=528427&r2=528428
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicMessages.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicMessages.java
Fri Apr 13 03:26:04 2007
@@ -37,7 +37,6 @@
 
 import org.apache.http.Header;
 import org.apache.http.HttpEntity;
-import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
@@ -188,27 +187,6 @@
         assertFalse(request.expectContinue());
         request.addHeader("Expect", "100-Continue");
         assertTrue(request.expectContinue()); 
-    }
-
-    public void testDefaultGetMethodConstructor() {
-        HttpRequest request = new HttpGet("/");
-        assertEquals("/", request.getRequestLine().getUri());
-        assertEquals("GET", request.getRequestLine().getMethod());
-        assertFalse(request instanceof HttpEntityEnclosingRequest);
-    }
-    
-    public void testDefaultPostMethodConstructor() {
-        HttpRequest request = new HttpPost("/");
-        assertEquals("/", request.getRequestLine().getUri());
-        assertEquals("POST", request.getRequestLine().getMethod());
-        assertTrue(request instanceof HttpEntityEnclosingRequest);
-    }
-
-    public void testDefaultHeadMethodConstructor() {
-        HttpRequest request = new HttpHead("/");
-        assertEquals("/", request.getRequestLine().getUri());
-        assertEquals("HEAD", request.getRequestLine().getMethod());
-        assertFalse(request instanceof HttpEntityEnclosingRequest);
     }
 
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/protocol/TestHttpServiceAndExecutor.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/protocol/TestHttpServiceAndExecutor.java?view=diff&rev=528428&r1=528427&r2=528428
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/protocol/TestHttpServiceAndExecutor.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/protocol/TestHttpServiceAndExecutor.java
Fri Apr 13 03:26:04 2007
@@ -48,8 +48,8 @@
 import org.apache.http.entity.ByteArrayEntity;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.DefaultHttpClientConnection;
-import org.apache.http.message.HttpGet;
-import org.apache.http.message.HttpPost;
+import org.apache.http.message.BasicHttpEntityEnclosingRequest;
+import org.apache.http.message.BasicHttpRequest;
 import org.apache.http.mockup.TestHttpClient;
 import org.apache.http.mockup.TestHttpServer;
 import org.apache.http.params.HttpProtocolParams;
@@ -92,7 +92,7 @@
     /**
      * This test case executes a series of simple GET requests 
      */
-    public void testSimpleHttpGets() throws Exception {
+    public void testSimpleBasicHttpRequests() throws Exception {
         
         int reqNo = 20;
         
@@ -139,7 +139,7 @@
                     conn.bind(socket, this.client.getParams());
                 }
                 
-                HttpGet get = new HttpGet("/?" + r);
+                BasicHttpRequest get = new BasicHttpRequest("GET", "/?" + r);
                 HttpResponse response = this.client.execute(get, host, conn);
                 byte[] received = EntityUtils.toByteArray(response.getEntity());
                 byte[] expected = (byte[]) testData.get(r);
@@ -212,7 +212,7 @@
                     conn.bind(socket, this.client.getParams());
                 }
                 
-                HttpPost post = new HttpPost("/");
+                BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST",
"/");
                 byte[] data = (byte[]) testData.get(r);
                 ByteArrayEntity outgoing = new ByteArrayEntity(data);
                 post.setEntity(outgoing);
@@ -289,7 +289,7 @@
                     conn.bind(socket, this.client.getParams());
                 }
                 
-                HttpPost post = new HttpPost("/");
+                BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST",
"/");
                 byte[] data = (byte[]) testData.get(r);
                 ByteArrayEntity outgoing = new ByteArrayEntity(data);
                 outgoing.setChunked(true);
@@ -370,7 +370,7 @@
                     conn.bind(socket, this.client.getParams());
                 }
                 
-                HttpPost post = new HttpPost("/");
+                BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST",
"/");
                 byte[] data = (byte[]) testData.get(r);
                 ByteArrayEntity outgoing = new ByteArrayEntity(data);
                 post.setEntity(outgoing);
@@ -451,7 +451,7 @@
                     conn.bind(socket, this.client.getParams());
                 }
                 
-                HttpPost post = new HttpPost("/");
+                BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST",
"/");
                 byte[] data = (byte[]) testData.get(r);
                 ByteArrayEntity outgoing = new ByteArrayEntity(data);
                 outgoing.setChunked(true);
@@ -538,7 +538,7 @@
                     conn.bind(socket, this.client.getParams());
                 }
                 
-                HttpPost post = new HttpPost("/");
+                BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST",
"/");
                 post.addHeader("Secret", Integer.toString(r));
                 ByteArrayEntity outgoing = new ByteArrayEntity(
                         EncodingUtils.getAsciiBytes("No content")); 



Mime
View raw message