On 07/01/2009, Laurent Michenaud <[email protected]> wrote:
> It depends.
> Just the following call will only return an ERREUR value.
>
> ${__regexFunction(<re>([0-9]+),$1$,ALL,|,ERREUR)};
>
> But that call ( with the testVar parameter added ) causes an nullpointer
> exception in the tear down phase. And i have to restart jmeter.
>
> ${__regexFunction(<re>([0-9]+),$1$,ALL,|,ERREUR,testVar)};
>
The null pointer exception is probably due to lack of access to test
variables in the teardown phase.
I've just done a test - using ${__log(Hello,,test)} - and the cause is revealed:
Test elements that are based on the Test Bean (such as BeanShell Post
and Pre-Processors) need to be "pepared" for use. This preparation is
done in the startup and closedown phases as well as in the running
phase, and involves evaluating the functions.
It should be reasonably easy to fix JMeter to handle the NPE better,
but it's not likely to be easy to fix the processing of functions
during startup and closedown.
I suggest you use a separate Regex Post-Processor to extract the data,
which can then be referenced from the variables - or use java methods
in the BeanShell code.
>
> 2009/1/7 Thomas Johnson <[email protected]>
>
> > Hm, that's quite strange. You might want to file a bug report about
> > this -- I'm not sure if that behavior is intentional or not. A quick
> > scan of the docs doesn't say anything about an init or teardown call
> > for postprocessors.
> >
> > In the meantime, do the extra runs cause a problem for you?
> >
> > On Wed, Jan 7, 2009 at 10:27 AM, Laurent Michenaud <[email protected]>
> > wrote:
> > > Yes, the bsh postprocessor is a child of the http sampler.
> > >
> > > I have just put an beanShell postprocessor with a log command (hello) and
> > > here what i can see in the log file :
> > >
> > > 2009/01/07 10:25:01 INFO - jmeter.engine.StandardJMeterEngine: Running
> > the
> > > test!
> > > 2009/01/07 10:25:01 INFO - jmeter.functions.LogFunction: Thread-493 :
> > hello
> > >
> > > 2009/01/07 10:25:01 INFO - jmeter.gui.util.JMeterMenuBar:
> > > setRunning(true,*local*)
> > > 2009/01/07 10:25:02 INFO - jmeter.engine.StandardJMeterEngine: Starting
> > 1
> > > threads for group Groupe de thread. Ramp up = 0.
> > > 2009/01/07 10:25:02 INFO - jmeter.engine.StandardJMeterEngine: Thread
> > will
> > > stop on error
> > > 2009/01/07 10:25:02 INFO - jmeter.threads.JMeterThread: Thread Groupe de
> > > thread 1-1 started
> > > 2009/01/07 10:25:02 INFO - jmeter.services.FileServer: Stored:
> > > /********************/users.txt
> > > 2009/01/07 10:25:02 INFO - jmeter.functions.LogFunction: Groupe de
> > thread
> > > 1-1 : hello
> > > 2009/01/07 10:25:02 INFO - jmeter.threads.JMeterThread: Thread Groupe de
> > > thread 1-1 is done
> > > 2009/01/07 10:25:02 INFO - jmeter.engine.StandardJMeterEngine: Ending
> > > thread Groupe de thread 1-1
> > > 2009/01/07 10:25:02 INFO - jmeter.engine.StandardJMeterEngine: Stopping
> > > test
> > > 2009/01/07 10:25:02 INFO - jmeter.engine.StandardJMeterEngine: Notifying
> > > test listeners of end of test
> > > 2009/01/07 10:25:02 INFO - jmeter.services.FileServer: Close:
> > > /********************/users.txt
> > > 2009/01/07 10:25:02 INFO - jmeter.functions.LogFunction: Thread-495 :
> > hello
> > >
> > > 2009/01/07 10:25:02 INFO - jmeter.gui.util.JMeterMenuBar:
> > > setRunning(false,*local*)
> > > 2009/01/07 10:25:02 INFO - jmeter.engine.StandardJMeterEngine: Test has
> > > ended
> > >
> > > I don't know what is Thread-493 and Thread-495
> > >
> > > 2009/1/7 Thomas Johnson <[email protected]>
> > >
> > >> Just to double-check, is your Test Plan structured as follows?
> > >> Thread Group
> > >> - HTTP Sampler (page 1)
> > >> - HTTP Sampler (page 2)
> > >> -- BSH Postprocessor
> > >>
> > >> The Postprocessor needs to be a child of the sampler. If not, it might
> > >> be picking up the other Samplers in your test plan as well.
> > >>
> > >> On Wed, Jan 7, 2009 at 9:32 AM, Laurent Michenaud <[email protected]
> > >
> > >> wrote:
> > >> > Hi,
> > >> >
> > >> > I have added a bsh post processor on a single httpd request node.
> > >> > The post processor is executed three times and i don't understand
> > >> > why. Only one thread is configured and only one loop.
> > >> >
> > >> > It is like there is a kind of init, the loop execution(thread group),
> > and
> > >> > then the release.
> > >> > It is a problem for me as my bsh script fails on the init/release
> > phase.
> > >> > It works well on the loop execution.
> > >> >
> > >> > Thanks for your response.
> > >> > Laurent
> > >> >
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: [email protected]
> > >> For additional commands, e-mail: [email protected]
> > >>
> > >>
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]