@@ -30,28 +30,29 @@ public void testBasicEscaping() throws Exception
3030 // for [core#194]
3131 public void testMediumStringsBytes () throws Exception
3232 {
33+ final JsonFactory jsonF = new JsonFactory ();
3334 for (int mode : ALL_BINARY_MODES ) {
34- for (int size : new int [] { 1100 , 2300 , 3800 , 7500 , 19000 }) {
35- _testMediumStrings (mode , size );
35+ for (int size : new int [] { 1100 , 2300 , 3800 , 7500 , 19000 , 33333 }) {
36+ _testMediumStrings (jsonF , mode , size );
3637 }
3738 }
3839 }
3940
4041 // for [core#194]
4142 public void testMediumStringsChars () throws Exception
4243 {
44+ final JsonFactory jsonF = new JsonFactory ();
4345 for (int mode : ALL_TEXT_MODES ) {
44- for (int size : new int [] { 1100 , 2300 , 3800 , 7500 , 19000 }) {
45- _testMediumStrings (mode , size );
46+ for (int size : new int [] { 1100 , 2300 , 3800 , 7500 , 19000 , 33333 }) {
47+ _testMediumStrings (jsonF , mode , size );
4648 }
4749 }
4850 }
4951
5052 public void testLongerRandomSingleChunk () throws Exception
5153 {
52- /* Let's first generate 100k of pseudo-random characters, favoring
53- * 7-bit ascii range
54- */
54+ // Let's first generate 100k of pseudo-random characters, favoring
55+ // 7-bit ascii range
5556 for (int mode : ALL_TEXT_MODES ) {
5657 for (int round = 0 ; round < 80 ; ++round ) {
5758 String content = generateRandom (75000 +round );
@@ -62,9 +63,8 @@ public void testLongerRandomSingleChunk() throws Exception
6263
6364 public void testLongerRandomMultiChunk () throws Exception
6465 {
65- /* Let's first generate 100k of pseudo-random characters, favoring
66- * 7-bit ascii range
67- */
66+ // Let's first generate 100k of pseudo-random characters, favoring
67+ // 7-bit ascii range
6868 for (int mode : ALL_TEXT_MODES ) {
6969 for (int round = 0 ; round < 70 ; ++round ) {
7070 String content = generateRandom (73000 +round );
@@ -126,14 +126,15 @@ private String generateRandom(int len)
126126 return sb .toString ();
127127 }
128128
129- private void _testMediumStrings (int readMode , int length ) throws Exception
129+ private void _testMediumStrings (JsonFactory jsonF ,
130+ int readMode , int length ) throws Exception
130131 {
131132 String text = _generareMediumText (length );
132133 StringWriter sw = new StringWriter ();
133134 ByteArrayOutputStream bytes = new ByteArrayOutputStream ();
134135
135- JsonGenerator gen = (readMode != MODE_READER ) ? FACTORY .createGenerator (bytes )
136- : FACTORY .createGenerator (sw );
136+ JsonGenerator gen = (readMode != MODE_READER ) ? jsonF .createGenerator (bytes )
137+ : jsonF .createGenerator (sw );
137138 gen .writeStartArray ();
138139
139140 StringReader reader = new StringReader (text );
@@ -143,17 +144,17 @@ private void _testMediumStrings(int readMode, int length) throws Exception
143144
144145 JsonParser p ;
145146 if (readMode == MODE_READER ) {
146- p = FACTORY .createParser (sw .toString ());
147+ p = jsonF .createParser (sw .toString ());
147148 } else {
148- p = createParser (FACTORY , readMode , bytes .toByteArray ());
149+ p = createParser (jsonF , readMode , bytes .toByteArray ());
149150 }
150151 assertToken (JsonToken .START_ARRAY , p .nextToken ());
151152 assertToken (JsonToken .VALUE_STRING , p .nextToken ());
152153 assertEquals (text , p .getText ());
153154 assertToken (JsonToken .END_ARRAY , p .nextToken ());
154155 p .close ();
155156 }
156-
157+
157158 private void doTestBasicEscaping () throws Exception
158159 {
159160 for (int i = 0 ; i < SAMPLES .length ; ++i ) {
0 commit comments