Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 054A2200BAA for ; Wed, 12 Oct 2016 11:23:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 044B1160AD4; Wed, 12 Oct 2016 09:23:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4C73D160AEE for ; Wed, 12 Oct 2016 11:23:22 +0200 (CEST) Received: (qmail 55293 invoked by uid 500); 12 Oct 2016 09:23:21 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 55012 invoked by uid 99); 12 Oct 2016 09:23:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2016 09:23:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C273F2C4C70 for ; Wed, 12 Oct 2016 09:23:20 +0000 (UTC) Date: Wed, 12 Oct 2016 09:23:20 +0000 (UTC) From: "Bruno P. Kinoshita (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LANG-1196) Provide way to set random number generator on RandomStringUtils to enable repeatable test execution MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 12 Oct 2016 09:23:23 -0000 [ https://issues.apache.org/jira/browse/LANG-1196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15568166#comment-15568166 ] Bruno P. Kinoshita commented on LANG-1196: ------------------------------------------ Hi Gus, Having a patch or pull request would definitely help reviewing your use case. I had a quick look at RandomStringUtils, and one easy fix would be to pass the Random implementation in the constructor. But java.util.Random inherits only form Object. Perhaps another object that wraps different random number generators? Feel free to update the ticket with comments or a patch or link to a pull request or repository. Cheers Bruno > Provide way to set random number generator on RandomStringUtils to enable repeatable test execution > --------------------------------------------------------------------------------------------------- > > Key: LANG-1196 > URL: https://issues.apache.org/jira/browse/LANG-1196 > Project: Commons Lang > Issue Type: Improvement > Components: lang.* > Affects Versions: 3.4 > Environment: java version "1.8.0_66" > Java(TM) SE Runtime Environment (build 1.8.0_66-b17) > Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) > Linux 4.0.5 #3 SMP Mon Sep 14 12:41:09 BST 2015 x86_64 Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz GenuineIntel GNU/Linux > Reporter: Gus Power > Priority: Minor > > Hi, > I'm using [Sham |http://search.maven.org/#artifactdetails%7Corg.shamdata%7Csham%7C0.3%7Cjar] 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. > {code}private static final Random RANDOM = new Random();{code} > 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. > -- This message was sent by Atlassian JIRA (v6.3.4#6332)