arturobernalg commented on code in PR #3589:
URL: https://github.com/apache/maven-surefire/pull/3589#discussion_r4551029085


##########
maven-surefire-common/src/test/java/org/apache/maven/surefire/report/FileReporterTest.java:
##########
@@ -65,6 +65,33 @@ private TestSetStats createTestSetStats() {
         return new TestSetStats(true, true);
     }
 
+    /**
+     * SUREFIRE-2233: a report file name derived from a long, deeply nested 
test class name must
+     * still be creatable, even on filesystems with a low per-component length 
limit.
+     */
+    @Test
+    public void testVeryLongFileNameIsTruncated() {
+        File reportDir = new File("target");
+        StringBuilder packageBuilder = new StringBuilder("org.example.");
+        for (int i = 0; i < 12; i++) {
+            packageBuilder.append("subpackage1.");
+        }
+        String longTestName = packageBuilder + 
"TestWithAnExceptionallyLongAndDeeplyNestedFullyQualifiedClassName";
+        reportEntry = new SimpleReportEntry(NORMAL_RUN, 1L, longTestName, 
null, longTestName, null);
+        WrappedReportEntry wrappedReportEntry =
+                new WrappedReportEntry(reportEntry, ReportEntryType.SUCCESS, 
1771085631L, 12, null, null);
+        reporter = new FileReporter(reportDir, null, Charset.defaultCharset(), 
false, false, false);

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to