GitHub user xenoterracide opened a pull request:
https://github.com/apache/commons-lang/pull/101
random length strings within range
at a high level, I have added `randomGraph( int count )` and `randomPrint(
int count )` which map to their corresponding regular expression classes. These
are useful if you're needing to test arbitrary user input in various kinds of
text fields. `randomAscii` was not sufficient due to it's inclusion of the DEL
character.
I have also added variants of random Ascii, graph, print, alphabetic,
alphanumeric, and numeric that have `minimumInclusive` and `maximumInclusive`
parameters. These can be used to create string of random length to ensure more
random distribution of data when testing. The will also ensure that developers
who use them are less likely to forget testing variable lengths within the
bounds.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/xenoterracide/commons-lang
topic/random-lenth-strings-within-range
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-lang/pull/101.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #101
----
commit 53ead9cd983a85c28f63b23fd8ca8c056621dfec
Author: Caleb Cushing <[email protected]>
Date: 2015-06-27T18:52:41Z
add randomGraph and randomPrint which match corresponding Posix Regular
expression
These are useful over randomAscii because they do not contain the DEL
character but otherwise contrain the full range of ASCII printing characters,
and optionally include whitespace. This is useful for testing user defined
inputs where characters like spaces, angle brakets, semicolons, dashes, etc,
can cause issues.
commit 22bef8fe74760649805a921a0f8d3d536683abdb
Author: Caleb Cushing <[email protected]>
Date: 2015-06-28T07:06:27Z
add a series of random statics that take an inclusive min and max range
these methods are useful for testing bound assumption issues
commit eb41814c12711a5d73c54702ba4b94a2b9213790
Author: Caleb Cushing <[email protected]>
Date: 2015-06-28T07:08:57Z
add self to the contributor list
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---