Author: hboutemy Date: Sun Apr 18 16:10:19 2010 New Revision: 935363 URL: http://svn.apache.org/viewvc?rev=935363&view=rev Log: [MPMD-120] upgraded plexus-resources to 1.0-alpha-7 to avoid rule files corruption
Modified: maven/plugins/trunk/maven-pmd-plugin/pom.xml maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/mod-1/src/main/config/pmd/latin-1.xml maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/mod-1/src/main/config/pmd/utf-8.xml maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/verify.bsh Modified: maven/plugins/trunk/maven-pmd-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/pom.xml?rev=935363&r1=935362&r2=935363&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-pmd-plugin/pom.xml Sun Apr 18 16:10:19 2010 @@ -115,7 +115,7 @@ under the License. <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-resources</artifactId> - <version>1.0-alpha-4</version> + <version>1.0-alpha-7</version> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> @@ -228,6 +228,6 @@ under the License. <properties> <sitePluginVersion>3.0-beta-1-SNAPSHOT</sitePluginVersion> </properties> - </profile> + </profile> </profiles> </project> Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/mod-1/src/main/config/pmd/latin-1.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/mod-1/src/main/config/pmd/latin-1.xml?rev=935363&r1=935362&r2=935363&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/mod-1/src/main/config/pmd/latin-1.xml (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/mod-1/src/main/config/pmd/latin-1.xml Sun Apr 18 16:10:19 2010 @@ -7,5 +7,6 @@ <description> This ruleset is encoded with ISO-8859-1 to check proper encoding handling. </description> - <rule ref="rulesets/basic.xml/UnnecessaryReturn" message="LATIN-1-CHARS: ÄÖÜäöüß"/> + <rule ref="rulesets/basic.xml/UnnecessaryReturn" message="LATIN-1-CHARS: ÄÖÜäöüß¼½¾¤"/> + <!-- note: ¼½¾¤ = 0xBC 0xBD 0xBE 0xA4 don't exist any more in Latin 15, replaced by OE oe Y" and euro --> </ruleset> Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/mod-1/src/main/config/pmd/utf-8.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/mod-1/src/main/config/pmd/utf-8.xml?rev=935363&r1=935362&r2=935363&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/mod-1/src/main/config/pmd/utf-8.xml (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/mod-1/src/main/config/pmd/utf-8.xml Sun Apr 18 16:10:19 2010 @@ -7,5 +7,5 @@ <description> This ruleset is encoded with UTF-8 to check proper encoding handling. </description> - <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop" message="UTF-8-CHARS: ÃÃÃäöüÃ"/> + <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop" message="UTF-8-CHARS: ÃÃÃäöüü½¾¤"/> </ruleset> Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/verify.bsh URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/verify.bsh?rev=935363&r1=935362&r2=935363&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/verify.bsh (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/verify.bsh Sun Apr 18 16:10:19 2010 @@ -1,33 +1,10 @@ +import org.codehaus.plexus.util.FileUtils; + import java.io.*; import java.util.*; -String[] expectedPaths = -{ - "mod-1/target/site/pmd.html", - "mod-1/target/site/pmd.xml", - "mod-1/target/site/cpd.html", - "mod-1/target/site/cpd.xml", - "mod-2/target/site/pmd.html", - "mod-2/target/site/pmd.xml", - "mod-2/target/site/cpd.html", - "mod-2/target/site/cpd.xml", - "mod-3/target/site/pmd.html", - "mod-3/target/site/pmd.xml", - "mod-3/target/site/cpd.html", - "mod-3/target/site/cpd.xml", -}; - -for ( String path : expectedPaths ) -{ - File file = new File( basedir, path ); - System.out.println( "Checking for existence of " + file ); - if ( !file.isFile() ) - { - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); - } -} - -String[] unexpectedPaths = +String[] modules = { "mod-1", "mod-2", "mod-3" }; +String[] paths = { "target/site/pmd.html", "target/site/pmd.xml", @@ -37,7 +14,23 @@ String[] unexpectedPaths = "target/cpd.xml", }; -for ( String path : unexpectedPaths ) +// files must exist in every module +for ( String module : modules ) +{ + // PMD and CPD reports + for ( String path : paths ) + { + File file = new File( basedir, module + '/' + path ); + System.out.println( "Checking for existence of " + file ); + if ( !file.isFile() ) + { + throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); + } + } +} + +// files must not exist in parent +for ( String path : paths ) { File file = new File( basedir, path ); System.out.println( "Checking for absence of " + file ); @@ -47,4 +40,20 @@ for ( String path : unexpectedPaths ) } } + +// check PMD rulesets target copy +File rule = new File( basedir, "mod-1/target/latin-1.xml" ); +String nonascii = "-CHARS: \u00C4\u00D6\u00DC\u00E4\u00F6\u00FC\u00DF\u00BC\u00BD\u00BE\u00A4"; +String content = FileUtils.fileRead( rule, "ISO-8859-1" ); +if ( content.indexOf( nonascii ) < 0 ) +{ + throw new IOException( "non-ascii content corrupted in Latin1." ); +} +rule = new File( basedir, "mod-1/target/utf-8.xml" ); +content = FileUtils.fileRead( rule, "UTF-8" ); +if ( content.indexOf( nonascii ) < 0 ) +{ + throw new IOException( "non-ascii content corrupted in UTF-8." ); +} + return true;