Summary: | GUI editor for Beanshell doesn't always pick up changes, code is lost | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | David Martinez <david> |
Component: | Main | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 2.3 | ||
Target Milestone: | --- | ||
Hardware: | Macintosh | ||
OS: | Mac OS X 10.4 |
Description
David Martinez
2007-07-20 14:16:58 UTC
Note that I get the exact same goofy and unpredictable behaviour when editing a regular expression dialog in a regex postprocessor. The text is in the box, but when I hit run, jmeter doesn't actually run, and when I click out of the dialog and back in, my old regex is there staring back at me, laughing. Using Jmeter 2.3RC3 It appears that using Control+S to save a test plan has always been broken for GUI items that use TestBeanGUI. For example, using CSV Dataset: enter a value in the filename field, and save the plan using control+S. Exit and reload the plan - the value has not been saved. The difference in 2.3RC3 is that this behaviour has become obvious, as the saved version is now reflected in the GUI. The same problem applies to other short-cut keys such as Control+R. Normally the value in the GUI field is saved whenever there is a focus-lost event however this does not happen for short-cut keys. (In reply to comment #2) > It appears that using Control+S to save a test plan has always been broken for > GUI items that use TestBeanGUI. > > For example, using CSV Dataset: enter a value in the filename field, and save > the plan using control+S. Exit and reload the plan - the value has not been > saved. > > The difference in 2.3RC3 is that this behaviour has become obvious, as the > saved version is now reflected in the GUI. > > The same problem applies to other short-cut keys such as Control+R. > > Normally the value in the GUI field is saved whenever there is a focus-lost > event however this does not happen for short-cut keys. The problem seems to be that the "propertyChange" event for the PropertyEditor in the TestBeanGui is not fired until after the changes have been stored. If you change the comment of the BeanShell Postprocessor and hit Ctrl+S, that change is saved. The problem is that the PropertyChange events have not been processed before the TestBeanGui.modifyTestElement method is moving changes from gui to model. Therefore, the changes are not saved. I do not see an easy fix at the moment, will have to investigate more on how the java PropertyEditor works in conjunction with keyboard shortcuts. (In reply to comment #1) > Note that I get the exact same goofy and unpredictable behaviour when editing a > regular expression dialog in a regex postprocessor. The text is in the box, but > when I hit run, jmeter doesn't actually run, and when I click out of the dialog > and back in, my old regex is there staring back at me, laughing. > > Using Jmeter 2.3RC3 I think you are in fact observing bug 43122, which I have just made a patch for. Added code to TestBeanGUI.modifyTestElement() to copy the values of the fields from the GUI. Applied to SVN in r571348. There was a slight problem with the previous fix - only one change was saved, as there was a return in the loop. This has been corrected in r571407. BTW, I looked into propertyChange events - the event was not being fired for short-cut keys. This appears to be a feature of Swing/AWT. The propertyChange code became redundant; now both TestBeanGUI and other GUI classes save the field contents in modifyTestElement(). This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1980 |