commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xenoterracide <>
Subject [GitHub] commons-lang pull request: RFC: provide support for generating ran...
Date Tue, 16 Jun 2015 13:41:02 GMT
Github user xenoterracide commented on the pull request:
    I use methods like this (I've written for Numeric and AlphaNumeric as well) for generating
test data. At work it's being used in our selenium tests, at home I use it for any tests.
It's not meant to be used to tests the bounds, rather that any behavior in the bounds that
is expected works. Also that there aren't hidden gotchas, like something fails because a string
has a `.` or a `-` because someone decided to parse user input.
    Managers actually watch our selenium tests replay, and they discovered that our Zip Code
fields, perhaps improperly, take any alphanumeric string.
    I think my first use case was testing that passwords worked between 8-20 characters.
    Obviously much of that can be accomplished by using a static length random string, but
there are a few things you can catch by using a random length, like improper or forgotten
bounds, display length issues, weird sort issues, and of course it makes for just a little
more random distribution of the data.
        protected void wireEntity( final JpaUser entity ) {
            entity.setName( RandomUtil.randomAlphanumeric( 5, 15 ) );
            entity.setEnabled( true );

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 or file a JIRA ticket
with INFRA.

View raw message