@@ -381,40 +381,40 @@ private String repeatString(String s, int count) {
381381 private void generateHtmlReport (Map <ExecutedTest , Set <String >> testTagMap )
382382 throws IOException {
383383 try (FileWriter writer = new FileWriter (outputFile )) {
384- writer .write ("<!DOCTYPE html>% n<html>% n<head>% n" );
385- writer .write ("<meta charset=\" UTF-8\" >% n" );
386- writer .write ("<title>Executed Test Tag Report</title>% n" );
387- writer .write ("<style>% n" );
388- writer .write ("body { font-family: Arial, sans-serif; margin: 20px; }% n" );
389- writer .write ("table { border-collapse: collapse; width: 100%; margin: 20px 0; }% n" );
390- writer .write ("th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }% n" );
391- writer .write ("th { background-color: #4CAF50; color: white; }% n" );
392- writer .write ("tr:nth-child(even) { background-color: #f2f2f2; }% n" );
393- writer .write (".pass { color: green; }% n" );
394- writer .write (".fail { color: red; }% n" );
395- writer .write (".error { color: orange; }% n" );
396- writer .write (".skip { color: gray; }% n" );
384+ writer .write ("<!DOCTYPE html>\ n <html>\ n <head>\ n " );
385+ writer .write ("<meta charset=\" UTF-8\" >\ n " );
386+ writer .write ("<title>Executed Test Tag Report</title>\ n " );
387+ writer .write ("<style>\ n " );
388+ writer .write ("body { font-family: Arial, sans-serif; margin: 20px; }\ n " );
389+ writer .write ("table { border-collapse: collapse; width: 100%; margin: 20px 0; }\ n " );
390+ writer .write ("th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }\ n " );
391+ writer .write ("th { background-color: #4CAF50; color: white; }\ n " );
392+ writer .write ("tr:nth-child(even) { background-color: #f2f2f2; }\ n " );
393+ writer .write (".pass { color: green; }\ n " );
394+ writer .write (".fail { color: red; }\ n " );
395+ writer .write (".error { color: orange; }\ n " );
396+ writer .write (".skip { color: gray; }\ n " );
397397 writer .write (".tag { background-color: #e7f3ff; padding: 2px 8px; " );
398- writer .write ("border-radius: 3px; margin: 2px; display: inline-block; }% n" );
399- writer .write ("</style>% n" );
400- writer .write ("</head>% n<body>% n" );
401- writer .write ("<h1>Executed Test Tag Report</h1>% n" );
398+ writer .write ("border-radius: 3px; margin: 2px; display: inline-block; }\ n " );
399+ writer .write ("</style>\ n " );
400+ writer .write ("</head>\ n <body>\ n " );
401+ writer .write ("<h1>Executed Test Tag Report</h1>\ n " );
402402
403403 // Summary
404- writer .write ("<h2>Summary</h2>% n" );
405- writer .write ("<table>% n" );
406- writer .write ("<tr><th>Metric</th><th>Count</th></tr>% n" );
407- writer .write ("<tr><td>Total Tests</td><td>" + testTagMap .size () + "</td></tr>% n" );
404+ writer .write ("<h2>Summary</h2>\ n " );
405+ writer .write ("<table>\ n " );
406+ writer .write ("<tr><th>Metric</th><th>Count</th></tr>\ n " );
407+ writer .write ("<tr><td>Total Tests</td><td>" + testTagMap .size () + "</td></tr>\ n " );
408408
409409 long passed = testTagMap .keySet ().stream ()
410410 .filter (t -> !t .isFailed () && !t .isError ()).count ();
411411 long failed = testTagMap .keySet ().stream ().filter (ExecutedTest ::isFailed ).count ();
412412 long errors = testTagMap .keySet ().stream ().filter (ExecutedTest ::isError ).count ();
413413
414- writer .write ("<tr><td>Passed</td><td class='pass'>" + passed + "</td></tr>% n" );
415- writer .write ("<tr><td>Failed</td><td class='fail'>" + failed + "</td></tr>% n" );
416- writer .write ("<tr><td>Errors</td><td class='error'>" + errors + "</td></tr>% n" );
417- writer .write ("</table>% n" );
414+ writer .write ("<tr><td>Passed</td><td class='pass'>" + passed + "</td></tr>\ n " );
415+ writer .write ("<tr><td>Failed</td><td class='fail'>" + failed + "</td></tr>\ n " );
416+ writer .write ("<tr><td>Errors</td><td class='error'>" + errors + "</td></tr>\ n " );
417+ writer .write ("</table>\ n " );
418418
419419 // Tags summary
420420 Map <String , List <ExecutedTest >> tagToTests = new HashMap <>();
@@ -424,19 +424,19 @@ private void generateHtmlReport(Map<ExecutedTest, Set<String>> testTagMap)
424424 }
425425 }
426426
427- writer .write ("<h2>Tags Summary</h2>% n" );
428- writer .write ("<table>% n" );
429- writer .write ("<tr><th>Tag</th><th>Tests</th></tr>% n" );
427+ writer .write ("<h2>Tags Summary</h2>\ n " );
428+ writer .write ("<table>\ n " );
429+ writer .write ("<tr><th>Tag</th><th>Tests</th></tr>\ n " );
430430 for (Map .Entry <String , List <ExecutedTest >> entry : tagToTests .entrySet ()) {
431431 writer .write ("<tr><td>" + entry .getKey () + "</td><td>" +
432- entry .getValue ().size () + "</td></tr>% n" );
432+ entry .getValue ().size () + "</td></tr>\ n " );
433433 }
434- writer .write ("</table>% n" );
434+ writer .write ("</table>\ n " );
435435
436436 // All tests
437- writer .write ("<h2>All Executed Tests</h2>% n" );
438- writer .write ("<table>% n" );
439- writer .write ("<tr><th>Status</th><th>Test</th><th>Tags</th><th>Time</th></tr>% n" );
437+ writer .write ("<h2>All Executed Tests</h2>\ n " );
438+ writer .write ("<table>\ n " );
439+ writer .write ("<tr><th>Status</th><th>Test</th><th>Tags</th><th>Time</th></tr>\ n " );
440440 for (Map .Entry <ExecutedTest , Set <String >> entry : testTagMap .entrySet ()) {
441441 ExecutedTest test = entry .getKey ();
442442 String statusClass = test .isFailed () ? "fail" :
@@ -452,11 +452,11 @@ private void generateHtmlReport(Map<ExecutedTest, Set<String>> testTagMap)
452452 }
453453 writer .write ("</td>" );
454454 writer .write ("<td>" + test .getTime () + "s</td>" );
455- writer .write ("</tr>% n" );
455+ writer .write ("</tr>\ n " );
456456 }
457- writer .write ("</table>% n" );
457+ writer .write ("</table>\ n " );
458458
459- writer .write ("</body>% n</html>" );
459+ writer .write ("</body>\ n </html>" );
460460 }
461461 }
462462
0 commit comments