I'm trying to parse a string into integer in JMeter but failed due to following error. If I try to print the strings returned by vars.get, they look good.
2014/06/28 00:08:52 WARN - jmeter.assertions.BeanShellAssertion: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``if (ResponseCode != null && ResponseCode.equals ("200") == false ) { int i = In . . . '' : Typed variable declaration : Method Invocation Integer.parseInt
Following is my code
if (ResponseCode != null && ResponseCode.equals ("200") == false )
{
int i = Integer.parseInt(vars.get("currentPMCount"));
int j = Integer.parseInt(vars.get("pmViolationMaxCount"));
if( i > j ){
log.warn("PM count on server is greater than max allowed count.");
}
log.warn( "The return code is " + ResponseCode); // this goes to the JMeter log file
}
else
{
Failure=true ;
FailureMessage = "The response data size was not as expected" ;
}