You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2017/11/14 18:28:41 UTC

[Bug 61759] New: New __changeCase function

https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

            Bug ID: 61759
           Summary: New __changeCase function
           Product: JMeter
           Version: 3.3
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
          Assignee: issues@jmeter.apache.org
          Reporter: p.mouawad@ubik-ingenierie.com
  Target Milestone: ---

We frequently need to do such things:

- Upper case
- Lower case


So signature would be:

- __changeCase(MODE, string, exported_var)

Where modes would be:
- UPPER
- LOWER
- CAPITALIZE

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #15 from orimarko <or...@gmail.com> ---
About regex support of non English letter as umlauts, 

I suggest to use include expression [\s\-_]+ 

Which split words by any group of Whitespace character (\s) hyphen (-) and
Undercore (_)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

orimarko <or...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |orimarko@gmail.com

--- Comment #1 from orimarko <or...@gmail.com> ---
 I suggest adding camel case support (as myVarName), new mode: CAMEL_CASE

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #12 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Author: pmouawad
Date: Mon Nov 20 20:34:10 2017
New Revision: 1815851

URL: http://svn.apache.org/viewvc?rev=1815851&view=rev
Log:
Bug 61759 - New __changeCase function
Handle first char Uppercase error
Bugzilla Id: 61759

Modified:
    jmeter/trunk/src/functions/org/apache/jmeter/functions/ChangeCase.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestChangeCase.java

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #6 from orimarko <or...@gmail.com> ---
About camel case, we should distinguish between upper and lower camel case,

Someone can expect camelCaseMode or CamelCaseMode

I suggest 2 modes: CAMEL_CASE and CAMEL_CASE_FIRST_LOWER

I suggest it will get a string as "abc_def-Ghi jkl" and return AbcDefGhiJkl or
abcDefGhiJkl

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #10 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
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

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #14 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Author: pmouawad
Date: Wed Nov 22 07:27:11 2017
New Revision: 1816006

URL: http://svn.apache.org/viewvc?rev=1816006&view=rev
Log:
Bug 61759 __changeCase</code> function to change different cases of a string
Take into account some remarks from Felix:
- Change enum names
- Make  CamelCase  work as described in wikipedia
- rename cz
Bugzilla Id: 61759

Modified:
    jmeter/trunk/src/functions/org/apache/jmeter/functions/ChangeCase.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestChangeCase.java
    jmeter/trunk/xdocs/usermanual/functions.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om

--- Comment #4 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
(In reply to Graham Russell from comment #3)
> Actually, I prefer:
> 
> __toUpper(string)
> __toLower(string)
> 
> which just return the result, rather than having another variable. Similar
> to __urlencode.

The aim was to avoid having too many functions.

I feel having a MODE (enum in Java) would be interesting as it would allow
adding modes without having to introduce new functions.

It is true that CAPITALIZE might be luxurious, but as it's available with
StringUtils and I had the need 2 or 3 times in my work I thought it might be
interesting.
We can also add CamelCase

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #23 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Author: pmouawad
Date: Sat Dec 23 14:31:52 2017
New Revision: 1819152

URL: http://svn.apache.org/viewvc?rev=1819152&view=rev
Log:
Bug 61759 - New __changeCase function
Remove useless message labels as per orimarko patch
Bugzilla Id: 61759

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #9 from orimarko <or...@gmail.com> ---
Created attachment 35538
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35538&action=edit
Patch with new change case function

Patch with new change case function and tests and documentation
Fixed also duplicate sect-num in functions

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

orimarko <or...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #11 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Author: pmouawad
Date: Mon Nov 20 19:59:48 2017
New Revision: 1815839

URL: http://svn.apache.org/viewvc?rev=1815839&view=rev
Log:
Bug 61759 - New __changeCase function
Add i18n
Bugzilla Id: 61759

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #7 from orimarko <or...@gmail.com> ---
My suggestion:

- __changeCase(string, MODE, exported_var)

Where modes would be:
- UPPER     (default value)
- LOWER
- CAPITALIZE
- CAMEL_CASE 
- CAMEL_CASE_FIRST_LOWER

Only first variable is mandatory

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

orimarko <or...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35545|0                           |1
        is obsolete|                            |

--- Comment #19 from orimarko <or...@gmail.com> ---
Created attachment 35567
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35567&action=edit
Update patch remove camel case

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #8 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
ok for me

(In reply to orimarko from comment #7)
> My suggestion:
> 
> - __changeCase(string, MODE, exported_var)
> 
> Where modes would be:
> - UPPER     (default value)
> - LOWER
> - CAPITALIZE
> - CAMEL_CASE 
> - CAMEL_CASE_FIRST_LOWER
> 
> Only first variable is mandatory

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

orimarko <or...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35538|0                           |1
        is obsolete|                            |

--- Comment #16 from orimarko <or...@gmail.com> ---
Created attachment 35545
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35545&action=edit
Patch with update changeCase add support of non English letters

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #2 from Graham Russell <gr...@ham1.co.uk> ---
What is the use case for these? I'd prefer separate functions i.e.:

__toUpper(string, outputVarName)
__toLower(string, outputVarName)

I think we could have
__capitalise(string, outputVarName)

but it is a bit ambiguous, does it mean just the first letter, or for each
sentence or "fully" i.e. each letter after whitespace?

Camel case doesn't seem a common use case to warrant adding, I could be wrong,
what did you have in mind? It seems to me ambiguous and hard to implement, what
sort of camel case would it apply to "thiscouldbecamelcased" as I'd expect
"thisCouldBeCamelCased", but this woudn't be possible to implement well,
especially across languages.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #13 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Author: pmouawad
Date: Mon Nov 20 20:55:50 2017
New Revision: 1815855

URL: http://svn.apache.org/viewvc?rev=1815855&view=rev
Log:
Bug 61759 - New __changeCase function
Fix checkstyle error
Bugzilla Id: 61759

Modified:
    jmeter/trunk/src/functions/org/apache/jmeter/functions/ChangeCase.java

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #3 from Graham Russell <gr...@ham1.co.uk> ---
Actually, I prefer:

__toUpper(string)
__toLower(string)

which just return the result, rather than having another variable. Similar to
__urlencode.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #20 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Author: pmouawad
Date: Sat Dec  9 14:31:49 2017
New Revision: 1817615

URL: http://svn.apache.org/viewvc?rev=1817615&view=rev
Log:
Bug 61759 - New __changeCase function
Remove camel case as per Ori Marko contribution
More edge cases for changeCase function and slight behaviour changes
contributed by Felix Schumacher
This closes #342
Bugzilla Id: 61759

Added:
    jmeter/trunk/test/src/org/apache/jmeter/functions/ChangeCaseSpec.groovy
Modified:
    jmeter/trunk/src/functions/org/apache/jmeter/functions/ChangeCase.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestChangeCase.java
    jmeter/trunk/xdocs/usermanual/functions.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #18 from Graham Russell <gr...@ham1.co.uk> ---
I agree with removal.
I can't see a use case for it, at least not one worth keeping the code in core.
If someone really needs it they can write their own with the particular
requirements they have.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #5 from Graham Russell <gr...@ham1.co.uk> ---
This is slightly off topic (or rather overarching), but to prevent the aversion
to introducing more but well named functions we should better design the
function names and the function helper. Perhaps something like
__StringUtils.toUpper() and the function helper GUI can be organised to group
based on the grouping? I will start an email discussion if this seems useful?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

orimarko <or...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEEDINFO

--- Comment #17 from orimarko <or...@gmail.com> ---
I thought camel case would be a nice to have feature, 
But it's not using Apache code as the other cases and I'm not sure it's needed
and it raises questions/issues, I'm voting to currently remove camel case
option from changeCase function

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

orimarko <or...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #22 from orimarko <or...@gmail.com> ---
Add patch to remove camel case from messages

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61759] New __changeCase function

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61759

--- Comment #21 from orimarko <or...@gmail.com> ---
Created attachment 35599
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35599&action=edit
Remove camel case from messages

Remove camel case from messages

-- 
You are receiving this mail because:
You are the assignee for the bug.