You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2011/11/20 14:25:40 UTC
svn commit: r1204163 -
/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
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(