geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [3/3] geode git commit: [GEODE-2191] Fix long string serialization test. This closes #306
Date Tue, 24 Jan 2017 18:18:26 GMT
[GEODE-2191] Fix long string serialization test. This closes #306


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/b31c6841
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/b31c6841
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/b31c6841

Branch: refs/heads/develop
Commit: b31c68410336b4844e414c820de4572286f58675
Parents: c0505b9
Author: Galen O'Sullivan <gosullivan@pivotal.io>
Authored: Fri Dec 9 12:38:01 2016 -0800
Committer: Udo Kohlmeyer <ukohlmeyer@pivotal.io>
Committed: Tue Jan 24 10:17:12 2017 -0800

----------------------------------------------------------------------
 .../InternalDataSerializerRandomizedJUnitTest.java   | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/b31c6841/geode-core/src/test/java/org/apache/geode/internal/InternalDataSerializerRandomizedJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/InternalDataSerializerRandomizedJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/InternalDataSerializerRandomizedJUnitTest.java
index cf3dc1b..f361de4 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/InternalDataSerializerRandomizedJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/InternalDataSerializerRandomizedJUnitTest.java
@@ -90,20 +90,9 @@ public class InternalDataSerializerRandomizedJUnitTest {
   @Test
   public void testABigString() throws IOException {
     RandomStringGenerator stringGenerator = new RandomStringGenerator();
-    final int strlen = 128001;
+    final int strlen = 1024 * 1024 * 5;
 
-    StringBuilder stringBuilder = new StringBuilder(strlen);
-    while (stringBuilder.length() < strlen) {
-      stringBuilder.append(stringGenerator.randomCodepoint());
-    }
-    // the last few we have to worry about codepoinuts being too big.
-    while (stringBuilder.length() < strlen) {
-      int codepoint = stringGenerator.randomCodepoint();
-      if (codepoint <= strlen) {
-        stringBuilder.append(codepoint);
-      }
-    }
-    testStringSerializedDeserializesToSameValue(stringBuilder.toString());
+    testStringSerializedDeserializesToSameValue(stringGenerator.randomString(strlen));
   }
 
   private static class RandomStringGenerator {


Mime
View raw message