42
42
* @author <a href="mailto:[email protected] ">Allan Ramirez</a>
43
43
*/
44
44
@ SuppressWarnings ("checkstyle:linelength" )
45
- public class SurefireReportMojoTest extends AbstractMojoTestCase {
45
+ public class SurefireReportTest extends AbstractMojoTestCase {
46
46
private ArtifactStubFactory artifactStubFactory ;
47
47
48
48
// Can be removed with Doxia 2.0.0
@@ -64,8 +64,8 @@ protected void tearDown() throws Exception {
64
64
super .tearDown ();
65
65
}
66
66
67
- protected SurefireReportMojo createReportMojo (File pluginXmlFile ) throws Exception {
68
- SurefireReportMojo mojo = (SurefireReportMojo ) lookupMojo ("report" , pluginXmlFile );
67
+ protected SurefireReport createReportMojo (File pluginXmlFile ) throws Exception {
68
+ SurefireReport mojo = (SurefireReport ) lookupMojo ("report" , pluginXmlFile );
69
69
assertNotNull ("Mojo found." , mojo );
70
70
71
71
LegacySupport legacySupport = lookup (LegacySupport .class );
@@ -82,7 +82,7 @@ protected SurefireReportMojo createReportMojo(File pluginXmlFile) throws Excepti
82
82
83
83
public void testBasicSurefireReport () throws Exception {
84
84
File testPom = new File (getUnitBaseDir (), "basic-surefire-report-test/plugin-config.xml" );
85
- SurefireReportMojo mojo = createReportMojo (testPom );
85
+ SurefireReport mojo = createReportMojo (testPom );
86
86
File outputDir = (File ) getVariableValueFromObject (mojo , "outputDirectory" );
87
87
boolean showSuccess = (Boolean ) getVariableValueFromObject (mojo , "showSuccess" );
88
88
File reportsDir = (File ) getVariableValueFromObject (mojo , "reportsDirectory" );
@@ -96,14 +96,14 @@ public void testBasicSurefireReport() throws Exception {
96
96
new File (getBasedir () + "/src/test/resources/unit/basic-surefire-report-test/surefire-reports" )
97
97
.getAbsolutePath (),
98
98
reportsDir .getAbsolutePath ());
99
- assertEquals ("surefire-report " , outputName );
99
+ assertEquals ("surefire" , outputName );
100
100
assertEquals (
101
101
new File (getBasedir () + "/target/site/unit/basic-surefire-report-test/xref-test" ).getAbsolutePath (),
102
102
xrefLocation .getAbsolutePath ());
103
103
assertTrue (linkXRef );
104
104
105
105
mojo .execute ();
106
- File report = new File (getBasedir (), "target/site/unit/basic-surefire-report-test/surefire-report .html" );
106
+ File report = new File (getBasedir (), "target/site/unit/basic-surefire-report-test/surefire.html" );
107
107
assertTrue (report .exists ());
108
108
String htmlContent = FileUtils .fileRead (report );
109
109
@@ -119,12 +119,11 @@ private File getUnitBaseDir() throws UnsupportedEncodingException {
119
119
120
120
public void testBasicSurefireReportIfShowSuccessIsFalse () throws Exception {
121
121
File testPom = new File (getUnitBaseDir (), "basic-surefire-report-success-false/plugin-config.xml" );
122
- SurefireReportMojo mojo = createReportMojo (testPom );
122
+ SurefireReport mojo = createReportMojo (testPom );
123
123
boolean showSuccess = (Boolean ) getVariableValueFromObject (mojo , "showSuccess" );
124
124
assertFalse (showSuccess );
125
125
mojo .execute ();
126
- File report =
127
- new File (getBasedir (), "target/site/unit/basic-surefire-report-success-false/surefire-report.html" );
126
+ File report = new File (getBasedir (), "target/site/unit/basic-surefire-report-success-false/surefire.html" );
128
127
assertTrue (report .exists ());
129
128
String htmlContent = FileUtils .fileRead (report );
130
129
@@ -134,12 +133,11 @@ public void testBasicSurefireReportIfShowSuccessIsFalse() throws Exception {
134
133
135
134
public void testBasicSurefireReportIfLinkXrefIsFalse () throws Exception {
136
135
File testPom = new File (getUnitBaseDir (), "basic-surefire-report-linkxref-false/plugin-config.xml" );
137
- SurefireReportMojo mojo = createReportMojo (testPom );
136
+ SurefireReport mojo = createReportMojo (testPom );
138
137
boolean linkXRef = (Boolean ) getVariableValueFromObject (mojo , "linkXRef" );
139
138
assertFalse (linkXRef );
140
139
mojo .execute ();
141
- File report =
142
- new File (getBasedir (), "target/site/unit/basic-surefire-report-linkxref-false/surefire-report.html" );
140
+ File report = new File (getBasedir (), "target/site/unit/basic-surefire-report-linkxref-false/surefire.html" );
143
141
assertTrue (report .exists ());
144
142
String htmlContent = FileUtils .fileRead (report );
145
143
@@ -149,10 +147,9 @@ public void testBasicSurefireReportIfLinkXrefIsFalse() throws Exception {
149
147
150
148
public void testBasicSurefireReportIfReportingIsNull () throws Exception {
151
149
File testPom = new File (getUnitBaseDir (), "basic-surefire-report-reporting-null/plugin-config.xml" );
152
- SurefireReportMojo mojo = createReportMojo (testPom );
150
+ SurefireReport mojo = createReportMojo (testPom );
153
151
mojo .execute ();
154
- File report =
155
- new File (getBasedir (), "target/site/unit/basic-surefire-report-reporting-null/surefire-report.html" );
152
+ File report = new File (getBasedir (), "target/site/unit/basic-surefire-report-reporting-null/surefire.html" );
156
153
assertTrue (report .exists ());
157
154
String htmlContent = FileUtils .fileRead (report );
158
155
@@ -163,10 +160,9 @@ public void testBasicSurefireReportIfReportingIsNull() throws Exception {
163
160
@ SuppressWarnings ("checkstyle:methodname" )
164
161
public void testBasicSurefireReport_AnchorTestCases () throws Exception {
165
162
File testPom = new File (getUnitBaseDir (), "basic-surefire-report-anchor-test-cases/plugin-config.xml" );
166
- SurefireReportMojo mojo = createReportMojo (testPom );
163
+ SurefireReport mojo = createReportMojo (testPom );
167
164
mojo .execute ();
168
- File report =
169
- new File (getBasedir (), "target/site/unit/basic-surefire-report-anchor-test-cases/surefire-report.html" );
165
+ File report = new File (getBasedir (), "target/site/unit/basic-surefire-report-anchor-test-cases/surefire.html" );
170
166
assertTrue (report .exists ());
171
167
String htmlContent = FileUtils .fileRead (report );
172
168
@@ -180,9 +176,9 @@ public void testBasicSurefireReport_AnchorTestCases() throws Exception {
180
176
181
177
public void testSurefireReportSingleError () throws Exception {
182
178
File testPom = new File (getUnitBaseDir (), "surefire-report-single-error/plugin-config.xml" );
183
- SurefireReportMojo mojo = createReportMojo (testPom );
179
+ SurefireReport mojo = createReportMojo (testPom );
184
180
mojo .execute ();
185
- File report = new File (getBasedir (), "target/site/unit/surefire-report-single-error/surefire-report .html" );
181
+ File report = new File (getBasedir (), "target/site/unit/surefire-report-single-error/surefire.html" );
186
182
assertTrue (report .exists ());
187
183
String htmlContent = FileUtils .fileRead (report );
188
184
@@ -267,10 +263,10 @@ public void testSurefireReportSingleError() throws Exception {
267
263
268
264
public void testSurefireReportNestedClassTrimStackTrace () throws Exception {
269
265
File testPom = new File (getUnitBaseDir (), "surefire-report-nestedClass-trimStackTrace/plugin-config.xml" );
270
- SurefireReportMojo mojo = createReportMojo (testPom );
266
+ SurefireReport mojo = createReportMojo (testPom );
271
267
mojo .execute ();
272
- File report = new File (
273
- getBasedir (), "target/site/unit/surefire-report-nestedClass-trimStackTrace/surefire-report .html" );
268
+ File report =
269
+ new File ( getBasedir (), "target/site/unit/surefire-report-nestedClass-trimStackTrace/surefire.html" );
274
270
assertTrue (report .exists ());
275
271
String htmlContent = FileUtils .fileRead (report );
276
272
@@ -331,9 +327,9 @@ public void testSurefireReportNestedClassTrimStackTrace() throws Exception {
331
327
332
328
public void testSurefireReportNestedClass () throws Exception {
333
329
File testPom = new File (getUnitBaseDir (), "surefire-report-nestedClass/plugin-config.xml" );
334
- SurefireReportMojo mojo = createReportMojo (testPom );
330
+ SurefireReport mojo = createReportMojo (testPom );
335
331
mojo .execute ();
336
- File report = new File (getBasedir (), "target/site/unit/surefire-report-nestedClass/surefire-report .html" );
332
+ File report = new File (getBasedir (), "target/site/unit/surefire-report-nestedClass/surefire.html" );
337
333
assertTrue (report .exists ());
338
334
String htmlContent = FileUtils .fileRead (report );
339
335
@@ -418,10 +414,9 @@ public void testSurefireReportNestedClass() throws Exception {
418
414
419
415
public void testSurefireReportEnclosedTrimStackTrace () throws Exception {
420
416
File testPom = new File (getUnitBaseDir (), "surefire-report-enclosed-trimStackTrace/plugin-config.xml" );
421
- SurefireReportMojo mojo = createReportMojo (testPom );
417
+ SurefireReport mojo = createReportMojo (testPom );
422
418
mojo .execute ();
423
- File report =
424
- new File (getBasedir (), "target/site/unit/surefire-report-enclosed-trimStackTrace/surefire-report.html" );
419
+ File report = new File (getBasedir (), "target/site/unit/surefire-report-enclosed-trimStackTrace/surefire.html" );
425
420
assertTrue (report .exists ());
426
421
String htmlContent = FileUtils .fileRead (report );
427
422
@@ -482,9 +477,9 @@ public void testSurefireReportEnclosedTrimStackTrace() throws Exception {
482
477
483
478
public void testSurefireReportEnclosed () throws Exception {
484
479
File testPom = new File (getUnitBaseDir (), "surefire-report-enclosed/plugin-config.xml" );
485
- SurefireReportMojo mojo = createReportMojo (testPom );
480
+ SurefireReport mojo = createReportMojo (testPom );
486
481
mojo .execute ();
487
- File report = new File (getBasedir (), "target/site/unit/surefire-report-enclosed/surefire-report .html" );
482
+ File report = new File (getBasedir (), "target/site/unit/surefire-report-enclosed/surefire.html" );
488
483
assertTrue (report .exists ());
489
484
String htmlContent = FileUtils .fileRead (report );
490
485
@@ -579,7 +574,7 @@ public void testSurefireReportEnclosed() throws Exception {
579
574
580
575
public void testCustomTitleAndDescriptionReport () throws Exception {
581
576
File testPom = new File (getUnitBaseDir (), "surefire-1183/plugin-config.xml" );
582
- SurefireReportMojo mojo = createReportMojo (testPom );
577
+ SurefireReport mojo = createReportMojo (testPom );
583
578
584
579
File outputDir = (File ) getVariableValueFromObject (mojo , "outputDirectory" );
585
580
String outputName = (String ) getVariableValueFromObject (mojo , "outputName" );
@@ -590,11 +585,11 @@ public void testCustomTitleAndDescriptionReport() throws Exception {
590
585
new File (getBasedir () + "/src/test/resources/unit/surefire-1183/acceptancetest-reports" )
591
586
.getAbsolutePath (),
592
587
reportsDir .getAbsolutePath ());
593
- assertEquals ("acceptance-test-report " , outputName );
588
+ assertEquals ("acceptance-test" , outputName );
594
589
595
590
mojo .execute ();
596
591
597
- File report = new File (getBasedir (), "target/site/unit/surefire-1183/acceptance-test-report .html" );
592
+ File report = new File (getBasedir (), "target/site/unit/surefire-1183/acceptance-test.html" );
598
593
599
594
assertTrue (report .exists ());
600
595
0 commit comments