@@ -253,9 +253,9 @@ private void generateTextReport(Map<ExecutedTest, Set<String>> testTagMap)
253253 String line = repeatString ("-" , 80 );
254254
255255 try (FileWriter writer = new FileWriter (outputFile )) {
256- writer .write (separator + "% n" );
257- writer .write ("EXECUTED TEST TAG REPORT% n" );
258- writer .write (separator + "%n% n" );
256+ writer .write (separator + "\ n " );
257+ writer .write ("EXECUTED TEST TAG REPORT\ n " );
258+ writer .write (separator + "\n \ n " );
259259
260260 int totalTests = testTagMap .size ();
261261
@@ -269,16 +269,16 @@ private void generateTextReport(Map<ExecutedTest, Set<String>> testTagMap)
269269 int skippedTests = (int ) testTagMap .keySet ().stream ()
270270 .filter (ExecutedTest ::isSkipped ).count ();
271271
272- writer .write ("EXECUTION SUMMARY:% n" );
273- writer .write (line + "% n" );
272+ writer .write ("EXECUTION SUMMARY:\ n " );
273+ writer .write (line + "\ n " );
274274 writer .write (String .format (" Total Tests: %d%n" , totalTests ));
275275 writer .write (String .format (" Passed: %d%n" , passedTests ));
276276 writer .write (String .format (" Failed: %d%n" , failedTests ));
277277 writer .write (String .format (" Errors: %d%n" , errorTests ));
278278 if (includeSkipped ) {
279279 writer .write (String .format (" Skipped: %d%n" , skippedTests ));
280280 }
281- writer .write ("% n" );
281+ writer .write ("\ n " );
282282
283283 // Summary by tag (Java 8 compatible map operations: computeIfAbsent is fine)
284284 Map <String , List <ExecutedTest >> tagToTests = new HashMap <>();
@@ -297,11 +297,11 @@ private void generateTextReport(Map<ExecutedTest, Set<String>> testTagMap)
297297 }
298298 }
299299
300- writer .write ("SUMMARY BY TAG:% n" );
301- writer .write (line + "% n" );
300+ writer .write ("SUMMARY BY TAG:\ n " );
301+ writer .write (line + "\ n " );
302302 writer .write (String .format ("%-20s | %5s | %5s | %5s | %5s%n" ,
303303 "Tag" , "Total" , "Pass" , "Fail" , "Error" ));
304- writer .write (line + "% n" );
304+ writer .write (line + "\ n " );
305305
306306 for (Map .Entry <String , TestStats > entry : tagStats .entrySet ()) {
307307 TestStats stats = entry .getValue ();
@@ -320,14 +320,14 @@ private void generateTextReport(Map<ExecutedTest, Set<String>> testTagMap)
320320 "<NO TAG>" , testsWithoutTags , "?" , "?" , "?" ));
321321 }
322322
323- writer .write ("% n" + separator + "% n" );
324- writer .write ("EXECUTED TESTS BY TAG:% n" );
325- writer .write (separator + "%n% n" );
323+ writer .write ("\ n " + separator + "\ n " );
324+ writer .write ("EXECUTED TESTS BY TAG:\ n " );
325+ writer .write (separator + "\n \ n " );
326326
327327 for (Map .Entry <String , List <ExecutedTest >> entry : tagToTests .entrySet ()) {
328328 writer .write (String .format ("Tag: %s (%d tests)%n" ,
329329 entry .getKey (), entry .getValue ().size ()));
330- writer .write (line + "% n" );
330+ writer .write (line + "\ n " );
331331 for (ExecutedTest test : entry .getValue ()) {
332332 String status = getStatusIcon (test );
333333 writer .write (String .format (" %s %s#%s (%.3fs)%n" ,
@@ -336,12 +336,12 @@ private void generateTextReport(Map<ExecutedTest, Set<String>> testTagMap)
336336 test .getMethodName (),
337337 Double .parseDouble (test .getTime ())));
338338 }
339- writer .write ("% n" );
339+ writer .write ("\ n " );
340340 }
341341
342- writer .write ("% n" + separator + "% n" );
343- writer .write ("ALL EXECUTED TESTS WITH TAGS:% n" );
344- writer .write (separator + "%n% n" );
342+ writer .write ("\ n " + separator + "\ n " );
343+ writer .write ("ALL EXECUTED TESTS WITH TAGS:\ n " );
344+ writer .write (separator + "\n \ n " );
345345
346346 for (Map .Entry <ExecutedTest , Set <String >> entry : testTagMap .entrySet ()) {
347347 ExecutedTest test = entry .getKey ();
@@ -359,10 +359,10 @@ private void generateTextReport(Map<ExecutedTest, Set<String>> testTagMap)
359359 }
360360
361361 if (testsWithoutTags > 0 ) {
362- writer .write ("%n" + separator + "% n" );
362+ writer .write ("%n" + separator + "\ n " );
363363 writer .write ("⚠️ WARNING: " + testsWithoutTags +
364- " executed tests without tags% n" );
365- writer .write (separator + "% n" );
364+ " executed tests without tags\ n " );
365+ writer .write (separator + "\ n " );
366366 }
367367 }
368368 }
@@ -463,38 +463,38 @@ private void generateHtmlReport(Map<ExecutedTest, Set<String>> testTagMap)
463463 private void generateJsonReport (Map <ExecutedTest , Set <String >> testTagMap )
464464 throws IOException {
465465 try (FileWriter writer = new FileWriter (outputFile )) {
466- writer .write ("{% n" );
467- writer .write (" \" executedTests\" : [% n" );
466+ writer .write ("{\ n " );
467+ writer .write (" \" executedTests\" : [\ n " );
468468
469469 int count = 0 ;
470470 for (Map .Entry <ExecutedTest , Set <String >> entry : testTagMap .entrySet ()) {
471- if (count ++ > 0 ) writer .write (",% n" );
471+ if (count ++ > 0 ) writer .write (",\ n " );
472472 ExecutedTest test = entry .getKey ();
473- writer .write (" {% n" );
474- writer .write (" \" class\" : \" " + escapeJson (test .getClassName ()) + "\" ,% n" );
475- writer .write (" \" method\" : \" " + escapeJson (test .getMethodName ()) + "\" ,% n" );
476- writer .write (" \" time\" : " + test .getTime () + ",% n" );
477- writer .write (" \" skipped\" : " + test .isSkipped () + ",% n" );
478- writer .write (" \" failed\" : " + test .isFailed () + ",% n" );
479- writer .write (" \" error\" : " + test .isError () + ",% n" );
473+ writer .write (" {\ n " );
474+ writer .write (" \" class\" : \" " + escapeJson (test .getClassName ()) + "\" ,\ n " );
475+ writer .write (" \" method\" : \" " + escapeJson (test .getMethodName ()) + "\" ,\ n " );
476+ writer .write (" \" time\" : " + test .getTime () + ",\ n " );
477+ writer .write (" \" skipped\" : " + test .isSkipped () + ",\ n " );
478+ writer .write (" \" failed\" : " + test .isFailed () + ",\ n " );
479+ writer .write (" \" error\" : " + test .isError () + ",\ n " );
480480 writer .write (" \" tags\" : [" );
481481 writer .write (entry .getValue ().stream ()
482482 .map (tag -> "\" " + escapeJson (tag ) + "\" " )
483483 .collect (Collectors .joining (", " )));
484- writer .write ("]% n" );
484+ writer .write ("]\ n " );
485485 writer .write (" }" );
486486 }
487487
488- writer .write ("% n ]% n" );
489- writer .write ("}%n " );
488+ writer .write ("\ n ]\ n " );
489+ writer .write ("}" );
490490 }
491491 }
492492
493493 private void generateXmlReport (Map <ExecutedTest , Set <String >> testTagMap )
494494 throws IOException {
495495 try (FileWriter writer = new FileWriter (outputFile )) {
496- writer .write ("<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>% n" );
497- writer .write ("<executedTestTagReport>% n" );
496+ writer .write ("<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\ n " );
497+ writer .write ("<executedTestTagReport>\ n " );
498498
499499 for (Map .Entry <ExecutedTest , Set <String >> entry : testTagMap .entrySet ()) {
500500 ExecutedTest test = entry .getKey ();
@@ -503,14 +503,14 @@ private void generateXmlReport(Map<ExecutedTest, Set<String>> testTagMap)
503503 writer .write ("time=\" " + test .getTime () + "\" " );
504504 writer .write ("skipped=\" " + test .isSkipped () + "\" " );
505505 writer .write ("failed=\" " + test .isFailed () + "\" " );
506- writer .write ("error=\" " + test .isError () + "\" >% n" );
506+ writer .write ("error=\" " + test .isError () + "\" >\ n " );
507507 for (String tag : entry .getValue ()) {
508- writer .write (" <tag>" + escapeXml (tag ) + "</tag>% n" );
508+ writer .write (" <tag>" + escapeXml (tag ) + "</tag>\ n " );
509509 }
510- writer .write (" </test>% n" );
510+ writer .write (" </test>\ n " );
511511 }
512512
513- writer .write ("</executedTestTagReport>% n" );
513+ writer .write ("</executedTestTagReport>\ n " );
514514 }
515515 }
516516
0 commit comments