jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1212902 - /jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java
Date Sat, 10 Dec 2011 22:21:13 GMT
Author: pmouawad
Date: Sat Dec 10 22:21:13 2011
New Revision: 1212902

URL: http://svn.apache.org/viewvc?rev=1212902&view=rev
Log:
Bug 52052 - Using a delimiter to separate result-messages for JMS Subscriber
ER1: the separator should not be placed after the last message;
ER2: no separator for one message;

Modified:
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java

Modified: jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java?rev=1212902&r1=1212901&r2=1212902&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java
(original)
+++ jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java
Sat Dec 10 22:21:13 2011
@@ -178,7 +178,7 @@ public class SubscriberSampler extends B
                 msg = SUBSCRIBER.getMessage(calculateWait(until, now));
                 if (msg != null){
                     read++;
-                    extractContent(buffer, propBuffer, msg);
+                    extractContent(buffer, propBuffer, msg, (read == loop));
                 }
             } catch (JMSException e) {
                 log.warn("Error "+e.toString());
@@ -232,7 +232,7 @@ public class SubscriberSampler extends B
     }
 
     private void extractContent(StringBuilder buffer, StringBuilder propBuffer,
-            Message msg) {
+            Message msg, boolean isLast) {
         if (msg != null) {
             try {
                 if (msg instanceof TextMessage){
@@ -253,7 +253,7 @@ public class SubscriberSampler extends B
                     }
                 }
                 Utils.messageProperties(propBuffer, msg);
-                if(!StringUtils.isEmpty(separator)) {
+                if(!isLast && !StringUtils.isEmpty(separator)) {
                 	propBuffer.append(separator);
                 	buffer.append(separator);
                 }



Mime
View raw message