geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [geode] branch develop updated: GEODE-1942: Limiting random strings to alphanumeric
Date Thu, 26 Jul 2018 20:49:07 GMT
This is an automated email from the ASF dual-hosted git repository.

upthewaterspout pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new ca8a240  GEODE-1942: Limiting random strings to alphanumeric
ca8a240 is described below

commit ca8a24000a2f5c9e58f7bed7997abb0c46d43159
Author: Dan Smith <dsmith@pivotal.io>
AuthorDate: Thu Jul 26 13:49:03 2018 -0700

    GEODE-1942: Limiting random strings to alphanumeric
    
    This test was generating random strings, but some strings were invalid
    regions names, for example strings starting with __. Limiting the
    strings the alphabet.
---
 .../java/org/apache/geode/redis/HashesJUnitTest.java                | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/geode-core/src/integrationTest/java/org/apache/geode/redis/HashesJUnitTest.java
b/geode-core/src/integrationTest/java/org/apache/geode/redis/HashesJUnitTest.java
index cb73026..151af35 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/redis/HashesJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/redis/HashesJUnitTest.java
@@ -29,6 +29,7 @@ import java.util.Map;
 import java.util.Random;
 import java.util.Set;
 
+import org.apache.commons.lang.RandomStringUtils;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -170,10 +171,7 @@ public class HashesJUnitTest {
 
   private String randString() {
     int length = rand.nextInt(8) + 5;
-    StringBuilder rString = new StringBuilder();
-    for (int i = 0; i < length; i++)
-      rString.append((char) (rand.nextInt(57) + 65));
-    return rString.toString();
+    return RandomStringUtils.randomAlphanumeric(length);
   }
 
   @After


Mime
View raw message