Thanks, very useful. Would it be OK to add this to the JMeter distribution?
S. On Mon, 30 Aug 2004 10:20:09 -0500, K.P. Thottam <[EMAIL PROTECTED]> wrote: > Hi All , > > I was looking around for a sample for BeanShell assertion but could not > find one . Anyway I dug around and got a better understanding and here > is a sample for anyone else looking for it : > > if (ResponseCode != null && ResponseCode.equals ("200") == false ) > { > // this is standard stuff > Failure=true ; > FailureMessage ="Response code was not a 200 response code > it was " + ResponseCode ; > print ( "the return code is " + ResponseCode ) ; > } > else > { > > try > { > // non standard stuff where BeanShell assertion will be > really powerful . > // in my example I just test the size , but you could extend it further > to actually test the content against another file . > byte [] arr = (byte[]) ResponseData ; > // print ( arr.length ) ; // use this to > determin the size > if (arr != null && arr.length != 25218) > { > Failure= true ; > FailureMessage = "The response data > size was not as expected" ; > } > else if ( arr == null ) > { > Failure= true ; > FailureMessage = "The response data > size was null" ; > > } > } > catch ( Throwable t ) > { > print ( t ) ; > } > > } > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]