This is an automated email from the ASF dual-hosted git repository. adangel pushed a commit to branch pmd7 in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git
commit 31192283f3b8ed6e7b3fff5f5032bbaa8005dd96 Author: Andreas Dangel <adan...@apache.org> AuthorDate: Tue Jan 17 19:18:17 2023 +0100 Fix compile errors and test failures --- .../org/apache/maven/plugins/pmd/PmdCollectingRenderer.java | 6 ++++-- .../java/org/apache/maven/plugins/pmd/PmdReportTest.java | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/pmd/PmdCollectingRenderer.java b/src/main/java/org/apache/maven/plugins/pmd/PmdCollectingRenderer.java index 2f712cd..0818d83 100644 --- a/src/main/java/org/apache/maven/plugins/pmd/PmdCollectingRenderer.java +++ b/src/main/java/org/apache/maven/plugins/pmd/PmdCollectingRenderer.java @@ -23,8 +23,8 @@ import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.Report.SuppressedViolation; import net.sourceforge.pmd.RuleViolation; +import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.renderers.AbstractRenderer; -import net.sourceforge.pmd.util.datasource.DataSource; import org.codehaus.plexus.util.StringUtils; import java.io.IOException; @@ -147,10 +147,12 @@ public class PmdCollectingRenderer extends AbstractRenderer public void start() throws IOException { } + @Override - public void startFileAnalysis( DataSource dataSource ) + public void startFileAnalysis( TextFile textFile ) { } + @Override public void end() throws IOException { diff --git a/src/test/java/org/apache/maven/plugins/pmd/PmdReportTest.java b/src/test/java/org/apache/maven/plugins/pmd/PmdReportTest.java index 159da40..e3c4209 100644 --- a/src/test/java/org/apache/maven/plugins/pmd/PmdReportTest.java +++ b/src/test/java/org/apache/maven/plugins/pmd/PmdReportTest.java @@ -559,11 +559,13 @@ public class PmdReportTest assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) ); String str = readFile( generatedFile ); // The parse exception must be in the XML report - assertTrue( str.contains( "ParseException: Encountered at line 23, column 5." ) ); + assertTrue( str.contains( "ParseException:" ) ); + assertTrue( str.contains( "Encountered at line 23, column 5." ) ); str = readFile( generatedReport ); // The parse exception must also be in the HTML report - assertTrue( str.contains( "ParseException: Encountered at line 23, column 5." ) ); + assertTrue( str.contains( "ParseException:" ) ); + assertTrue( str.contains( "Encountered at line 23, column 5." ) ); } public void testPMDProcessingErrorWithDetailsNoReport() @@ -579,11 +581,13 @@ public class PmdReportTest assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) ); String str = readFile( generatedFile ); // The parse exception must be in the XML report - assertTrue( str.contains( "ParseException: Encountered at line 23, column 5." ) ); + assertTrue( str.contains( "ParseException:" ) ); + assertTrue( str.contains( "Encountered at line 23, column 5." ) ); str = readFile( generatedReport ); // The parse exception must NOT be in the HTML report, since reportProcessingErrors is false - assertFalse( str.contains( "ParseException: Encountered \"\" at line 23, column 5." ) ); + assertFalse( str.contains( "ParseException:" ) ); + assertFalse( str.contains( "Encountered at line 23, column 5." ) ); } public void testPMDExcludeRootsShouldExcludeSubdirectories()