Am 20.11.2017 um 20:50 schrieb pmouawad@apache.org: > Author: pmouawad > Date: Mon Nov 20 19:50:51 2017 > New Revision: 1815838 > > URL: http://svn.apache.org/viewvc?rev=1815838&view=rev > Log: > Bug 61759 - New __changeCase function > Contributed by Orimarko > Bugzilla Id: 61759 > > Added: > jmeter/trunk/src/functions/org/apache/jmeter/functions/ChangeCase.java (with props) > jmeter/trunk/test/src/org/apache/jmeter/functions/TestChangeCase.java (with props) > Modified: > jmeter/trunk/xdocs/changes.xml > jmeter/trunk/xdocs/usermanual/functions.xml > > Added: jmeter/trunk/src/functions/org/apache/jmeter/functions/ChangeCase.java > URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/ChangeCase.java?rev=1815838&view=auto > ============================================================================== > --- jmeter/trunk/src/functions/org/apache/jmeter/functions/ChangeCase.java (added) > +++ jmeter/trunk/src/functions/org/apache/jmeter/functions/ChangeCase.java Mon Nov 20 19:50:51 2017 > @@ -0,0 +1,175 @@ > +/* > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed with > + * this work for additional information regarding copyright ownership. > + * The ASF licenses this file to You under the Apache License, Version 2.0 > + * (the "License"); you may not use this file except in compliance with > + * the License. You may obtain a copy of the License at > + * > + * http://www.apache.org/licenses/LICENSE-2.0 > + * > + * Unless required by applicable law or agreed to in writing, software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > + * See the License for the specific language governing permissions and > + * limitations under the License. > + * > + */ > + > +package org.apache.jmeter.functions; > + > +import java.util.Collection; > +import java.util.EnumSet; > +import java.util.LinkedList; > +import java.util.List; > +import java.util.regex.Pattern; > + > +import org.apache.commons.lang3.StringUtils; > +import org.apache.jmeter.engine.util.CompoundVariable; > +import org.apache.jmeter.samplers.SampleResult; > +import org.apache.jmeter.samplers.Sampler; > +import org.apache.jmeter.util.JMeterUtils; > +import org.slf4j.Logger; > +import org.slf4j.LoggerFactory; > + > +/** > + * Change Case Function > + * > + * Support String manipulations of: > + * > >

I18N

> > Modified: jmeter/trunk/xdocs/usermanual/functions.xml > URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/functions.xml?rev=1815838&r1=1815837&r2=1815838&view=diff > ============================================================================== > --- jmeter/trunk/xdocs/usermanual/functions.xml (original) > +++ jmeter/trunk/xdocs/usermanual/functions.xml Mon Nov 20 19:50:51 2017 > @@ -143,13 +143,14 @@ Alternatively, just use / i > Variables evalVarevaluate an expression stored in a variable2.3.1 > Properties isVarDefined Test if a variable exists4.0 > Variables Vevaluate a variable name2.3RC3 > - String regexFunctionparse previous response using a regular expression1.X > - String escapeOroRegexpCharsquote meta chars used by ORO regular expression2.9 > String chargenerate Unicode char values from a list of numbers2.3.3 > - String unescapeProcess strings containing Java escapes (e.g. \n & \t)2.3.3 > - String unescapeHtmlDecode HTML-encoded strings2.3.3 > + String changeCaseChange case following different modes4.0 > String escapeHtmlEncode strings using HTML encoding2.3.3 > + String escapeOroRegexpCharsquote meta chars used by ORO regular expression2.9 > String escapeXmlEncode strings using XMl encoding3.2 > + String regexFunctionparse previous response using a regular expression1.X > + String unescapeProcess strings containing Java escapes (e.g. \n & \t)2.3.3 > + String unescapeHtmlDecode HTML-encoded strings2.3.3 > String urldecodeDecode a application/x-www-form-urlencoded string2.10 > String urlencodeEncode a string to a application/x-www-form-urlencoded string2.10 > String TestPlanNameReturn name of current test plan2.6 > @@ -1616,7 +1617,7 @@ becomes: > The name of the variable to set. > > > - > + > >

The __isPropDefined function returns true if property exists or false if not.

>
> @@ -1626,7 +1627,7 @@ becomes: > > >
> - > + > >

The __isVarDefined function returns true if variable exists or false if not.

>
> @@ -1636,6 +1637,30 @@ becomes: > > >
> + > + > +

The change case function returns a string value which > + case has been changed following a specific mode. > + Result can optionally be saved in a JMeter variable.

> +
> + > + The String > + which case will be changed > + > + The mode to be used to change case, for example for ab-CD eF: > +
    > +
  • UPPER result as AB-CD EF
  • > +
  • LOWER result as ab-cd ed
  • > +
  • CAPITALIZE result as Ab-CD eF
  • > +
  • CAMEL_CASEresult as AbCDEF
  • Shouldn't this be AbCdEf? > +
  • CAMEL_CASE_FIRST_LOWERresult as abCDEF
  • and this abCdEf? Regards,  Felix > +
> + mode is case insensitive > +
> + The name of the variable to set. > +
> +
> + > > > > >