Skip to content

Commit 87371f0

Browse files
committed
Clean up integration tests
1 parent 0f418dc commit 87371f0

File tree

5 files changed

+63
-37
lines changed

5 files changed

+63
-37
lines changed

src/it/announcement-generate-custom-template/verify.bsh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,26 @@
1919
*/
2020

2121
import java.io.*;
22+
import java.nio.file.*;
2223
import java.util.*;
2324
import java.util.jar.*;
24-
import org.codehaus.plexus.util.*;
2525

2626
boolean result = true;
2727

2828
try
2929
{
3030
File report = new File( basedir, "target/announcement/test-announce.vm" );
31-
if ( !report.exists() || report.isDirectory() )
31+
if ( !report.exists() )
3232
{
33-
System.err.println( "report file is missing or a directory." );
33+
System.err.println( "report file is missing." );
3434
return false;
3535
}
36-
String reportContent = FileUtils.fileRead( report );
36+
if ( report.isDirectory() )
37+
{
38+
System.err.println( "report file is a directory." );
39+
return false;
40+
}
41+
String reportContent = new String(Files.readAllBytes( report.toPath() ), "UTF-8");
3742

3843
int indexOf = reportContent.indexOf( "maven-changes-plugin-test-1.1 release" );
3944
if ( indexOf < 0 )

src/it/report-changes-generation/verify.bsh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,38 @@
1919
*/
2020

2121
import java.io.*;
22+
import java.nio.file.*;
2223
import java.util.*;
2324
import java.util.jar.*;
24-
import org.codehaus.plexus.util.*;
2525

2626
boolean result = true;
2727

2828
try
2929
{
3030
File report = new File( basedir, "target/site/changes-report.html" );
31-
if ( !report.exists() || report.isDirectory() )
31+
if ( !report.exists() )
3232
{
33-
System.err.println( "report file is missing or a directory." );
33+
System.err.println( "report file is missing." );
3434
return false;
3535
}
36-
String reportContent = FileUtils.fileRead( report );
36+
if ( report.isDirectory() )
37+
{
38+
System.err.println( "report is directory." );
39+
return false;
40+
}
41+
String reportContent = new String(Files.readAllBytes( report.toPath() ), "UTF-8");
3742

3843
int indexOf = reportContent.indexOf( "Changes" );
3944
if ( indexOf < 0 )
4045
{
41-
System.err.println( "changes-report.html doesn't contains Changes title" );
46+
System.err.println( "changes-report.html doesn't contain Changes title" );
4247
return false;
4348
}
4449

4550
indexOf = reportContent.indexOf( "href=\"http://myjira/browse/MCHANGES-88\"" );
4651
if ( indexOf < 0 )
4752
{
48-
System.err.println( "changes-report.html doesn't contains jira issue link" );
53+
System.err.println( "changes-report.html doesn't contain jira issue link" );
4954
return false;
5055
}
5156

@@ -61,7 +66,7 @@ try
6166
indexOf = reportContent.indexOf( "bug-12345" );
6267
if ( indexOf < 0 )
6368
{
64-
System.err.println( "changes-report.html doesn't contains issue text for issue specified with <fixes> element" );
69+
System.err.println( "changes-report.html doesn't contain issue text for issue specified with <fixes> element" );
6570
return false;
6671
}
6772
indexOf = reportContent.indexOf( "Fixes ." );

src/it/report-changes-interpolation/verify.bsh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,40 @@
1919
*/
2020

2121
import java.io.*;
22+
import java.nio.file.*;
2223
import java.text.*;
2324
import java.util.*;
2425
import java.util.jar.*;
25-
import org.codehaus.plexus.util.*;
26+
import java.nio.file.*;
2627

2728
boolean result = true;
2829

2930
try
3031
{
3132
File report = new File( basedir, "target/site/changes-report.html" );
32-
if ( !report.exists() || report.isDirectory() )
33+
if ( !report.exists() )
3334
{
34-
System.err.println( "report file is missing or a directory." );
35+
System.err.println( "report file is missing." );
3536
return false;
3637
}
37-
String reportContent = FileUtils.fileRead( report );
38+
if ( report.isDirectory() )
39+
{
40+
System.err.println( "report file is a directory." );
41+
return false;
42+
}
43+
String reportContent = new String(Files.readAllBytes( report.toPath() ), "UTF-8");
3844

3945
int indexOf = reportContent.indexOf( "Changes" );
4046
if ( indexOf < 0 )
4147
{
42-
System.err.println( "changes-report.html doesn't contains Changes title" );
48+
System.err.println( "changes-report.html doesn't contain Changes title" );
4349
return false;
4450
}
4551

4652
indexOf = reportContent.indexOf( "href=\"http://myjira/browse/MCHANGES-88\"" );
4753
if ( indexOf < 0 )
4854
{
49-
System.err.println( "changes-report.html doesn't contains jira issue link" );
55+
System.err.println( "changes-report.html doesn't contain jira issue link" );
5056
return false;
5157
}
5258

@@ -62,7 +68,7 @@ try
6268
indexOf = reportContent.indexOf( "bug-12345" );
6369
if ( indexOf < 0 )
6470
{
65-
System.err.println( "changes-report.html doesn't contains issue text for issue specified with <fixes> element" );
71+
System.err.println( "changes-report.html doesn't contain issue text for issue specified with <fixes> element" );
6672
return false;
6773
}
6874
indexOf = reportContent.indexOf( "Fixes ." );
@@ -75,7 +81,7 @@ try
7581
indexOf = reportContent.indexOf( "<a href=\"#a99.0\">" );
7682
if ( indexOf < 0 )
7783
{
78-
System.err.println( "changes-report.html doesn't contains version from pom" );
84+
System.err.println( "changes-report.html doesn't contain version from pom" );
7985
return false;
8086
}
8187

@@ -86,7 +92,7 @@ try
8692
indexOf = reportContent.indexOf( formattedDate );
8793
if ( indexOf < 0 )
8894
{
89-
System.err.println( "changes-report.html doesn't publishDate" );
95+
System.err.println( "changes-report.html doesn't contain publishDate" );
9096
return false;
9197
}
9298

src/it/report-changes-system-noissuemanagement/verify.bsh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,51 +19,56 @@
1919
*/
2020

2121
import java.io.*;
22+
import java.nio.file.*;
2223
import java.util.*;
2324
import java.util.jar.*;
24-
import org.codehaus.plexus.util.*;
2525

2626
boolean result = true;
2727

2828
try
2929
{
3030
File report = new File( basedir, "target/site/changes-report.html" );
31-
if ( !report.exists() || report.isDirectory() )
31+
if ( !report.exists() )
3232
{
33-
System.err.println( "report file is missing or a directory." );
33+
System.err.println( "report file is missing." );
3434
return false;
3535
}
36-
String reportContent = FileUtils.fileRead( report );
36+
if ( report.isDirectory() )
37+
{
38+
System.err.println( "report file is a directory." );
39+
return false;
40+
}
41+
String reportContent = new String(Files.readAllBytes( report.toPath() ), "UTF-8");
3742

3843
int indexOf = reportContent.indexOf( "Changes" );
3944
if ( indexOf < 0 )
4045
{
41-
System.err.println( "changes-report.html doesn't contains Changes title" );
46+
System.err.println( "changes-report.html doesn't contain Changes title" );
4247
return false;
4348
}
4449

4550
indexOf = reportContent.indexOf( "href=\"http://myjira/browse/MCHANGES-88\"" );
4651
if ( indexOf < 0 )
4752
{
48-
System.err.println( "changes-report.html doesn't contains jira issue link" );
53+
System.err.println( "changes-report.html doesn't contain jira issue link" );
4954
return false;
5055
}
5156
indexOf = reportContent.indexOf( "href=\"http://localhost/1212\"" );
5257
if ( indexOf < 0 )
5358
{
54-
System.err.println( "changes-report.html doesn't contains qc issue link" );
59+
System.err.println( "changes-report.html doesn't contain qc issue link" );
5560
return false;
5661
}
5762
indexOf = reportContent.indexOf( "href=\"http://www.redmine.org/show/issue/88\"" );
5863
if ( indexOf < 0 )
5964
{
60-
System.err.println( "changes-report.html doesn't contains redmine issue link" );
65+
System.err.println( "changes-report.html doesn't contain redmine issue link" );
6166
return false;
6267
}
6368
indexOf = reportContent.indexOf( "2008-01-01" );
6469
if ( indexOf < 0 )
6570
{
66-
System.err.println( "changes-report.html doesn't contains date 2008-01-01" );
71+
System.err.println( "changes-report.html doesn't contain date 2008-01-01" );
6772
return false;
6873
}
6974

src/it/report-changes-system/verify.bsh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,50 @@
1919
*/
2020

2121
import java.io.*;
22+
import java.nio.file.*;
2223
import java.util.*;
2324
import java.util.jar.*;
24-
import org.codehaus.plexus.util.*;
2525

2626
boolean result = true;
2727

2828
try
2929
{
3030
File report = new File( basedir, "target/site/en/changes-report.html" );
31-
if ( !report.exists() || report.isDirectory() )
31+
if ( !report.exists() )
3232
{
33-
System.err.println( "report file is missing or a directory." );
33+
System.err.println( "report file is missing." );
3434
return false;
3535
}
36-
String reportContent = FileUtils.fileRead( report );
36+
if ( report.isDirectory() )
37+
{
38+
System.err.println( "report file is a directory." );
39+
return false;
40+
}
41+
String reportContent = new String(Files.readAllBytes( report.toPath() ), "UTF-8");
3742

3843
int indexOf = reportContent.indexOf( "Changes" );
3944
if ( indexOf < 0 )
4045
{
41-
System.err.println( "changes-report.html doesn't contains Changes title" );
46+
System.err.println( "changes-report.html doesn't contain Changes title" );
4247
return false;
4348
}
4449

4550
indexOf = reportContent.indexOf( "href=\"http://myjira/browse/MCHANGES-88\"" );
4651
if ( indexOf < 0 )
4752
{
48-
System.err.println( "changes-report.html doesn't contains jira issue link" );
53+
System.err.println( "changes-report.html doesn't contain jira issue link" );
4954
return false;
5055
}
5156
indexOf = reportContent.indexOf( "href=\"http://localhost/1212\"" );
5257
if ( indexOf < 0 )
5358
{
54-
System.err.println( "changes-report.html doesn't contains qc issue link" );
59+
System.err.println( "changes-report.html doesn't contain qc issue link" );
5560
return false;
5661
}
5762
indexOf = reportContent.indexOf( "2008-01-01" );
5863
if ( indexOf < 0 )
5964
{
60-
System.err.println( "changes-report.html doesn't contains date 2008-01-01" );
65+
System.err.println( "changes-report.html doesn't contain date 2008-01-01" );
6166
return false;
6267
}
6368
}

0 commit comments

Comments
 (0)