http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Java_Request Basically implement the JavaSamplerClient interface, put the jar of your class in lib and pass any parameters that you need
http://jakarta.apache.org/jmeter/api/org/apache/jmeter/protocol/java/sampler/JavaSamplerClient.html I believe two samples are provide with the jmeter distribution for e.g. http://www.docjar.com/html/api/org/apache/jmeter/protocol/java/test/JavaTest.java.html You can return the value in SampleResult or extract it. There was a utility as well that allowed you to get to the JmeterVariables object so that you could set the hash value as a variable as well , but I dont remember it right now (nor is google getting me the answer :) , i think its there somewhere in the archive) regards deepak On Thu, Oct 22, 2009 at 9:27 AM, mwolfe38 <[email protected]> wrote: > > Ok so if I choose to use a java sampler what would that look like. I've > programmed in java for years but I'm just not sure how this works. Are > there > any examples you could point me to? > > Thanks. > > Deepak Shetty wrote: > > > > Hi > > In java you could do something like > > > http://stackoverflow.com/questions/1589996/calculate-sha1-or-md5-hash-in-ireport > > so use a BSH processor or Java Sampler and you can get the value > > > > If you want to continue using command line you'd need to create a > JAva/BSH > > sampler and user Runtime.exec(), and interpret the response. > > http://oreilly.com/pub/h/1092 > > > > regards > > deepak > > > > > > On Wed, Oct 21, 2009 at 11:07 AM, mwolfe38 <[email protected]> wrote: > > > >> > >> I have a jmeter task that automates the process of uploading some file > to > >> a > >> server. With this upload I have to send what the sha1 is of the file. > >> Right > >> now I do it manually using the command fciv -sha1 [filename] > >> which will print the sha1. > >> I would like to somehow capture this programatically and store it in a > >> variable by using a bsf preprocessor rather than doing it manually and > >> putting the value into a user defined variable. > >> > >> Any ideas how i can get the sha1 of a file (either by calling a command > >> from > >> bsf or by using some library that can compute a sha1 in a bsf > language)? > >> -- > >> View this message in context: > >> > http://www.nabble.com/Calling-a-batch-script-from-a-bsf-preprocessor-to-get-SHA1-tp25997427p25997427.html > >> Sent from the JMeter - User mailing list archive at Nabble.com. > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Calling-a-batch-script-from-a-bsf-preprocessor-to-get-SHA1-tp25997427p26013057.html > Sent from the JMeter - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >

