jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1204163 - /jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
Date Sun, 20 Nov 2011 13:25:40 GMT
Author: pmouawad
Date: Sun Nov 20 13:25:39 2011
New Revision: 1204163

URL: http://svn.apache.org/viewvc?rev=1204163&view=rev
Log:
Use StringBuilder for String concatenation

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

Modified: jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java?rev=1204163&r1=1204162&r2=1204163&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java Sun
Nov 20 13:25:39 2011
@@ -517,7 +517,9 @@ public class PostWriterTest extends Test
         postWriter.sendPostData(connection, sampler);
         
         checkContentTypeUrlEncoded(connection);
-        expectedUrl = new String("title=" + titleValue.replaceAll("%20", "+").replaceAll("%C3%85",
"%C5") + "&description=" + descriptionValue.replaceAll("%C3%85", "%C5")).getBytes("US-ASCII");
+        StringBuilder sb = new StringBuilder();
+        expectedUrl = (sb.append("title=").append(titleValue.replaceAll("%20", "+").replaceAll("%C3%85",
"%C5"))
+        		.append("&description=").append(descriptionValue.replaceAll("%C3%85", "%C5"))).toString().getBytes("US-ASCII");
         checkContentLength(connection, expectedUrl.length);
         checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent());
         assertEquals(



Mime
View raw message