You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jakarta.apache.org by se...@apache.org on 2010/11/03 14:48:51 UTC

svn commit: r1030466 - /jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java

Author: sebb
Date: Wed Nov  3 13:48:51 2010
New Revision: 1030466

URL: http://svn.apache.org/viewvc?rev=1030466&view=rev
Log:
Disable check of Content-Length. Does not work on JDK 1.6.0_22+, and anyway is not particularly useful as a test

Modified:
    jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java

Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java?rev=1030466&r1=1030465&r2=1030466&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java Wed Nov  3 13:48:51 2010
@@ -88,9 +88,6 @@ public class TestHTTPSamplersAgainstHttp
                     output.write(TEST_FILE_CONTENT);
                     output.flush();
                     output.close();
-                    // Temporary hack to allow tests to complete on Sun Java 1.6.0_22
-                    // See: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6996110
-                    System.setProperty("sun.net.http.allowRestrictedHeaders", "true");
             }
             
             @Override
@@ -100,7 +97,6 @@ public class TestHTTPSamplersAgainstHttp
                     httpServer = null;
                     // delete temporay file
                     temporaryFile.delete();
-                    System.setProperty("sun.net.http.allowRestrictedHeaders", "false");
             }
         };
         return setup;
@@ -1008,16 +1004,19 @@ public class TestHTTPSamplersAgainstHttp
     private boolean isInRequestHeaders(String requestHeaders, String headerName, String headerValue) {
         return checkRegularExpression(requestHeaders, headerName + ": " + headerValue);
     }
-    
+  
+    // Java 1.6.0_22+ no longer allows Content-Length to be set, so don't check it.
+    // See: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6996110
+    // TODO any point in checking the other headers?
     private void checkHeaderTypeLength(String requestHeaders, String contentType, int contentLen) {
         boolean typeOK = isInRequestHeaders(requestHeaders, HTTPSamplerBase.HEADER_CONTENT_TYPE, contentType);
-        boolean lengOK = isInRequestHeaders(requestHeaders, HTTPSamplerBase.HEADER_CONTENT_LENGTH, Integer.toString(contentLen));
+//        boolean lengOK = isInRequestHeaders(requestHeaders, HTTPSamplerBase.HEADER_CONTENT_LENGTH, Integer.toString(contentLen));
         if (!typeOK){
             fail("Expected type:" + contentType + " in:\n"+ requestHeaders);
         }
-        if (!lengOK){
-            fail("Expected & length: " +contentLen + " +");
-        }
+//        if (!lengOK){
+//            fail("Expected & length: " +contentLen + " in:\n"+requestHeaders);
+//        }
     }
    
     private String getSentRequestHeaderValue(String requestHeaders, String headerName) {



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org