You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2007/06/14 14:45:32 UTC

DO NOT REPLY [Bug 42660] New: - BeanShell* : add property to specify if "testStarted" etc methods should be called

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42660>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42660

           Summary: BeanShell* : add property to specify if "testStarted"
                    etc methods should be called
           Product: JMeter
           Version: 2.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HTTP
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: alf@i100.no


Currently, the BeanShellPreProcessor, BeanShellPostProcessor, BeanShellSampler
and BeanShellAssertion all try to call the "testStarted", "testEnded",
"threadStarted", and "threadFinished" beanshell methods.

I think that by default, most people will not implement these methods, and if
they do, it will be in files that they include using the properties in the
jmeter properties file, for example the
beanshell.sampler.init=BeanShellSampler.bshrc property.

To avoid filling the debug log with messages about missing beanshell methods,
and to avoid an exception always being thrown in those four classes whenever
"testStarted", "testEnded", "threadStarted", and "threadFinished" occurs, I
suggest to add another property to the jmeter properties file, to control
whether those four classes should try to call the "testStarted" etc methods.

So I suggest a property a'la beanshell.call_event_methods= true or false, and
false in the default jmeter properties file, and that the four BeanShell*
classes are changed to use that property wisely.

I was also wondering if the four BeanShell* classes in their "init" methods
could figure out which of the "testEnded", "testStarted" etc method are
implemented in the file being sent to the BeanShellInterpreter. Then the classes
could call only those methods it knows are present. But I guess that will be
quite difficult to do, therefore I suggest just using a property.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 42660] - BeanShell* : add property to specify if "testStarted" etc methods should be called

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42660>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42660


sebb@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From sebb@apache.org  2007-06-22 11:19 -------
Thanks for the patches.

Applied the 2nd patch (20368) with some minor changes to reduce the number of 
differences.

Also there seemed to be no need to overload the clone() method in the 
BeanShellTestElement class, so I removed it from the subclasses.

The patch is in SVN r549919.

Closing the bug.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 42660] - BeanShell* : add property to specify if "testStarted" etc methods should be called

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42660>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42660





------- Additional Comments From alf@i100.no  2007-06-19 00:47 -------
Created an attachment (id=20368)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20368&action=view)
Suggestd patch with larger changes

This suggested patch also uses the init file setting to decide if there is any
need to try to call the "testStarted" beanshell methods.

But this patch makes an abstract class BeanShellTestElement, where all the
common code is put. I think that makes sense, so the code does not have to be
duplicated in 6 different classes.

This patch also changes the BeanShellTimer and BeanShellListener, which was not
changed in the minimal suggested patch above.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 42660] - BeanShell* : add property to specify if "testStarted" etc methods should be called

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42660>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42660





------- Additional Comments From alf@i100.no  2007-06-18 23:20 -------
Created an attachment (id=20367)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20367&action=view)
Suggested patch

>From what I understand, the methods called by the "testStarted", "testEnded"
etc in the various BeanShellAssertion, BeanShellPreProcessor etc have to be
defined in the init file specified for the class in the jmeter.properties file.
This means that if the corresponding property for the class is not specified,
there is no need to try to call the beanshell "testStarted" method.

The suggested patch adds a check to see if the init file property is defined
for the class, and if it is not, then no attempt is made to try to call methods
on testStarted, testEnded etc.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org