Author: sebb
Date: Sat Apr 24 17:55:23 2010
New Revision: 937662

URL: http://svn.apache.org/viewvc?rev=937662&view=rev
Log:
Add TODO Charset markers

Modified:
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellClient.java
    
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/Base64Encoder.java
    
jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
    
jakarta/jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java
    
jakarta/jmeter/trunk/test/src/org/apache/jmeter/monitor/model/benchmark/ParseBenchmark.java
    
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java
    
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
    
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java

Modified: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellClient.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellClient.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellClient.java 
(original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellClient.java 
Sat Apr 24 17:55:23 2010
@@ -78,7 +78,7 @@ public class BeanShellClient {
     private static void sendLine( String line, OutputStream outPipe )
     throws IOException
     {
-        outPipe.write( line.getBytes() );
+        outPipe.write( line.getBytes() ); // TODO - charset?
         outPipe.flush();
     }
 

Modified: 
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
 Sat Apr 24 17:55:23 2010
@@ -196,7 +196,7 @@ public class FTPSampler extends Abstract
                     if (isUpload()) {
                         String contents=getLocalFileContents();
                         if (contents.length() > 0){
-                            byte bytes[] = contents.getBytes();// TODO this 
assumes local encoding
+                            byte bytes[] = contents.getBytes(); // TODO - 
charset?
                             input = new ByteArrayInputStream(bytes);
                             res.setBytes(bytes.length);
                         } else {

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
 Sat Apr 24 17:55:23 2010
@@ -437,7 +437,7 @@ public class Proxy extends Thread {
     private void writeToClient(SampleResult res, OutputStream out, boolean 
forcedHTTPS) throws IOException {
         try {
             String responseHeaders = massageResponseHeaders(res, forcedHTTPS);
-            out.write(responseHeaders.getBytes());
+            out.write(responseHeaders.getBytes()); // TODO - charset?
             out.write(CRLF_BYTES);
             out.write(res.getResponseData());
             out.flush();

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
 Sat Apr 24 17:55:23 2010
@@ -280,7 +280,7 @@ public class AjpSampler extends HTTPSamp
                     sb.append(arg.getStringValue());
                 }
                 stringBody = sb.toString();
-                byte [] sbody = stringBody.getBytes(); //FIXME - encoding
+                byte [] sbody = stringBody.getBytes(); // TODO - charset?
                 cl = sbody.length;
                 body = new ByteArrayInputStream(sbody);
             }

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
 Sat Apr 24 17:55:23 2010
@@ -40,7 +40,7 @@ import org.apache.jmeter.testelement.pro
 public class PostWriter {
 
     private static final String DASH_DASH = "--";  // $NON-NLS-1$
-    private static final byte[] DASH_DASH_BYTES = DASH_DASH.getBytes();
+    private static final byte[] DASH_DASH_BYTES = {'-', '-'};
 
     /** The bounday string between multiparts */
     protected final static String BOUNDARY = 
"---------------------------7d159c1302d0y0"; // $NON-NLS-1$
@@ -107,7 +107,7 @@ public class PostWriter {
             for (int i=0; i < files.length; i++) {
                 HTTPFileArg file = files[i];
                 // First write the start multipart file
-                byte[] header = file.getHeader().getBytes(); // TODO what 
encoding should be used here?
+                byte[] header = file.getHeader().getBytes();  // TODO - 
charset?
                 out.write(header);
                 // Retrieve the formatted data using the same encoding used to 
create it
                 postedBody.append(new String(header)); // TODO - charset?
@@ -122,7 +122,7 @@ public class PostWriter {
                 postedBody.append(new String(fileMultipartEndDivider, 
ENCODING));
                 if(i + 1 < files.length) {
                     out.write(CRLF);
-                    postedBody.append(new String(CRLF));
+                    postedBody.append(new String(CRLF)); // TODO - charset?
                 }
             }
             // Write end of multipart

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/Base64Encoder.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/Base64Encoder.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/Base64Encoder.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/Base64Encoder.java
 Sat Apr 24 17:55:23 2010
@@ -38,7 +38,7 @@ public final class Base64Encoder {
     }
 
     public final static String encode(String s) {
-        return encode(s.getBytes());
+        return encode(s.getBytes()); // TODO - charset?
     }
 
     public final static String encode(byte[] bs) {

Modified: 
jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
 Sat Apr 24 17:55:23 2010
@@ -63,7 +63,7 @@ public class TCPClientImpl extends Abstr
      */
     public void write(OutputStream os, String s) {
         try {
-            os.write(s.getBytes());
+            os.write(s.getBytes()); // TODO - charset?
             os.flush();
         } catch (IOException e) {
             log.warn("Write error", e);

Modified: 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java
 (original)
+++ 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java
 Sat Apr 24 17:55:23 2010
@@ -134,7 +134,7 @@ public class XMLSchemaAssertionTest exte
     }
 
     public void testAssertionEmptyResult() throws Exception {
-        result.setResponseData("".getBytes());
+        result.setResponseData("", null);
         assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
         AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
         testLog.debug("isError() " + res.isError() + " isFailure() " + 
res.isFailure());
@@ -145,7 +145,7 @@ public class XMLSchemaAssertionTest exte
     }
 
     public void testAssertionBlankResult() throws Exception {
-        result.setResponseData(" ".getBytes());
+        result.setResponseData(" ", null);
         assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
         AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
         testLog.debug("isError() " + res.isError() + " isFailure() " + 
res.isFailure());
@@ -157,7 +157,7 @@ public class XMLSchemaAssertionTest exte
 
     public void testXMLTrailingcontent() throws Exception {
         ByteArrayOutputStream baos = readBA("testfiles/XMLSchematest.xml");
-        baos.write("extra".getBytes());
+        baos.write("extra".getBytes()); // TODO - charset?
         result.setResponseData(baos.toByteArray());
         assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd");
         AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
@@ -170,7 +170,7 @@ public class XMLSchemaAssertionTest exte
 
     public void testXMLTrailingwhitespace() throws Exception {
         ByteArrayOutputStream baos = readBA("testfiles/XMLSchematest.xml");
-        baos.write(" \t\n".getBytes());
+        baos.write(" \t\n".getBytes()); // TODO - charset?
         result.setResponseData(baos.toByteArray());
         assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd");
         AssertionResult res = assertion.getResult(jmctx.getPreviousResult());

Modified: 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/monitor/model/benchmark/ParseBenchmark.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/monitor/model/benchmark/ParseBenchmark.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/monitor/model/benchmark/ParseBenchmark.java
 (original)
+++ 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/monitor/model/benchmark/ParseBenchmark.java
 Sat Apr 24 17:55:23 2010
@@ -83,7 +83,7 @@ public class ParseBenchmark {
                 start = System.currentTimeMillis();
                 for (int idx = 0; idx < loops; idx++) {
                     // NOTUSED org.apache.jmeter.monitor.model.Status st =
-                    of.parseBytes(contents.getBytes());
+                    of.parseBytes(contents.getBytes()); // TODO - charset?
                 }
                 end = System.currentTimeMillis();
                 System.out.println("elapsed Time: " + (end - start));

Modified: 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java
 (original)
+++ 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java
 Sat Apr 24 17:55:23 2010
@@ -599,7 +599,7 @@ public class TestHttpRequestHdr  extends
         }
         else {
             // Most browsers use ISO-8859-1 as default encoding, even if spec 
says UTF-8
-            return postBody.getBytes().length;
+            return postBody.getBytes().length; // TODO - charset?
         }
     }
 }

Modified: 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java?rev=937662&r1=937661&r2=937662&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
 (original)
+++ 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
 Sat Apr 24 17:55:23 2010
@@ -160,7 +160,7 @@ public class PostWriterTest extends Test
         postWriter.sendPostData(connection, sampler);
         
         checkContentTypeUrlEncoded(connection);
-        byte[] expectedUrl = 
"title=mytitle&description=mydescription".getBytes();
+        byte[] expectedUrl = 
"title=mytitle&description=mydescription".getBytes(); // TODO - charset?
         checkContentLength(connection, expectedUrl.length);
         checkArraysHaveSameContent(expectedUrl, 
connection.getOutputStreamContent());
         expectedUrl = 
"title=mytitle&description=mydescription".getBytes(UTF_8);
@@ -220,7 +220,8 @@ public class PostWriterTest extends Test
         checkContentLength(connection, TEST_FILE_CONTENT.length);        
         checkArraysHaveSameContent(TEST_FILE_CONTENT, 
connection.getOutputStreamContent());
         // Check that other encoding is not the current encoding
-        checkArraysHaveDifferentContent(new 
String(TEST_FILE_CONTENT).getBytes(otherEncoding), 
connection.getOutputStreamContent());
+        checkArraysHaveDifferentContent(new String(TEST_FILE_CONTENT) // TODO 
- charset?
+            .getBytes(otherEncoding), connection.getOutputStreamContent());
         
         // If we have both file as body, and form data, then only form data 
will be sent
         setupFormData(sampler);
@@ -230,7 +231,7 @@ public class PostWriterTest extends Test
         postWriter.sendPostData(connection, sampler);
         
         checkContentTypeUrlEncoded(connection);
-        byte[] expectedUrl = 
"title=mytitle&description=mydescription".getBytes();
+        byte[] expectedUrl = 
"title=mytitle&description=mydescription".getBytes(); // TODO - charset?
         checkContentLength(connection, expectedUrl.length);
         checkArraysHaveSameContent(expectedUrl, 
connection.getOutputStreamContent());
     }
@@ -712,7 +713,7 @@ public class PostWriterTest extends Test
             output.write(titleValue.getBytes(contentEncoding));
         }
         else {
-            output.write(titleValue.getBytes());
+            output.write(titleValue.getBytes()); // TODO - charset?
         }
         output.write(CRLF);
         output.write(DASH_DASH);
@@ -734,7 +735,7 @@ public class PostWriterTest extends Test
             output.write(descriptionValue.getBytes(contentEncoding));
         }
         else {
-            output.write(descriptionValue.getBytes());
+            output.write(descriptionValue.getBytes()); // TODO - charset?
         }
         output.write(CRLF);
         output.write(DASH_DASH);

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=937662&r1=937661&r2=937662&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
 Sat Apr 24 17:55:23 2010
@@ -1198,7 +1198,7 @@ public class TestHTTPSamplersAgainstHttp
             output.write(titleValue.getBytes(contentEncoding));
         }
         else {
-            output.write(titleValue.getBytes());
+            output.write(titleValue.getBytes()); // TODO - charset?
         }
         output.write(CRLF);
         output.write(DASH_DASH);
@@ -1221,7 +1221,7 @@ public class TestHTTPSamplersAgainstHttp
             output.write(descriptionValue.getBytes(contentEncoding));
         }
         else {
-            output.write(descriptionValue.getBytes());
+            output.write(descriptionValue.getBytes()); // TODO - charset?
         }
         output.write(CRLF);
         output.write(DASH_DASH);


Reply via email to