jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: query help on ActionRouter
Date Sun, 11 Mar 2012 12:57:23 GMT
On 8 March 2012 22:11, Pratik Dam <pdam.2010@gmail.com> wrote:
> Hi JMeter   Dev   ,
>  I have  a   question on the   right   usage  of    ActionRouter  Class
> .  I have   a  Jmeter  listener  where  I    want to  do certain activity
> like  a Web Services  call before  the Test is   run  (TestName.Start)
> happens  .
>
>
> So   in the  init  method  of my listener   I have  a   few  register
> calls
>
> c_save =Class.forName("org.apache.jmeter.action.Save") ;
> ActionRouter.getInstance().addPreActionListener(c_save, pre_save_listener);
>
> and  pre_save_listener looks  like  this
> =================================
>
>  save_listener = new ActionListener() {
>
>            @Override
>            public synchronized void actionPerformed(ActionEvent e) {  }
>
>
>       ....public  void  pre_save_listener(){
>            do_something_here()
>    }
>
> };}
>
> All of this is  fine  . But am not able to  deregister   cleanly .
>
> I want   to  a  deregistration call   on the  Exit Button  . The  call
> seems  to happen but  I  notice  that the  de-registration process  is  not
> clean . Now the  deregistration process looks  like a   few  calls
>            ActionRouter.getInstance().removePostActionListener(c_close,
> post_close_listener);
>
> Please  advise   whats  the  best/right   way  to do this

The ActionRouter class is intended for handling JMeter GUI events
(e.g. button press).

It should not be used in Listener code.

You probably want to implement the TestListener interface.

> Thanks
> Pratik

Mime
View raw message