maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dant...@apache.org
Subject svn commit: r1653350 [2/2] - in /maven/plugins/trunk/maven-pmd-plugin/src: it/empty-rulesets/src/main/java/com/mycompany/app/ it/mpmd-138/mod-3/ it/mpmd-138/mod-4/ it/mpmd-142/ it/mpmd-168-empty-report/ it/mpmd-168/ it/mpmd-89/ main/java/org/apache/mav...
Date Tue, 20 Jan 2015 19:54:04 GMT
Modified: maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdViolationCheckMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdViolationCheckMojoTest.java?rev=1653350&r1=1653349&r2=1653350&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdViolationCheckMojoTest.java
(original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdViolationCheckMojoTest.java
Tue Jan 20 19:54:03 2015
@@ -19,11 +19,11 @@ package org.apache.maven.plugin.pmd;
  * under the License.
  */
 
+import java.io.File;
+
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
 
-import java.io.File;
-
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
  * @version $Id$
@@ -46,8 +46,9 @@ public class PmdViolationCheckMojoTest
     {
         try
         {
-            final File testPom = new File( getBasedir(),
-                                     "src/test/resources/unit/default-configuration/pmd-check-default-configuration-plugin-config.xml"
);
+            final File testPom =
+                new File( getBasedir(),
+                          "src/test/resources/unit/default-configuration/pmd-check-default-configuration-plugin-config.xml"
);
             final PmdViolationCheckMojo mojo = (PmdViolationCheckMojo) lookupMojo( "check",
testPom );
             mojo.execute();
 
@@ -62,13 +63,15 @@ public class PmdViolationCheckMojoTest
     public void testNotFailOnViolation()
         throws Exception
     {
-        File testPom = new File( getBasedir(),
-                                 "src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"
);
+        File testPom =
+            new File( getBasedir(),
+                      "src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"
);
         final PmdReport mojo = (PmdReport) lookupMojo( "pmd", testPom );
         mojo.execute();
 
-        testPom = new File( getBasedir(),
-                            "src/test/resources/unit/default-configuration/pmd-check-notfailonviolation-plugin-config.xml"
);
+        testPom =
+            new File( getBasedir(),
+                      "src/test/resources/unit/default-configuration/pmd-check-notfailonviolation-plugin-config.xml"
);
         final PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo(
"check", testPom );
         pmdViolationMojo.execute();
 
@@ -78,18 +81,21 @@ public class PmdViolationCheckMojoTest
     public void testFailurePriority()
         throws Exception
     {
-        File testPom = new File( getBasedir(),
-                                 "src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"
);
+        File testPom =
+            new File( getBasedir(),
+                      "src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"
);
         final PmdReport mojo = (PmdReport) lookupMojo( "pmd", testPom );
         mojo.execute();
 
-        testPom = new File( getBasedir(),
-                            "src/test/resources/unit/default-configuration/pmd-check-failonpriority-plugin-config.xml"
);
+        testPom =
+            new File( getBasedir(),
+                      "src/test/resources/unit/default-configuration/pmd-check-failonpriority-plugin-config.xml"
);
         PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo( "check",
testPom );
         pmdViolationMojo.execute();
 
-        testPom = new File( getBasedir(),
-                            "src/test/resources/unit/default-configuration/pmd-check-failandwarnonpriority-plugin-config.xml"
);
+        testPom =
+            new File( getBasedir(),
+                      "src/test/resources/unit/default-configuration/pmd-check-failandwarnonpriority-plugin-config.xml"
);
         pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo( "check", testPom );
         try
         {
@@ -99,13 +105,15 @@ public class PmdViolationCheckMojoTest
         catch ( final MojoFailureException e )
         {
             String message = e.getMessage();
-            if ( message.contains( "You have 5 PMD violations and 3 warnings." ) ) {
+            if ( message.contains( "You have 5 PMD violations and 3 warnings." ) )
+            {
                 System.out.println( "Caught expected message: " + e.getMessage() );// expected
-            } 
+            }
             else
             {
-                throw new AssertionError( "Expected: '" + message + "' to contain 'You have
5 PMD violations and 3 warnings.'" );
-            }                        
+                throw new AssertionError( "Expected: '" + message
+                    + "' to contain 'You have 5 PMD violations and 3 warnings.'" );
+            }
         }
 
     }
@@ -115,8 +123,9 @@ public class PmdViolationCheckMojoTest
     {
         try
         {
-            final File testPom = new File( getBasedir(),
-                                           "src/test/resources/unit/custom-configuration/pmd-check-exception-test-plugin-config.xml"
);
+            final File testPom =
+                new File( getBasedir(),
+                          "src/test/resources/unit/custom-configuration/pmd-check-exception-test-plugin-config.xml"
);
             final PmdViolationCheckMojo mojo = (PmdViolationCheckMojo) lookupMojo( "check",
testPom );
             mojo.execute();
 
@@ -132,13 +141,15 @@ public class PmdViolationCheckMojoTest
     public void testViolationExclusion()
         throws Exception
     {
-        File testPom = new File( getBasedir(),
-                                 "src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"
);
+        File testPom =
+            new File( getBasedir(),
+                      "src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"
);
         final PmdReport mojo = (PmdReport) lookupMojo( "pmd", testPom );
         mojo.execute();
 
-        testPom = new File( getBasedir(),
-                            "src/test/resources/unit/default-configuration/pmd-check-pmd-exclusions-configuration-plugin-config.xml"
);
+        testPom =
+            new File( getBasedir(),
+                      "src/test/resources/unit/default-configuration/pmd-check-pmd-exclusions-configuration-plugin-config.xml"
);
         final PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo(
"check", testPom );
         pmdViolationMojo.execute();
 

Modified: maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/CustomConfigurationMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/CustomConfigurationMavenProjectStub.java?rev=1653350&r1=1653349&r2=1653350&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/CustomConfigurationMavenProjectStub.java
(original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/CustomConfigurationMavenProjectStub.java
Tue Jan 20 19:54:03 2015
@@ -19,6 +19,11 @@ package org.apache.maven.plugin.pmd.stub
  * under the License.
  */
 
+import java.io.File;
+import java.io.FileReader;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Model;
@@ -27,11 +32,6 @@ import org.apache.maven.model.Scm;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
-import java.io.File;
-import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
  * @version $Id$
@@ -50,8 +50,9 @@ public class CustomConfigurationMavenPro
 
         try
         {
-            model = pomReader.read( new FileReader( new File( getBasedir() +
-                "/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml"
) ) );
+            model =
+                pomReader.read( new FileReader( new File( getBasedir()
+                    + "/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml"
) ) );
             setModel( model );
         }
         catch ( Exception e )
@@ -87,7 +88,7 @@ public class CustomConfigurationMavenPro
         artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
         setArtifact( artifact );
 
-        setFile(new File(getBasedir().getAbsolutePath() + "/pom.xml"));
+        setFile( new File( getBasedir().getAbsolutePath() + "/pom.xml" ) );
     }
 
     /** {@inheritDoc} */

Modified: maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/DefaultConfigurationMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/DefaultConfigurationMavenProjectStub.java?rev=1653350&r1=1653349&r2=1653350&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/DefaultConfigurationMavenProjectStub.java
(original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/DefaultConfigurationMavenProjectStub.java
Tue Jan 20 19:54:03 2015
@@ -19,6 +19,11 @@ package org.apache.maven.plugin.pmd.stub
  * under the License.
  */
 
+import java.io.File;
+import java.io.FileReader;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Model;
@@ -27,11 +32,6 @@ import org.apache.maven.model.Scm;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
-import java.io.File;
-import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
  * @version $Id$
@@ -50,8 +50,9 @@ public class DefaultConfigurationMavenPr
 
         try
         {
-            model = pomReader.read( new FileReader( new File( getBasedir() +
-                "/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"
) ) );
+            model =
+                pomReader.read( new FileReader( new File( getBasedir()
+                    + "/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"
) ) );
             setModel( model );
         }
         catch ( Exception e )
@@ -83,8 +84,8 @@ public class DefaultConfigurationMavenPr
         compileSourceRoots.add( basedir + "/src/test/resources/unit/default-configuration/def/configuration"
);
         setCompileSourceRoots( compileSourceRoots );
 
-        File file = new File(getBasedir().getAbsolutePath() + "/pom.xml");
-        setFile(file);
+        File file = new File( getBasedir().getAbsolutePath() + "/pom.xml" );
+        setFile( file );
 
         Artifact artifact = new PmdPluginArtifactStub( getGroupId(), getArtifactId(), getVersion(),
getPackaging() );
         artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );

Modified: maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/InvalidFormatMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/InvalidFormatMavenProjectStub.java?rev=1653350&r1=1653349&r2=1653350&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/InvalidFormatMavenProjectStub.java
(original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/InvalidFormatMavenProjectStub.java
Tue Jan 20 19:54:03 2015
@@ -19,6 +19,11 @@ package org.apache.maven.plugin.pmd.stub
  * under the License.
  */
 
+import java.io.File;
+import java.io.FileReader;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Model;
@@ -26,11 +31,6 @@ import org.apache.maven.model.Scm;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
-import java.io.File;
-import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
  * @version $Id$
@@ -47,8 +47,9 @@ public class InvalidFormatMavenProjectSt
 
         try
         {
-            model = pomReader.read( new FileReader( new File(
-                getBasedir() + "/src/test/resources/unit/invalid-format/invalid-format-plugin-config.xml"
) ) );
+            model =
+                pomReader.read( new FileReader( new File( getBasedir()
+                    + "/src/test/resources/unit/invalid-format/invalid-format-plugin-config.xml"
) ) );
             setModel( model );
         }
         catch ( Exception e )
@@ -82,7 +83,7 @@ public class InvalidFormatMavenProjectSt
         artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
         setArtifact( artifact );
 
-        setFile(new File(getBasedir().getAbsolutePath() + "/pom.xml"));
+        setFile( new File( getBasedir().getAbsolutePath() + "/pom.xml" ) );
 
     }
 
@@ -99,5 +100,5 @@ public class InvalidFormatMavenProjectSt
     {
         return build;
     }
-    
+
 }



Mime
View raw message