1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.surefire.api.report;
20
21 import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN;
22 import static org.junit.Assert.assertEquals;
23
24
25
26
27 public class CategorizedReportEntryTest {
28 public void testGetReportNameWithGroupWhenSourceTextIsNull() {
29 String className = "ClassName";
30 String classText = null;
31 String groupName = "The Group Name";
32 ReportEntry reportEntry =
33 new CategorizedReportEntry(NORMAL_RUN, 1L, className, classText, groupName, null, null);
34 assertEquals("ClassName (of The Group Name)", reportEntry.getReportNameWithGroup());
35 }
36
37 public void testGetReportNameWithGroupWhenSourceTextIsEmpty() {
38 String className = "ClassName";
39 String classText = "";
40 String groupName = "The Group Name";
41 ReportEntry reportEntry =
42 new CategorizedReportEntry(NORMAL_RUN, 1L, className, classText, groupName, null, null);
43 assertEquals("ClassName (of The Group Name)", reportEntry.getReportNameWithGroup());
44 }
45
46 public void testGetReportNameWithGroupWhenSourceTextIsBlank() {
47 String className = "ClassName";
48 String classText = " ";
49 String groupName = "The Group Name";
50 ReportEntry reportEntry =
51 new CategorizedReportEntry(NORMAL_RUN, 1L, className, classText, groupName, null, null);
52 assertEquals("ClassName (of The Group Name)", reportEntry.getReportNameWithGroup());
53 }
54
55 public void testGetReportNameWithGroupWhenSourceTextIsProvided() {
56 String className = "ClassName";
57 String classText = "The Class Name";
58 String groupName = "The Group Name";
59 ReportEntry reportEntry =
60 new CategorizedReportEntry(NORMAL_RUN, 1L, className, classText, groupName, null, null);
61 assertEquals("The Class Name (of The Group Name)", reportEntry.getReportNameWithGroup());
62 }
63 }