harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r409546 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni: make/common/ src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/ src/test/java.injected/ src/test/java/org/apache/harmony/tests/internal/net/www/protoco...
Date Fri, 26 May 2006 03:37:31 GMT
Author: mloenko
Date: Thu May 25 20:37:30 2006
New Revision: 409546

URL: http://svn.apache.org/viewvc?rev=409546&view=rev
Log:
simplifying fixes and regression test for HARMONY-482 as agreed on the dev list
 

Removed:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java.injected/
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/build.xml
    incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/hyproperties.xml
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/build.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/build.xml?rev=409546&r1=409545&r2=409546&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/build.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/build.xml Thu May 25
20:37:30 2006
@@ -50,23 +50,6 @@
     <target name="compile.tests" depends="copy.test.resources">
         <echo message="Compiling LUNI tests from ${hy.luni.src.test.java}" />
 
-        <mkdir dir="${hy.luni.bin.injected}" />
-
-        <javac srcdir="${hy.luni.src.test.injected}"
-            destdir="${hy.luni.bin.injected}"
-            sourcepath=""
-            source="${hy.javac.source}"
-            target="${hy.javac.target}"
-            debug="${java.debug.option}">
-
-            <bootclasspath>
-                <fileset dir="${hy.target}/jre/lib/boot">
-                    <include name="**/*.jar" />
-                </fileset>
-            </bootclasspath>
-            <classpath location="${hy.tests.support.bin}" />
-        </javac>
-
         <mkdir dir="${hy.luni.bin.test}" />
 
         <javac srcdir="${hy.luni.src.test.java}"
@@ -80,7 +63,6 @@
                 <fileset dir="${hy.target}/jre/lib/boot">
                     <include name="**/*.jar" />
                 </fileset>
-                <pathelement path="${hy.luni.bin.injected}"/>
             </bootclasspath>
             <classpath location="${hy.tests.support.bin}" />
         </javac>
@@ -116,8 +98,6 @@
                 <pathelement path="${hy.luni.bin.test}" />
                 <pathelement path="${hy.tests.support.bin}" />
             </classpath>
-
-            <jvmarg value="-Xbootclasspath/a:${hy.luni.bin.injected}"/>
 
             <formatter type="xml" />
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/hyproperties.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/hyproperties.xml?rev=409546&r1=409545&r2=409546&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/hyproperties.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/hyproperties.xml Thu
May 25 20:37:30 2006
@@ -25,14 +25,12 @@
          <test>
             <java location="src/test/java" />
             <resources location="src/test/resources" />
-            <injected location="src/test/java.injected" />
          </test>
          <natives location="src/natives" />
       </src>
       <bin>
         <main location="bin/main" />
         <test location="bin/test" />
-        <injected location="bin/test-injected" />
       </bin>
       <packaging>
       </packaging>

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java?rev=409546&r1=409545&r2=409546&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
Thu May 25 20:37:30 2006
@@ -66,6 +66,14 @@
 public class HttpURLConnection extends java.net.HttpURLConnection {
     int httpVersion = 1; // Assume HTTP/1.1
 
+    private static final String POST = "POST";
+
+    private static final String GET = "GET";
+
+    private static final String PUT = "PUT";
+    
+    private static final String HEAD = "HEAD";
+    
     private final int defaultPort;
 
     InputStream is;
@@ -612,7 +620,7 @@
      *         server.
      */
     public InputStream getErrorStream() {
-        if (connected && !method.equals("HEAD") && responseCode >= HTTP_BAD_REQUEST)
+        if (connected && method != HEAD && responseCode >= HTTP_BAD_REQUEST)
             return uis;
         return null;
     }
@@ -791,12 +799,12 @@
         }
 
         // they are requesting a stream to write to. This implies a POST method
-        if (method.equals("GET")) {
-            method = "POST";
+        if (method == GET) {
+            method = POST;
         }
         
         // If the request method is neither PUT or POST, then you're not writing
-        if (!method.equals("PUT") && !method.equals("POST")) {
+        if (method != PUT && method != POST ) {
             throw new ProtocolException(Msg.getString("K008f", method));
         }
 
@@ -948,7 +956,7 @@
             }
         } while (getResponseCode() == 100);
 
-        if (method.equals("HEAD") || (responseCode >= 100 && responseCode <
200)
+        if (method == HEAD || (responseCode >= 100 && responseCode < 200)
                 || responseCode == HTTP_NO_CONTENT
                 || responseCode == HTTP_NOT_MODIFIED) {
             closeSocket();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java?rev=409546&r1=409545&r2=409546&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
Thu May 25 20:37:30 2006
@@ -18,7 +18,6 @@
 
 import java.io.IOException;
 import java.net.HttpURLConnection;
-import java.net.HttpURLConnectionAccessor;
 import java.net.ServerSocket;
 import java.net.SocketTimeoutException;
 import java.net.URL;
@@ -72,17 +71,7 @@
         c.setDoOutput(true);
         //use new String("POST") instead of simple "POST" to obtain other 
         //object instances then those that are in HttpURLConnection classes 
-        HttpURLConnectionAccessor.setRequestMethod(c, new String("POST"));
-        c.getOutputStream();
-
-        //use new String("PUT") instead of simple "PUT" to obtain other 
-        //object instances then those that are in HttpURLConnection classes 
-        HttpURLConnectionAccessor.setRequestMethod(c, new String("PUT"));
-        c.getOutputStream();
-
-        //use new String("GET") instead of simple "GET" to obtain other 
-        //object instances then those that are in HttpURLConnection classes 
-        HttpURLConnectionAccessor.setRequestMethod(c, new String("GET"));
+        c.setRequestMethod(new String("POST"));
         c.getOutputStream();
     }
 }



Mime
View raw message