20
20
import java .io .OutputStream ;
21
21
import java .io .Writer ;
22
22
23
- import org .codehaus .plexus .util .StringUtils ;
24
23
import org .junit .jupiter .api .AfterEach ;
25
24
import org .junit .jupiter .api .BeforeEach ;
26
25
import org .junit .jupiter .api .Test ;
@@ -76,7 +75,7 @@ void tearDown() throws Exception {
76
75
void writeLineBreakXMLWriter () throws Exception {
77
76
XmlWriterUtil .writeLineBreak (xmlWriter );
78
77
writer .close ();
79
- assertEquals (1 , StringUtils .countMatches (output .toString (), XmlWriterUtil .LS ));
78
+ assertEquals (1 , TestUtils .countMatches (output .toString (), XmlWriterUtil .LS ));
80
79
}
81
80
82
81
/**
@@ -89,7 +88,7 @@ void writeLineBreakXMLWriter() throws Exception {
89
88
void writeLineBreakXMLWriterInt () throws Exception {
90
89
XmlWriterUtil .writeLineBreak (xmlWriter , 10 );
91
90
writer .close ();
92
- assertEquals (10 , StringUtils .countMatches (output .toString (), XmlWriterUtil .LS ));
91
+ assertEquals (10 , TestUtils .countMatches (output .toString (), XmlWriterUtil .LS ));
93
92
}
94
93
95
94
/**
@@ -102,11 +101,8 @@ void writeLineBreakXMLWriterInt() throws Exception {
102
101
void writeLineBreakXMLWriterIntInt () throws Exception {
103
102
XmlWriterUtil .writeLineBreak (xmlWriter , 10 , 2 );
104
103
writer .close ();
105
- assertEquals (10 , StringUtils .countMatches (output .toString (), XmlWriterUtil .LS ));
106
- assertEquals (
107
- 1 ,
108
- StringUtils .countMatches (
109
- output .toString (), StringUtils .repeat (" " , 2 * XmlWriterUtil .DEFAULT_INDENTATION_SIZE )));
104
+ assertEquals (10 , TestUtils .countMatches (output .toString (), XmlWriterUtil .LS ));
105
+ assertEquals (1 , TestUtils .countMatches (output .toString (), " " )); //
110
106
}
111
107
112
108
/**
@@ -119,8 +115,8 @@ void writeLineBreakXMLWriterIntInt() throws Exception {
119
115
void writeLineBreakXMLWriterIntIntInt () throws Exception {
120
116
XmlWriterUtil .writeLineBreak (xmlWriter , 10 , 2 , 4 );
121
117
writer .close ();
122
- assertEquals (10 , StringUtils .countMatches (output .toString (), XmlWriterUtil .LS ));
123
- assertEquals (1 , StringUtils .countMatches (output .toString (), StringUtils . repeat ( " " , 2 * 4 ) ));
118
+ assertEquals (10 , TestUtils .countMatches (output .toString (), XmlWriterUtil .LS ));
119
+ assertEquals (1 , TestUtils .countMatches (output .toString (), " " ));
124
120
}
125
121
126
122
/**
@@ -211,7 +207,7 @@ void writeCommentXMLWriterString() throws Exception {
211
207
*/
212
208
@ Test
213
209
void writeCommentXMLWriterStringInt () throws Exception {
214
- String indent = StringUtils . repeat ( " " , 2 * XmlWriterUtil . DEFAULT_INDENTATION_SIZE ) ;
210
+ String indent = " " ;
215
211
216
212
XmlWriterUtil .writeComment (xmlWriter , "hello" , 2 );
217
213
writer .close ();
@@ -253,7 +249,7 @@ void writeCommentXMLWriterStringInt() throws Exception {
253
249
*/
254
250
@ Test
255
251
void writeCommentXMLWriterStringIntInt () throws Exception {
256
- String repeat = StringUtils . repeat ( " " , 2 * 4 ) ;
252
+ String repeat = " " ;
257
253
258
254
XmlWriterUtil .writeComment (xmlWriter , "hello" , 2 , 4 );
259
255
writer .close ();
@@ -291,7 +287,7 @@ void writeCommentXMLWriterStringIntInt() throws Exception {
291
287
*/
292
288
@ Test
293
289
void writeCommentXMLWriterStringIntIntInt () throws Exception {
294
- String indent = StringUtils . repeat ( " " , 2 * 4 ) ;
290
+ String indent = " " ;
295
291
296
292
XmlWriterUtil .writeComment (xmlWriter , "hello" , 2 , 4 , 50 );
297
293
writer .close ();
@@ -339,7 +335,7 @@ void writeCommentTextXMLWriterStringInt() throws Exception {
339
335
tearDown ();
340
336
setUp ();
341
337
342
- String indent = StringUtils . repeat ( " " , 2 * 2 ) ;
338
+ String indent = " " ;
343
339
344
340
XmlWriterUtil .writeCommentText (
345
341
xmlWriter ,
@@ -380,7 +376,7 @@ void writeCommentTextXMLWriterStringInt() throws Exception {
380
376
*/
381
377
@ Test
382
378
void writeCommentTextXMLWriterStringIntInt () throws Exception {
383
- String indent = StringUtils . repeat ( " " , 2 * 4 ) ;
379
+ String indent = " " ;
384
380
385
381
XmlWriterUtil .writeCommentText (xmlWriter , "hello" , 2 , 4 );
386
382
writer .close ();
@@ -411,7 +407,7 @@ void writeCommentTextXMLWriterStringIntInt() throws Exception {
411
407
*/
412
408
@ Test
413
409
void writeCommentTextXMLWriterStringIntIntInt () throws Exception {
414
- String indent = StringUtils . repeat ( " " , 2 * 4 ) ;
410
+ String indent = " " ;
415
411
416
412
XmlWriterUtil .writeCommentText (xmlWriter , "hello" , 2 , 4 , 50 );
417
413
writer .close ();
0 commit comments