JimLin
12 years agoOccasional Contributor
RandomStringUtils.random variation locks up soapui
Hi,
I have a small script for generating a random 3 digit numeric/alphanumeric string which works without issue:
The 'false/true' above sets numbers and/or letters.
I now need one that generate a random 3 digit string, but between specific limits, i.e. starting at 1 and finishing at 193. Looking at this page http://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/RandomStringUtils.html, this variation seems to fit the bill 'RandomStringUtils.random(int, int, int, boolean, boolean)' - which represents ' - 'int count, int start, int end, boolean letters, boolean numbers', however, when I add in the start and end integers, soapui locks up and the only thing to do is kill it in task manager. This happens when used in a Groovy step in a test or via the Groovy console.
Does anyone have any suggestion as to what it causing the issue. It's a tiny script, so I'm surprised it causes me such issues.
I have a small script for generating a random 3 digit numeric/alphanumeric string which works without issue:
import org.apache.commons.lang.RandomStringUtils
//Random 3 digit string
String randomString = (RandomStringUtils.random(3, false, true))
The 'false/true' above sets numbers and/or letters.
I now need one that generate a random 3 digit string, but between specific limits, i.e. starting at 1 and finishing at 193. Looking at this page http://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/RandomStringUtils.html, this variation seems to fit the bill 'RandomStringUtils.random(int, int, int, boolean, boolean)' - which represents ' - 'int count, int start, int end, boolean letters, boolean numbers', however, when I add in the start and end integers, soapui locks up and the only thing to do is kill it in task manager. This happens when used in a Groovy step in a test or via the Groovy console.
Does anyone have any suggestion as to what it causing the issue. It's a tiny script, so I'm surprised it causes me such issues.