You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by testerinCO <cm...@comcast.net> on 2011/06/06 06:37:39 UTC
Colon in string concatenation inserts a space
Here is the string I need to create:
Authorization Basic 2:1307334312:9bf77a1d388d5b403d3383be4b11df00. Notice
no space before or after the colons ":".
Here are the variables via debug sampler:
newDate=1307334312
newDate2=1307334312
s=239erx487ysSkUA2dLkd7sySX
timehash=9bf77a1d388d5b403d3383be4b11df00
Here is the output:
Authorization Basic 2: 1307334312:9bf77a1d388d5b403d3383be4b11df00. Notice
the space after the 1st colon. When I change the 1st colon to a different
character (i.e. ";"), the space is inserted after the second colon. What is
the uniqueness of the ":"? I need to use a colon as a delimiter between the
fields.
I have the following beanshell script:
String authString = "Basic 2" + ":" + "${newDate2}" + ":" + "${timehash}";
vars.put("authorizationString",authString);
--
View this message in context: http://jmeter.512774.n5.nabble.com/Colon-in-string-concatenation-inserts-a-space-tp4457644p4457644.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Colon in string concatenation inserts a space
Posted by zillakilla <zi...@sogetthis.com>.
I couldn't reproduce your issue, so I hard coded the problem!!
This is the solution I came up with (maybe it helps?):
String authString = "Basic 2" + ":" +
"${__jexl(vars.get("newDate2").replace(" "\,""))}" + ":" + "${timehash}";
vars.put("authorizationString",authString);
zK
--
View this message in context: http://jmeter.512774.n5.nabble.com/Colon-in-string-concatenation-inserts-a-space-tp4457644p4459074.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Colon in string concatenation inserts a space
Posted by testerinCO <cm...@comcast.net>.
Thank you for your help.
--
View this message in context: http://jmeter.512774.n5.nabble.com/Colon-in-string-concatenation-inserts-a-space-tp4457644p4460675.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Colon in string concatenation inserts a space
Posted by Deepak Shetty <sh...@gmail.com>.
>or even deliberate feature
I think thats likely to be the case
http://www.faqs.org/rfcs/rfc2616.html
Each header field consists of a name followed by a colon (":") and the
field value. Field names are case-insensitive.
*The field value MAY be preceded by any amount of LWS, though a single
SP is preferred.*
This is a bug in the application code - it should be able to deal with
multiple spaces (or as sebb says ask the plugin creator)
regards
deepak
On Mon, Jun 6, 2011 at 12:33 PM, sebb <se...@gmail.com> wrote:
> On 6 June 2011 16:37, testerinCO <cm...@comcast.net> wrote:
> > Yes, it gives a space after the first colon. I'm using the Jmeter Rest
> > Sampler. Maybe there is a parse issue in the Header.
>
> The Rest Sampler is a 3rd party add-on; it is not released with Apache
> JMeter, so please report any issues with it to the appropriate support
> channel.
>
> If you add the Debug Sampler after the BeanShell test element you can
> check whether or not there is a space after the colon.
> I cannot see how BeanShell can do this, as it is basically Java code.
>
> It's much more likely to be a bug (or even deliberate feature) of the
> Rest sampler.
>
> > --
> > View this message in context:
> http://jmeter.512774.n5.nabble.com/Colon-in-string-concatenation-inserts-a-space-tp4457644p4459014.html
> > Sent from the JMeter - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
Re: Colon in string concatenation inserts a space
Posted by sebb <se...@gmail.com>.
On 6 June 2011 16:37, testerinCO <cm...@comcast.net> wrote:
> Yes, it gives a space after the first colon. I'm using the Jmeter Rest
> Sampler. Maybe there is a parse issue in the Header.
The Rest Sampler is a 3rd party add-on; it is not released with Apache
JMeter, so please report any issues with it to the appropriate support
channel.
If you add the Debug Sampler after the BeanShell test element you can
check whether or not there is a space after the colon.
I cannot see how BeanShell can do this, as it is basically Java code.
It's much more likely to be a bug (or even deliberate feature) of the
Rest sampler.
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Colon-in-string-concatenation-inserts-a-space-tp4457644p4459014.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Colon in string concatenation inserts a space
Posted by testerinCO <cm...@comcast.net>.
Yes, it gives a space after the first colon. I'm using the Jmeter Rest
Sampler. Maybe there is a parse issue in the Header.
--
View this message in context: http://jmeter.512774.n5.nabble.com/Colon-in-string-concatenation-inserts-a-space-tp4457644p4459014.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Colon in string concatenation inserts a space
Posted by zillakilla <zi...@sogetthis.com>.
Does this give you extra (unwanted) space?:
String authString = "Basic 2:" + "${newDate2}" + ":" + "${timehash}";
vars.put("authorizationString",authString);
zK
--
View this message in context: http://jmeter.512774.n5.nabble.com/Colon-in-string-concatenation-inserts-a-space-tp4457644p4457989.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org