Summary: | Enable plugins to add own translation rules in addition to upgrade.properties | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | stef <stephane.hoblingre> |
Component: | Main | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | mstover1, p.mouawad |
Priority: | P2 | ||
Version: | 2.5.1 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
NameUpdater update
New Interface to add to src/core/org/apache/jmeter/util NameUpdater update |
Description
stef
2011-11-09 13:50:47 UTC
I don't think that is a good idea; the intention is for the namemap to be immutable once created. (In reply to comment #1) > I don't think that is a good idea; the intention is for the namemap to be > immutable once created. Yes I agree the existing implementation ensured that. Could it be possible to add an additional map and to fetch data first look in namemap and if (and only if) not found look in the second one? Stef It would be better if the additional entries could be provided at class load time. (In reply to comment #3) > It would be better if the additional entries could be provided at class load > time. Yes that would be the ideal solution. Is it feasible? Stef Created attachment 27926 [details]
NameUpdater update
Load additional items to nameMap
Created attachment 27927 [details]
New Interface to add to src/core/org/apache/jmeter/util
Plugins need to implement this interface to add additional entries in nameMap
Hi Sebb, Do you think this implementation could be he right approach? Stef (In reply to comment #7) > Hi Sebb, > > Do you think this implementation could be he right approach? > > Stef That would work, but it is quite involved. I was thinking more on the lines of reading an additional properties file, e.g. use ClassLoader#getResources(String name) to find all resources with a particular name, where the name is something like META-INF/resources/org.apache.jmeter.nameupdater.properties This would also be easier for the plugins to provide. Yes that will be much simpler, I will look at this. Stef *** Bug 29603 has been marked as a duplicate of this bug. *** (In reply to comment #10) > *** Bug 29603 has been marked as a duplicate of this bug. *** Np longer marked as such. That is about messages.properties; this is about upgrade.properties. (In reply to comment #8) Hi Sebb, Please find attached the patch following your recommendations. Stef Created attachment 27946 [details]
NameUpdater update
The new proposal using ClassLoader#getResources
Thanks! Had to replace the stringPropertyNames() method call as that requires Java 1.6; JMeter still targets 1.5+. Also added a log message for each properties file found. URL: http://svn.apache.org/viewvc?rev=1202658&view=rev Log: Bug 52161 - Enable plugins to add own translation rules in addition to upgrade.properties. Modified: jmeter/trunk/src/core/org/apache/jmeter/util/NameUpdater.java jmeter/trunk/xdocs/changes.xml This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2642 |