String Strangeness

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

String Strangeness

mark wilkinson
Using bsh-2.0b5 embedded in JMeter-2.5.1

Trying to do a simple string assignment in a test script (test.bsh):

String rawBCString = "288/SetEntryList/7/ITSPUAT9/Home Page2/\9";

And get the following...

<snip>

bsh % source("test.bsh");
// Error: // Uncaught Exception: Method Invocation
this.interpreter.source : at Line: 14 : in file:
/bsh/commands/source.bsh : this .interpreter .source ( filename , this
.caller .namespace )

Called from method: source : at Line: 1 : in file: <unknown file> :
source ( "test.bsh" )
Target exception: Sourced file: test.bsh Token Parsing Error: Lexical
error at line 1, column 63.  Encountered: "9" (57), after :
"\"288/SetEntryList/7/ITSPUAT9/Home Page2/\\": <at unknown location>


bsh %

<snip>

Anyone got any ideas what's going on here? I think it's something to
do with escape chars but having a "9" after a "\" doesn't seem like
anything odd to me. Looks like java is taking the raw string, escaping
all the "\" chars and then barfing on the result..

Cheers

MarkW

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: String Strangeness

David Lee
I dont think "\9" is a valid escape sequence.


----------------------------------------
David A. Lee
[hidden email]
http://www.xmlsh.org

-----Original Message-----
From: mark wilkinson [mailto:[hidden email]]
Sent: Tuesday, January 31, 2012 7:39 AM
To: [hidden email]
Subject: [Beanshell-users] String Strangeness

Using bsh-2.0b5 embedded in JMeter-2.5.1

Trying to do a simple string assignment in a test script (test.bsh):

String rawBCString = "288/SetEntryList/7/ITSPUAT9/Home Page2/\9";

And get the following...

<snip>

bsh % source("test.bsh");
// Error: // Uncaught Exception: Method Invocation
this.interpreter.source : at Line: 14 : in file:
/bsh/commands/source.bsh : this .interpreter .source ( filename , this
.caller .namespace )

Called from method: source : at Line: 1 : in file: <unknown file> :
source ( "test.bsh" )
Target exception: Sourced file: test.bsh Token Parsing Error: Lexical
error at line 1, column 63.  Encountered: "9" (57), after :
"\"288/SetEntryList/7/ITSPUAT9/Home Page2/\\": <at unknown location>


bsh %

<snip>

Anyone got any ideas what's going on here? I think it's something to
do with escape chars but having a "9" after a "\" doesn't seem like
anything odd to me. Looks like java is taking the raw string, escaping
all the "\" chars and then barfing on the result..

Cheers

MarkW

----------------------------------------------------------------------------
--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users