You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ad...@apache.org on 2016/02/10 20:29:54 UTC

svn commit: r1729695 - in /maven/plugins/trunk/maven-pmd-plugin/src: it/MPMD-219-pmd-processing-error/ it/MPMD-219-pmd-processing-error/src/ it/MPMD-219-pmd-processing-error/src/main/ it/MPMD-219-pmd-processing-error/src/main/java/ main/java/org/apache...

Author: adangel
Date: Wed Feb 10 19:29:54 2016
New Revision: 1729695

URL: http://svn.apache.org/viewvc?rev=1729695&view=rev
Log:
[MPMD-219] PMD processing errors should fail build (skipPmdError=false)
This commit adds a "PmdCollectingRenderer" and uses it instead of
the report listener, as listeners are unfortunately not informed about
errors.
If the "skipPmdError" property is true (default),
then these processing errors are logged as warnings.
closes apache/maven-plugins#80

Added:
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/invoker.properties
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/pom.xml
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/src/
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/src/main/
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/src/main/java/
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/src/main/java/BrokenFile.java
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/verify.groovy
    maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdCollectingRenderer.java
    maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/
    maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/pmd-processing-error-plugin-config.xml
    maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/src/
    maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/src/BrokenFile.java
Removed:
    maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReportListener.java
Modified:
    maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java
    maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdReportTest.java

Added: maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/invoker.properties?rev=1729695&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/invoker.properties (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/invoker.properties Wed Feb 10 19:29:54 2016
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals = clean pmd:check
+invoker.buildResult = failure
+invoker.maven.version = 3+

Added: maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/pom.xml?rev=1729695&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/pom.xml (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/pom.xml Wed Feb 10 19:29:54 2016
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugin.pmd.it</groupId>
+  <artifactId>MPMD-219-pmd-processing-error</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+  </dependencies>
+
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>@project.groupId@</groupId>
+        <artifactId>@project.artifactId@</artifactId>
+        <version>@project.version@</version>
+        <configuration>
+          <skipPmdError>false</skipPmdError>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>test-compile</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/src/main/java/BrokenFile.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/src/main/java/BrokenFile.java?rev=1729695&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/src/main/java/BrokenFile.java (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/src/main/java/BrokenFile.java Wed Feb 10 19:29:54 2016
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class BrokenFile
+{
+
+    // This file has a parse error, so PMD will fail to parse it
+    broken!!
+
+}

Added: maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/verify.groovy?rev=1729695&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/verify.groovy (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-219-pmd-processing-error/verify.groovy Wed Feb 10 19:29:54 2016
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+File buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
+assert buildLog.text.contains( "PMD processing errors" )
+assert buildLog.text.contains( "Error while parsing" )
+assert buildLog.text.contains( "BrokenFile.java" )

Added: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdCollectingRenderer.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdCollectingRenderer.java?rev=1729695&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdCollectingRenderer.java (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdCollectingRenderer.java Wed Feb 10 19:29:54 2016
@@ -0,0 +1,152 @@
+package org.apache.maven.plugin.pmd;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import net.sourceforge.pmd.Report;
+import net.sourceforge.pmd.Report.ProcessingError;
+import net.sourceforge.pmd.RuleViolation;
+import net.sourceforge.pmd.renderers.AbstractRenderer;
+import net.sourceforge.pmd.util.datasource.DataSource;
+
+import org.codehaus.plexus.util.StringUtils;
+
+
+/**
+ * A PMD renderer, that collects all violations and processing errors
+ * from a pmd execution.
+ * 
+ * @author Andreas Dangel
+ */
+public class PmdCollectingRenderer extends AbstractRenderer
+{
+    private List<ProcessingError> errors = Collections.synchronizedList( new ArrayList<ProcessingError>() );
+    private List<RuleViolation> violations = Collections.synchronizedList( new ArrayList<RuleViolation>() );
+
+    /**
+     * Collects all reports from all threads.
+     */
+    public PmdCollectingRenderer()
+    {
+        super( PmdCollectingRenderer.class.getSimpleName(), "Collects all reports from all threads" );
+    }
+
+    @Override
+    public void renderFileReport( Report report ) throws IOException
+    {
+        for ( RuleViolation v : report )
+        {
+            violations.add( v );
+        }
+        for ( Iterator<ProcessingError> it = report.errors(); it.hasNext(); )
+        {
+            errors.add( it.next() );
+        }
+    }
+
+    /**
+     * Checks whether any violations have been found.
+     * @return <code>true</code> if at least one violations has been found
+     */
+    public boolean hasViolations()
+    {
+        return !violations.isEmpty();
+    }
+
+    /**
+     * Gets the list of all found violations.
+     * @return the violations
+     */
+    public List<RuleViolation> getViolations()
+    {
+        return violations;
+    }
+
+    /**
+     * Checks whether any processing errors have been found.
+     * @return <code>true</code> if any errors have been found
+     */
+    public boolean hasErrors()
+    {
+        return !errors.isEmpty();
+    }
+
+    /**
+     * Gets all the processing errors.
+     * @return the errors
+     */
+    public List<ProcessingError> getErrors()
+    {
+        return errors;
+    }
+
+    /**
+     * Gets the errors as a single string. Each error is in its own line.
+     * @return the errors as string
+     */
+    public String getErrorsAsString()
+    {
+        List<String> errorsAsString = new ArrayList<String>( errors.size() );
+        for ( ProcessingError error : errors )
+        {
+            errorsAsString.add( error.getFile() + ": " + error.getMsg() );
+        }
+        return StringUtils.join( errorsAsString.toArray(), System.getProperty( "line.separator" ) );
+    }
+
+    /**
+     * Create a new single report with all violations for further rendering into other formats than HTML.
+     * @return the report
+     */
+    public Report asReport()
+    {
+        Report report = new Report();
+        for ( RuleViolation v : violations )
+        {
+            report.addRuleViolation( v );
+        }
+        return report;
+    }
+
+
+    // stubs need to fulfill the Renderer interface
+    @Override
+    public String defaultFileExtension()
+    {
+        return null;
+    }
+    @Override
+    public void start() throws IOException
+    {
+    }
+    @Override
+    public void startFileAnalysis( DataSource dataSource )
+    {
+    }
+    @Override
+    public void end() throws IOException
+    {
+    }
+}

Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java?rev=1729695&r1=1729694&r2=1729695&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java Wed Feb 10 19:29:54 2016
@@ -27,7 +27,7 @@ import java.io.OutputStreamWriter;
 import java.io.PrintStream;
 import java.io.Writer;
 import java.util.ArrayList;
-import java.util.Collections;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
 import java.util.Properties;
@@ -162,8 +162,8 @@ public class PmdReport
     @Component
     private ResourceManager locator;
 
-    /** The PMD report listener for collecting violations. */
-    private PmdReportListener reportListener;
+    /** The PMD renderer for collecting violations. */
+    private PmdCollectingRenderer renderer;
 
     /**
      * per default pmd executions error are ignored to not break the whole
@@ -254,7 +254,7 @@ public class PmdReport
                 executePmdWithClassloader();
                 if ( skipEmptyReport )
                 {
-                    result = reportListener.hasViolations();
+                    result = renderer.hasViolations();
                     if ( result )
                     {
                         getLog().debug( "Skipping report since skipEmptyReport is true and"
@@ -288,7 +288,7 @@ public class PmdReport
     private void executePmd()
         throws MavenReportException
     {
-        if ( reportListener != null )
+        if ( renderer != null )
         {
             // PMD has already been run
             getLog().debug( "PMD has already been run - skipping redundant execution." );
@@ -300,10 +300,9 @@ public class PmdReport
         locator.addSearchPath( "url", "" );
         locator.setOutputDirectory( targetDirectory );
 
-        reportListener = new PmdReportListener();
+        renderer = new PmdCollectingRenderer();
         PMDConfiguration pmdConfiguration = getPMDConfiguration();
         RuleContext ruleContext = new RuleContext();
-        ruleContext.getReport().addListener( reportListener );
 
         RuleSetFactory ruleSetFactory = new RuleSetFactory();
         ruleSetFactory.setMinimumPriority( RulePriority.valueOf( this.minimumPriority ) );
@@ -373,13 +372,12 @@ public class PmdReport
         try
         {
             getLog().debug( "Executing PMD..." );
-
             PMD.processFiles( pmdConfiguration, ruleSetFactory, dataSources, ruleContext,
-                              Collections.<Renderer>emptyList() );
+                              Arrays.<Renderer>asList( renderer ) );
 
             if ( getLog().isDebugEnabled() )
             {
-                getLog().debug( "PMD finished. Found " + reportListener.getViolations().size() + " violations." );
+                getLog().debug( "PMD finished. Found " + renderer.getViolations().size() + " violations." );
             }
         }
         catch ( Exception e )
@@ -392,11 +390,23 @@ public class PmdReport
             getLog().warn( message, e );
         }
 
+        if ( renderer.hasErrors() )
+        {
+            if ( !skipPmdError )
+            {
+                getLog().error( "PMD processing errors:" );
+                getLog().error( renderer.getErrorsAsString() );
+                throw new MavenReportException( "Found " + renderer.getErrors().size() + " PMD processing errors" );
+            }
+            getLog().warn( "There are " + renderer.getErrors().size() + " PMD processing errors:" );
+            getLog().warn( renderer.getErrorsAsString() );
+        }
+
         // if format is XML, we need to output it even if the file list is empty or we have no violations
         // so the "check" goals can check for violations
-        if ( isXml() && reportListener != null )
+        if ( isXml() && renderer != null )
         {
-            writeNonHtml( reportListener.asReport() );
+            writeNonHtml( renderer.asReport() );
         }
 
         if ( benchmark )
@@ -425,22 +435,22 @@ public class PmdReport
         throws MavenReportException
     {
         Sink sink = getSink();
-        PmdReportGenerator renderer = new PmdReportGenerator( getLog(), sink, getBundle( locale ), aggregate );
-        renderer.setFiles( filesToProcess );
-        renderer.setViolations( reportListener.getViolations() );
+        PmdReportGenerator doxiaRenderer = new PmdReportGenerator( getLog(), sink, getBundle( locale ), aggregate );
+        doxiaRenderer.setFiles( filesToProcess );
+        doxiaRenderer.setViolations( renderer.getViolations() );
 
         try
         {
-            renderer.beginDocument();
-            renderer.render();
-            renderer.endDocument();
+            doxiaRenderer.beginDocument();
+            doxiaRenderer.render();
+            doxiaRenderer.endDocument();
         }
         catch ( IOException e )
         {
             getLog().warn( "Failure creating the report: " + e.getLocalizedMessage(), e );
         }
 
-        return reportListener.asReport();
+        return renderer.asReport();
     }
 
     /**

Modified: maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdReportTest.java?rev=1729695&r1=1729694&r2=1729695&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdReportTest.java (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdReportTest.java Wed Feb 10 19:29:54 2016
@@ -428,5 +428,17 @@ public class PmdReportTest
         assertTrue(str.contains("Avoid having style information in JSP files."));
     }
 
-
+    public void testPMDProcessingError()
+            throws Exception
+    {
+        File testPom = new File( getBasedir(),
+                "src/test/resources/unit/processing-error/pmd-processing-error-plugin-config.xml" );
+        PmdReport mojo = (PmdReport) lookupMojo( "pmd", testPom );
+        try {
+            mojo.execute();
+            fail("Expected exception");
+        } catch (RuntimeException e) {
+            assertTrue( e.getMessage().endsWith( "Found 1 PMD processing errors" ) );
+        }
+    }
 }

Added: maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/pmd-processing-error-plugin-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/pmd-processing-error-plugin-config.xml?rev=1729695&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/pmd-processing-error-plugin-config.xml (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/pmd-processing-error-plugin-config.xml Wed Feb 10 19:29:54 2016
@@ -0,0 +1,49 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>parse.error.configuration</groupId>
+  <artifactId>parse-error-configuration</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <inceptionYear>2006</inceptionYear>
+  <name>Maven PMD Plugin Parse Error Test</name>
+  <url>http://maven.apache.org</url>
+  <build>
+    <finalName>parse-error</finalName>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <configuration>
+          <project implementation="org.apache.maven.plugin.pmd.stubs.DefaultConfigurationMavenProjectStub"/>
+          <outputDirectory>${basedir}/target/test/unit/parse-error/target/site</outputDirectory>
+          <targetDirectory>${basedir}/target/test/unit/parse-error/target</targetDirectory>
+          <format>xml</format>
+          <sourceEncoding>UTF-8</sourceEncoding>
+          <skipPmdError>false</skipPmdError>
+          <compileSourceRoots>
+            <compileSourceRoot>${basedir}/src/test/resources/unit/processing-error/src</compileSourceRoot>
+          </compileSourceRoots>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/src/BrokenFile.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/src/BrokenFile.java?rev=1729695&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/src/BrokenFile.java (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/test/resources/unit/processing-error/src/BrokenFile.java Wed Feb 10 19:29:54 2016
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class BrokenFile {
+
+    // This file has a parse error, so PMD will fail to parse it
+    broken!!
+
+}