You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by hi...@apache.org on 2017/02/14 19:31:51 UTC
[18/50] [abbrv] geode git commit: [GEODE-2191] Fix long string
serialization test. This closes #306
[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/master
Commit: b31c68410336b4844e414c820de4572286f58675
Parents: c0505b9
Author: Galen O'Sullivan <go...@pivotal.io>
Authored: Fri Dec 9 12:38:01 2016 -0800
Committer: Udo Kohlmeyer <uk...@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 {