Thanks will do. I'd be more than happy if you could also answer other mails I sent related to features, future of JMeter, percentiles/median ...
Regards On Sun, May 28, 2017 at 4:02 PM, sebb <seb...@gmail.com> wrote: > On 23 May 2017 at 11:03, Philippe Mouawad <philippe.moua...@gmail.com> > wrote: > > Hi Felix, > > Sorry for no reply , it was out of my radar. > > > > Regards > > > > On Wed, May 3, 2017 at 3:03 PM, Felix Schumacher < > > felix.schumac...@internetallee.de> wrote: > > > >> Am 30.04.2017 22:34, schrieb pmoua...@apache.org: > >> > >>> Author: pmouawad > >>> Date: Sun Apr 30 20:34:17 2017 > >>> New Revision: 1793271 > >>> > >>> URL: http://svn.apache.org/viewvc?rev=1793271&view=rev > >>> Log: > >>> Add test case to show partial replacement does not work > >>> > >>> Modified: > >>> jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValu > >>> eReplacer.java > >>> > >>> Modified: > >>> jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValu > >>> eReplacer.java > >>> URL: > >>> http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apach > >>> e/jmeter/engine/util/TestValueReplacer.java?rev=1793271&r1= > >>> 1793270&r2=1793271&view=diff > >>> ============================================================ > >>> ================== > >>> --- > >>> jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValu > >>> eReplacer.java > >>> (original) > >>> +++ > >>> jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValu > >>> eReplacer.java > >>> Sun Apr 30 20:34:17 2017 > >>> @@ -107,6 +107,24 @@ public class TestValueReplacer extends J > >>> String replacedDomain = element.getPropertyAsString("d > >>> omain"); > >>> assertEquals("${${shortMatch}", replacedDomain); > >>> } > >>> + > >>> + @Test > >>> + public void test2Matches() throws Exception { > >>> + TestPlan plan = new TestPlan(); > >>> + plan.addParameter("firstMatch", "toto"); > >>> + plan.addParameter("secondMatch", "005"); > >>> + ValueReplacer replacer = new ValueReplacer(plan); > >>> + TestElement element = new TestPlan(); > >>> + element.setProperty(new StringProperty("mail", > >>> "toto%40005")); > >>> > >> > >> If you want to replace 005 "in" a word (40005), then you have to > surround > >> the regex with parentheses. The '%' is a word boundary, '0' is not. > >> > >> So instead of "005" you have to write "(005)". The behaviour is > described > >> in http://jmeter.apache.org/usermanual/component_reference. > >> html#HTTP(S)_Test_Script_Recorder > >> and further down on that page under "User Defined Variable replacement". > >> > >> But maybe you wanted to document that behaviour here? > >> > > Yes. I wanted to document that due to encoding, replacement of 005 would > > not work. > > > >> > >> A few notes on the test itself. I like tests, that test one thing in one > >> method - this tests two things. > >> It might help, if the test name hints at the problem by using a name, > that > >> is a bit more descriptive. > >> > > > > I agree, but I don't know how to name it. > > In which case, please add some comments as to what the code is trying to > test. > Someone else can then give it a new name if they wish. > > Without either a hint from the name or some comments it's going to be > very difficult for future maintainers to debug if the test ever fails. > > >> > >> Regards, > >> Felix > >> > >> > >> + replacer.reverseReplace(element, true); > >>> + String replacedDomain = element.getPropertyAsString(" > mail"); > >>> + assertEquals("${firstMatch}%40005", replacedDomain); > >>> + > >>> + element.setProperty(new StringProperty("mail", "toto@005 > ")); > >>> + replacer.reverseReplace(element, true); > >>> + replacedDomain = element.getPropertyAsString("mail"); > >>> + assertEquals("${firstMatch}@${secondMatch}", > >>> replacedDomain); > >>> + } > >>> > >>> @Test > >>> public void testReplace() throws Exception { > >>> > >> > > > > > > -- > > Cordialement. > > Philippe Mouawad. > -- Cordialement. Philippe Mouawad.