Summary: | Upgrade Test Plan feature : NameUpdater does not upgrade properties (r1227589) | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Philippe Mouawad <p.mouawad> |
Component: | Main | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | p.mouawad |
Priority: | P2 | ||
Version: | Nightly (Please specify date) | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | |||
Bug Blocks: | 52048 | ||
Attachments: | Test Plan to upgrade |
Description
Philippe Mouawad
2012-01-13 22:28:20 UTC
Affects 2.5.1. The methods were originally all used by the OldSaveService class. This handled the previous JMX format (Avalon). Support for this format (and the OldSaveService class) was dropped in JMeter 2.4. It's not clear why the methods were/are not used by the classes that handle the new format (which is loaded using XStream). Looks like this is an accidental omission that was never previously noticed. It's also not clear why the getCurrentName(String) method is called by JMeterTreeModel, rather than the class that reads the JMX file format. This was added to JMeterTreeModel in r323315, but the SVN log entry is not very explicit about why the change was done there, rather than when reading the JMX file. I think the old names can only originate from a JMX file, so if they are fixed as part of reading the file, then there should be no need to deal with the old names anywhere else in JMeter. For reference, here's how the methods were used in OldSaveService.java [1] private static TestElement createTestElement(...){ ... testClass = value of "class" attribute gui_class = value of guiClass property ... newClass = NameUpdater.getCurrentTestName(testClass,gui_class); element = (TestElement) Class.forName(newClass).newInstance(); ... } The above method was used for creating all TestElement instances. private static JMeterProperty createProperty(...){ ... // Do upgrade translation: name = NameUpdater.getCurrentName(name, testClass); if (TestElement.GUI_CLASS.equals(name)) { value = NameUpdater.getCurrentName(value); } else if (TestElement.TEST_CLASS.equals(name)) { value=testClass; // must always agree } else { value = NameUpdater.getCurrentName(value, name, testClass); } // Delete any properties whose name converts to the empty string if (oname.length() != 0 && name.length()==0) { return null; } // Create the property: ... } The above method was used for creating all properties. [1] https://svn.apache.org/repos/asf/jmeter/tags/v2_3_4/src/core/org/apache/jmeter/save/OldSaveService.java Fixed in SVN: URL: http://svn.apache.org/viewvc?rev=1232550&view=rev Log: Bug 52466 - Upgrade Test Plan feature : NameUpdater does not upgrade properties Modified: jmeter/trunk/bin/testfiles/GuiTest.jmx jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java jmeter/trunk/src/core/org/apache/jmeter/save/converters/BooleanPropertyConverter.java jmeter/trunk/src/core/org/apache/jmeter/save/converters/ConversionHelp.java jmeter/trunk/src/core/org/apache/jmeter/save/converters/IntegerPropertyConverter.java jmeter/trunk/src/core/org/apache/jmeter/save/converters/LongPropertyConverter.java jmeter/trunk/src/core/org/apache/jmeter/save/converters/StringPropertyConverter.java jmeter/trunk/src/core/org/apache/jmeter/save/converters/TestElementConverter.java jmeter/trunk/src/reports/org/apache/jmeter/report/gui/tree/ReportTreeModel.java jmeter/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewvc?rev=1232554&view=rev Log: Bug 52466 - Upgrade Test Plan feature : NameUpdater does not upgrade properties Allow for deleted properties Modified: jmeter/trunk/src/core/org/apache/jmeter/save/converters/MultiPropertyConverter.java jmeter/trunk/src/core/org/apache/jmeter/save/converters/TestElementConverter.java jmeter/trunk/src/core/org/apache/jmeter/save/converters/TestElementPropertyConverter.java Created attachment 28171 [details]
Test Plan to upgrade
Test Plan to use to see strange behaviour
I am not sure this issue is fixed. Working on Bug 52048, I updated upgrade.properties to ensure compatibility. I noticed upgrade is not working properly. I don't think issue is in patch (at least all except upgrade.properties) so I suspect an issue in upgrade. To reproduce issue, apply patch on Bug 52048 then try to upgrade attached Test Plan, you will see that the second BSH Sampler gets the same configuration as the first one. Oops! wrong variable was being returned. URL: http://svn.apache.org/viewvc?rev=1233146&view=rev Log: Bug 52466 - Upgrade Test Plan feature : NameUpdater does not upgrade properties (r1227589) Fix typo: was returning original name rather than the updated property name Modified: jmeter/trunk/src/core/org/apache/jmeter/save/converters/ConversionHelp.java Another fix needed to handle top level elements. URL: http://svn.apache.org/viewvc?rev=1235564&view=rev Log: Bug 52466 - Upgrade Test Plan feature : NameUpdater does not upgrade properties (r1227589) Also need to upgrade top-level element names This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2702 |