Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1196

Provide way to set random number generator on RandomStringUtils to enable repeatable test execution

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.4
    • None
    • lang.*
    • None

    Description

      Hi,

      I'm using Sham to generate realistic looking test data for both parameterized tests and user acceptance testing. We log the seed that is used for each run so that if there is an issue we can recreate exactly the same test data. I would also like to use some of the commons-lang RandomStringUtils functionality but notice that the implementation provides no way of setting the random number generator to be used.

      private static final Random RANDOM = new Random();

      A way to configure this would be really useful. If there is an alternative way to do this then that would be great. If you think it's a good idea and it requires a patch I'm happy to supply one.

      Cheers,

      Gus.

      Attachments

        1. LANG-1196.patch
          10 kB
          Gus Power

        Issue Links

          Activity

            People

              Unassigned Unassigned
              guspower Gus Power
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: