[maven-plugin-testing-1.3] 04/10: New upstream version 2.1

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Thu Jul 20 10:29:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to annotated tag debian/2.1-1
in repository maven-plugin-testing-1.3.

commit 54988969b5ee1926565c3da3a297e7b214108632
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Tue Jul 18 00:05:42 2017 +0200

    New upstream version 2.1
---
 maven-plugin-testing-harness/pom.xml               | 10 +++----
 .../maven/plugin/testing/AbstractMojoTestCase.java | 31 ++++++++++++++++++-
 .../src/site/apt/examples/artifact.apt             | 21 ++++++-------
 .../site/apt/examples/complex-mojo-parameters.apt  | 35 ++++++++--------------
 .../src/site/apt/examples/multiproject.apt         | 35 +++++++++++++++-------
 .../src/site/apt/examples/repositories.apt         | 23 ++++++--------
 .../src/site/apt/getting-started/index.apt         | 29 +++++++++---------
 .../maven/plugin/testing/MojoTestCaseTest.java     |  4 +--
 maven-plugin-testing-tools/pom.xml                 | 10 +++----
 .../apache/maven/shared/test/plugin/BuildTool.java | 10 +++----
 .../maven/shared/test/plugin/ProjectTool.java      | 10 +++----
 .../maven/shared/test/plugin/ProjectToolTest.java  |  8 ++---
 maven-test-tools/pom.xml                           | 12 ++++----
 .../maven/shared/tools/easymock/MockManager.java   | 13 +++-----
 .../shared/tools/easymock/TestFileManager.java     |  8 ++---
 .../maven/shared/tools/test/ReflectiveSetter.java  | 15 +++-------
 pom.xml                                            | 17 +++++++----
 17 files changed, 155 insertions(+), 136 deletions(-)

diff --git a/maven-plugin-testing-harness/pom.xml b/maven-plugin-testing-harness/pom.xml
index d8ae5d7..c84c9ee 100644
--- a/maven-plugin-testing-harness/pom.xml
+++ b/maven-plugin-testing-harness/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven.plugin-testing</groupId>
     <artifactId>maven-plugin-testing</artifactId>
-    <version>2.0</version>
+    <version>2.1</version>
   </parent>
 
   <artifactId>maven-plugin-testing-harness</artifactId>
@@ -33,9 +33,9 @@ under the License.
   <description>The Maven Plugin Testing Harness provides mechanisms to manage tests on Mojo.</description>
 
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.0/maven-plugin-testing-harness</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.0/maven-plugin-testing-harness</developerConnection>
-    <url>http://svn.apache.org/viewvc/maven/plugin-testing/tags/maven-plugin-testing-2.0/maven-plugin-testing-harness</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.1/maven-plugin-testing-harness</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.1/maven-plugin-testing-harness</developerConnection>
+    <url>http://svn.apache.org/viewvc/maven/plugin-testing/tags/maven-plugin-testing-2.1/maven-plugin-testing-harness</url>
   </scm>
 
   <dependencies>
@@ -69,7 +69,7 @@ under the License.
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-archiver</artifactId>
-      <version>1.0-alpha-7</version>
+      <version>2.2</version>
     </dependency>
   </dependencies>
 
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java
index ddafcb2..dec1a81 100644
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java
+++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java
@@ -83,7 +83,7 @@ import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
  * descriptor and make this entirely declarative!
  *
  * @author jesse
- * @version $Id: AbstractMojoTestCase.java 1340746 2012-05-20 14:52:12Z hboutemy $
+ * @version $Id: AbstractMojoTestCase.java 1345446 2012-06-02 05:52:30Z hboutemy $
  */
 public abstract class AbstractMojoTestCase
     extends PlexusTestCase
@@ -310,12 +310,29 @@ public abstract class AbstractMojoTestCase
         return mojo;
     }
 
+    /**
+     * 
+     * @param project
+     * @param goal
+     * @return
+     * @throws Exception
+     * @since 2.0
+     */
     protected Mojo lookupConfiguredMojo( MavenProject project, String goal )
         throws Exception
     {
         return lookupConfiguredMojo( newMavenSession( project ), newMojoExecution( goal ) );
     }
 
+    /**
+     * 
+     * @param session
+     * @param execution
+     * @return
+     * @throws Exception
+     * @throws ComponentConfigurationException
+     * @since 2.0
+     */
     protected Mojo lookupConfiguredMojo( MavenSession session, MojoExecution execution )
         throws Exception, ComponentConfigurationException
     {
@@ -345,6 +362,12 @@ public abstract class AbstractMojoTestCase
         return mojo;
     }
 
+    /**
+     * 
+     * @param project
+     * @return
+     * @since 2.0
+     */
     protected MavenSession newMavenSession( MavenProject project )
     {
         MavenExecutionRequest request = new DefaultMavenExecutionRequest();
@@ -356,6 +379,12 @@ public abstract class AbstractMojoTestCase
         return session;
     }
 
+    /**
+     * 
+     * @param goal
+     * @return
+     * @since 2.0
+     */
     protected MojoExecution newMojoExecution( String goal )
     {
         MojoDescriptor mojoDescriptor = mojoDescriptors.get( goal );
diff --git a/maven-plugin-testing-harness/src/site/apt/examples/artifact.apt b/maven-plugin-testing-harness/src/site/apt/examples/artifact.apt
index c5aa970..8bab33f 100644
--- a/maven-plugin-testing-harness/src/site/apt/examples/artifact.apt
+++ b/maven-plugin-testing-harness/src/site/apt/examples/artifact.apt
@@ -30,17 +30,14 @@ Testing Project Artifact
  Sometimes, your Mojo uses project artifact and ArtifactHandler mechanisms. For instance, you could need to
  filter on Java projects, i.e.:
 
------
++---+
 public class MyMojo
     extends AbstractMojo
 {
     /**
      * The Maven Project.
-     *
-     * @parameter expression="${project}"
-     * @required
-     * @readonly
      */
+    @Component
     protected MavenProject project;
 
     public void execute()
@@ -57,11 +54,11 @@ public class MyMojo
         ...
      }
 }
------
++---+
 
 * Create Stubs
 
------
++---+
 public class MyArtifactHandlerStub
     extends DefaultArtifactHandler
 {
@@ -82,9 +79,9 @@ public class MyArtifactHandlerStub
         this.language = language;
     }
 }
------
++---+
 
------
++---+
 public class MyArtifactStub
     extends ArtifactStub
 {
@@ -192,9 +189,9 @@ public class MyArtifactStub
         this.handler = handler;
     }
 }
------
++---+
 
------
++---+
 public class MyProjectStub
     extends MavenProjectStub
 {
@@ -215,4 +212,4 @@ public class MyProjectStub
 
     ...
 }
------
++---+
diff --git a/maven-plugin-testing-harness/src/site/apt/examples/complex-mojo-parameters.apt b/maven-plugin-testing-harness/src/site/apt/examples/complex-mojo-parameters.apt
index 7a9caf9..a0761c2 100644
--- a/maven-plugin-testing-harness/src/site/apt/examples/complex-mojo-parameters.apt
+++ b/maven-plugin-testing-harness/src/site/apt/examples/complex-mojo-parameters.apt
@@ -32,7 +32,7 @@ Testing Complex Mojo Parameters
 
  Suppose that you have the following dependencies in the maven-my-plugin pom:
 
------
++---+
 <project>
   ...
   <dependencies>
@@ -49,51 +49,42 @@ Testing Complex Mojo Parameters
     ...
   </dependencies>
 </project>
------
++---+
 
  You will add the following in the <<<MyMojo>>>:
 
------
++---+
 public class MyMojo
     extends AbstractMojo
 {
     /**
      * The Maven Project.
-     *
-     * @parameter expression="${project}"
-     * @required
-     * @readonly
      */
+    @Component
     protected MavenProject project;
 
     /**
      * Local Repository.
-     *
-     * @parameter expression="${localRepository}"
-     * @required
-     * @readonly
      */
+    @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
     protected ArtifactRepository localRepository;
 
     /**
      * The Maven Settings.
-     *
-     * @parameter default-value="${settings}"
-     * @required
-     * @readonly
      */
+    @Component
     private Settings settings;
 
     ...
 }
------
++---+
 
 * Create Stubs
 
   You need to create stub objects to run <<<MyMojoTest#testSomething()>>>. By convention, the package name should
   reflect the stubs, i.e. in our case <<<org.apache.maven.plugin.my.stubs>>>.
 
------
++---+
 public class MyProjectStub
     extends MavenProjectStub
 {
@@ -145,9 +136,9 @@ public class MyProjectStub
         return new File( super.getBasedir() + "/src/test/resources/unit/project-to-test/" );
     }
 }
------
++---+
 
------
++---+
 public class SettingsStub
     extends Settings
 {
@@ -157,11 +148,11 @@ public class SettingsStub
         return Collections.EMPTY_LIST;
     }
 }
------
++---+
 
 * Configure <<<project-to-test>>> pom
 
------
++---+
 <project>
   ...
   <build>
@@ -183,4 +174,4 @@ public class SettingsStub
     </plugins>
   </build>
 </project>
------
++---+
diff --git a/maven-plugin-testing-harness/src/site/apt/examples/multiproject.apt b/maven-plugin-testing-harness/src/site/apt/examples/multiproject.apt
index 1564723..e010348 100644
--- a/maven-plugin-testing-harness/src/site/apt/examples/multiproject.apt
+++ b/maven-plugin-testing-harness/src/site/apt/examples/multiproject.apt
@@ -29,7 +29,20 @@ Testing Multiproject
 
  Your Mojo should have <<<@aggregator>>> parameter, i.e.:
 
-------
+ * with java annotations ({{{/plugin-tools/}maven-plugin-plugin 3.x}}):
+
++----+
+ at Mojo( name = "touch", aggregator = true )
+public class MyMojo
+    extends AbstractMojo
+{
+  ...
+}
++----+
+
+ * or with javadoc tags:
+
++----+
 /**
  * @goal touch
  * @aggregator
@@ -39,7 +52,9 @@ public class MyMojo
 {
   ...
 }
-------
++----+
+
+ []
 
  To test a Mojo in a multiproject area, you need to define several stubs, i.e. for the main test project and its modules.
 
@@ -47,7 +62,7 @@ public class MyMojo
 
  Stub for the main test project:
 
------
++----+
 public class MyProjectStub
     extends MavenProjectStub
 {
@@ -67,11 +82,11 @@ public class MyProjectStub
         return this;
     }
 }
------
++----+
 
  Stubs for the subprojects:
 
------
++----+
 public class SubProject1Stub
     extends MavenProjectStub
 {
@@ -83,9 +98,9 @@ public class SubProject1Stub
         ...
     }
 }
------
++----+
 
------
++----+
 public class SubProject2Stub
     extends MavenProjectStub
 {
@@ -97,11 +112,11 @@ public class SubProject2Stub
         ...
     }
 }
------
++----+
 
 * Configure <<<project-to-test>>> pom
 
------
++----+
 <project>
   ...
   <build>
@@ -120,4 +135,4 @@ public class SubProject2Stub
     </plugins>
   </build>
 </project>
------
++----+
diff --git a/maven-plugin-testing-harness/src/site/apt/examples/repositories.apt b/maven-plugin-testing-harness/src/site/apt/examples/repositories.apt
index b3b7388..6a86ebc 100644
--- a/maven-plugin-testing-harness/src/site/apt/examples/repositories.apt
+++ b/maven-plugin-testing-harness/src/site/apt/examples/repositories.apt
@@ -30,31 +30,26 @@ Testing Using Repositories
  When developing a Maven plugin you often need to play with repositories. Suppose that the MyMojo needs
  to download artifacts into your local repository, i.e.:
 
------
++----+
 public class MyMojo
     extends AbstractMojo
 {
     /**
      * Used for resolving artifacts
-     *
-     * @component
      */
+    @Component
     private ArtifactResolver resolver;
 
     /**
      * Factory for creating artifact objects
-     *
-     * @component
      */
+    @Component
     private ArtifactFactory factory;
 
     /**
      * Local Repository.
-     *
-     * @parameter expression="${localRepository}"
-     * @required
-     * @readonly
      */
+    @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
     private ArtifactRepository localRepository;
 
     public void execute()
@@ -79,13 +74,13 @@ public class MyMojo
         ...
      }
 }
------
++----+
 
 * Create Stubs
 
  Stub for the test project:
 
------
++----+
 public class MyProjectStub
     extends MavenProjectStub
 {
@@ -106,11 +101,11 @@ public class MyProjectStub
         return Collections.singletonList( repository );
     }
 }
------
++----+
 
 * Configure <<<project-to-test>>> pom
 
------
++----+
 <project>
   ...
   <build>
@@ -131,7 +126,7 @@ public class MyProjectStub
     </plugins>
   </build>
 </project>
------
++----+
 
 ** Execute test
 
diff --git a/maven-plugin-testing-harness/src/site/apt/getting-started/index.apt b/maven-plugin-testing-harness/src/site/apt/getting-started/index.apt
index 9646298..a1cc2c0 100644
--- a/maven-plugin-testing-harness/src/site/apt/getting-started/index.apt
+++ b/maven-plugin-testing-harness/src/site/apt/getting-started/index.apt
@@ -33,16 +33,16 @@ Cookbook: How To Use Maven Plugin Testing Harness?
  We assume that you have already created a plugin. In this cookbook, we make reference to <<<MyMojo>>> in
  <<<maven-my-plugin>>> which is generated by the Maven Archetype Plugin, i.e.:
 
------
++---+
 mvn archetype:create \
   -DgroupId=org.apache.maven.plugin.my \
   -DartifactId=maven-my-plugin \
   -DarchetypeArtifactId=maven-archetype-mojo
------
++---+
 
  The generated structure should be:
 
------
++---+
 maven-my-plugin
   |- pom.xml
   +- src/
@@ -54,7 +54,7 @@ maven-my-plugin
               +- plugin/
                 +- my/
                   |- MyMojo.java
------
++---+
 
 * Recipe
 
@@ -62,7 +62,7 @@ maven-my-plugin
 
  As usual, just add <<<maven-plugin-testing-harness>>> as following in your pom. Be sure to specify <<<test>>> scope.
 
------
++---+
 <project>
   ...
   <dependencies>
@@ -75,14 +75,16 @@ maven-my-plugin
   </dependencies>
   ...
 </project>
------
++---+
 
 ** Create a <<<MyMojoTest>>>
 
  Create a <<<MyMojoTest>>> (by convention) class in <<<src/test/java/org/apache/maven/plugin/my>>> directory.
  This class should extend <<<AbstractMojoTestCase>>> from <<<maven-plugin-testing-harness>>>.
 
------
++---+
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+
 public class MyMojoTest
     extends AbstractMojoTestCase
 {
@@ -123,7 +125,7 @@ public class MyMojoTest
         ...
     }
 }
------
++---+
 
   In this case, <<<testSomething()>>> will test <<<MyMojo>>> against a Maven project called <<<project-to-test>>>.
 
@@ -133,11 +135,10 @@ public class MyMojoTest
 
   Just create a pom as usual. The names for groupId and artifactId don't really matter since this project will not be deployed.
 
------
++---+
 <project xmlns="http://maven.apache.org/POM/4.0.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-                      http://maven.apache.org/maven-v4_0_0.xsd">
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
   <groupId>org.apache.maven.plugin.my.unit</groupId>
@@ -167,15 +168,15 @@ public class MyMojoTest
     </plugins>
   </build>
 </project>
------
++---+
 
 ** Execute test
 
  As usual, just call:
 
------
++---+
 mvn test
------
++---+
 
 * Resources
 
diff --git a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/MojoTestCaseTest.java b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/MojoTestCaseTest.java
index 82dc34f..b233aa1 100644
--- a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/MojoTestCaseTest.java
+++ b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/MojoTestCaseTest.java
@@ -28,7 +28,7 @@ import java.util.Map;
 
 /**
  * @author Jason van Zyl
- * @version $Id: MojoTestCaseTest.java 638332 2008-03-18 11:39:00Z bentmann $
+ * @version $Id: MojoTestCaseTest.java 1345440 2012-06-02 04:57:05Z hboutemy $
  */
 public class MojoTestCaseTest
     extends AbstractMojoTestCase
@@ -116,7 +116,7 @@ public class MojoTestCaseTest
 
         mojo = (SimpleMojo) configureMojo( mojo, pluginConfiguration );
 
-        Map map = getVariablesAndValuesFromObject( mojo );
+        Map<String, Object> map = getVariablesAndValuesFromObject( mojo );
 
         assertEquals( "valueOne", (String)map.get( "keyOne" ) );
 
diff --git a/maven-plugin-testing-tools/pom.xml b/maven-plugin-testing-tools/pom.xml
index 0ed611d..3164961 100644
--- a/maven-plugin-testing-tools/pom.xml
+++ b/maven-plugin-testing-tools/pom.xml
@@ -25,16 +25,16 @@ under the License.
   <parent>
     <groupId>org.apache.maven.plugin-testing</groupId>
     <artifactId>maven-plugin-testing</artifactId>
-    <version>2.0</version>
+    <version>2.1</version>
   </parent>
 
   <artifactId>maven-plugin-testing-tools</artifactId>
   <name>Maven Plugin Testing Tools</name>
 
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.0/maven-plugin-testing-tools</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.0/maven-plugin-testing-tools</developerConnection>
-    <url>http://svn.apache.org/viewvc/maven/plugin-testing/tags/maven-plugin-testing-2.0/maven-plugin-testing-tools</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.1/maven-plugin-testing-tools</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.1/maven-plugin-testing-tools</developerConnection>
+    <url>http://svn.apache.org/viewvc/maven/plugin-testing/tags/maven-plugin-testing-2.1/maven-plugin-testing-tools</url>
   </scm>
 
   <dependencies>
@@ -61,7 +61,7 @@ under the License.
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-invoker</artifactId>
-      <version>2.0.10</version>
+      <version>2.0.11</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.plugin-testing</groupId>
diff --git a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/BuildTool.java b/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/BuildTool.java
index 5b3bd95..5bc4fe3 100644
--- a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/BuildTool.java
+++ b/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/BuildTool.java
@@ -43,9 +43,9 @@ import org.codehaus.plexus.util.cli.CommandLineUtils;
  * Test-tool used to execute Maven builds in order to test plugin functionality.
  *
  * @author jdcasey
- * @version $Id: BuildTool.java 1185951 2011-10-19 02:43:50Z ifedorenko $
+ * @version $Id: BuildTool.java 1345442 2012-06-02 05:26:01Z hboutemy $
  */
- at Component(role=BuildTool.class)
+ at Component( role = BuildTool.class )
 public class BuildTool
     implements Initializable, Disposable
 {
@@ -68,7 +68,7 @@ public class BuildTool
      *   resulting from the Maven invocation.
      * @throws TestToolsException if any
      */
-    public InvocationResult executeMaven( File pom, Properties properties, List goals, File buildLogFile )
+    public InvocationResult executeMaven( File pom, Properties properties, List<String> goals, File buildLogFile )
         throws TestToolsException
     {
         InvocationRequest request = createBasicInvocationRequest( pom, properties, goals, buildLogFile );
@@ -132,7 +132,7 @@ public class BuildTool
     }
 
     /**
-     * If we're logging output to a logfile using standard output handlers, make sure these are
+     * If we're logging output to a log file using standard output handlers, make sure these are
      * closed.
      *
      * @param request
@@ -169,7 +169,7 @@ public class BuildTool
      * @return The standardized InvocationRequest for the test build, ready for any necessary
      *   customizations.
      */
-    public InvocationRequest createBasicInvocationRequest( File pom, Properties properties, List goals,
+    public InvocationRequest createBasicInvocationRequest( File pom, Properties properties, List<String> goals,
                                                            File buildLogFile )
     {
         InvocationRequest request = new DefaultInvocationRequest();
diff --git a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java b/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
index 5842dd7..4cb36a1 100644
--- a/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
+++ b/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
@@ -66,7 +66,7 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
  * directory.
  *
  * @author jdcasey
- * @version $Id: ProjectTool.java 1185951 2011-10-19 02:43:50Z ifedorenko $
+ * @version $Id: ProjectTool.java 1345442 2012-06-02 05:26:01Z hboutemy $
  */
 @Component( role = ProjectTool.class )
 public class ProjectTool
@@ -225,7 +225,7 @@ public class ProjectTool
 
         Properties properties = new Properties();
 
-        List goals = new ArrayList();
+        List<String> goals = new ArrayList<String>();
         goals.add( "package" );
 
         File buildLog = logFile == null ? pomInfo.getBuildLogFile() : logFile;
@@ -390,12 +390,10 @@ public class ProjectTool
 
             if ( skipUnitTests )
             {
-                List plugins = build.getPlugins();
+                List<Plugin> plugins = build.getPlugins();
                 Plugin plugin = null;
-                for ( Iterator iter = plugins.iterator(); iter.hasNext(); )
+                for ( Plugin plug : plugins )
                 {
-                    Plugin plug = (Plugin) iter.next();
-
                     if ( "maven-surefire-plugin".equals( plug.getArtifactId() ) )
                     {
                         plugin = plug;
diff --git a/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java b/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
index 9da1498..e27e2aa 100644
--- a/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
+++ b/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
@@ -34,7 +34,7 @@ import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
- * @version $Id: ProjectToolTest.java 881038 2009-11-16 23:14:09Z bentmann $
+ * @version $Id: ProjectToolTest.java 1345442 2012-06-02 05:26:01Z hboutemy $
  */
 public class ProjectToolTest
     extends PlexusTestCase
@@ -96,14 +96,12 @@ public class ProjectToolTest
         assertEquals( "maven-plugin", artifact.getType() );
         assertTrue( "Missing " + artifact.getFile(), artifact.getFile().exists() );
 
-        Collection metadata = artifact.getMetadataList();
+        Collection<ArtifactMetadata> metadata = artifact.getMetadataList();
 
         boolean foundPomMetadata = false;
 
-        for ( Iterator it = metadata.iterator(); it.hasNext(); )
+        for ( ArtifactMetadata metadataItem : metadata )
         {
-            ArtifactMetadata metadataItem = (ArtifactMetadata) it.next();
-
             if ( metadataItem instanceof ProjectArtifactMetadata )
             {
                 foundPomMetadata = true;
diff --git a/maven-test-tools/pom.xml b/maven-test-tools/pom.xml
index 0fdf28c..6afe6ad 100644
--- a/maven-test-tools/pom.xml
+++ b/maven-test-tools/pom.xml
@@ -25,16 +25,16 @@ under the License.
   <parent>
     <groupId>org.apache.maven.plugin-testing</groupId>
     <artifactId>maven-plugin-testing</artifactId>
-    <version>2.0</version>
+    <version>2.1</version>
   </parent>
 
   <artifactId>maven-test-tools</artifactId>
   <name>Maven Testing Tools</name>
 
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.0/maven-test-tools</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.0/maven-test-tools</developerConnection>
-    <url>http://svn.apache.org/viewvc/maven/plugin-testing/tags/maven-plugin-testing-2.0/maven-test-tools</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.1/maven-test-tools</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.1/maven-test-tools</developerConnection>
+    <url>http://svn.apache.org/viewvc/maven/plugin-testing/tags/maven-plugin-testing-2.1/maven-test-tools</url>
   </scm>
 
   <dependencies>
@@ -43,9 +43,9 @@ under the License.
       <artifactId>junit</artifactId>
     </dependency>
     <dependency>
-      <groupId>easymock</groupId>
+      <groupId>org.easymock</groupId>
       <artifactId>easymock</artifactId>
-      <version>1.2_Java1.3</version>
+      <version>2.5.2</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
diff --git a/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/MockManager.java b/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/MockManager.java
index e270837..04593ea 100644
--- a/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/MockManager.java
+++ b/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/MockManager.java
@@ -20,7 +20,6 @@ package org.apache.maven.shared.tools.easymock;
  */
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.easymock.MockControl;
@@ -28,12 +27,12 @@ import org.easymock.MockControl;
 /**
  * Manager of MockControl
  *
- * @version $Id: MockManager.java 677117 2008-07-16 00:29:56Z vsiveton $
+ * @version $Id: MockManager.java 1345444 2012-06-02 05:36:05Z hboutemy $
  * @see MockControl
  */
 public class MockManager
 {
-    private List mockControls = new ArrayList();
+    private List<MockControl> mockControls = new ArrayList<MockControl>();
 
     /**
      * @param control to be add to the manager
@@ -56,10 +55,8 @@ public class MockManager
      */
     public void replayAll()
     {
-        for ( Iterator it = mockControls.iterator(); it.hasNext(); )
+        for ( MockControl control : mockControls )
         {
-            MockControl control = (MockControl) it.next();
-
             control.replay();
         }
     }
@@ -69,10 +66,8 @@ public class MockManager
      */
     public void verifyAll()
     {
-        for ( Iterator it = mockControls.iterator(); it.hasNext(); )
+        for ( MockControl control : mockControls )
         {
-            MockControl control = (MockControl) it.next();
-
             control.verify();
         }
     }
diff --git a/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/TestFileManager.java b/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/TestFileManager.java
index f2e5514..9f5ef59 100644
--- a/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/TestFileManager.java
+++ b/maven-test-tools/src/main/java/org/apache/maven/shared/tools/easymock/TestFileManager.java
@@ -35,14 +35,14 @@ import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
 
 /**
- * @version $Id: TestFileManager.java 677117 2008-07-16 00:29:56Z vsiveton $
+ * @version $Id: TestFileManager.java 1345444 2012-06-02 05:36:05Z hboutemy $
  */
 public class TestFileManager
 {
     /** Temp dir from "java.io.tmpdir" property */
     public static final String TEMP_DIR_PATH = System.getProperty( "java.io.tmpdir" );
 
-    private List filesToDelete = new ArrayList();
+    private List<File> filesToDelete = new ArrayList<File>();
 
     private final String baseFilename;
 
@@ -147,9 +147,9 @@ public class TestFileManager
     public void cleanUp()
         throws IOException
     {
-        for ( Iterator it = filesToDelete.iterator(); it.hasNext(); )
+        for ( Iterator<File> it = filesToDelete.iterator(); it.hasNext(); )
         {
-            File file = (File) it.next();
+            File file = it.next();
 
             if ( file.exists() )
             {
diff --git a/maven-test-tools/src/main/java/org/apache/maven/shared/tools/test/ReflectiveSetter.java b/maven-test-tools/src/main/java/org/apache/maven/shared/tools/test/ReflectiveSetter.java
index 0398368..af31c6b 100644
--- a/maven-test-tools/src/main/java/org/apache/maven/shared/tools/test/ReflectiveSetter.java
+++ b/maven-test-tools/src/main/java/org/apache/maven/shared/tools/test/ReflectiveSetter.java
@@ -29,18 +29,18 @@ import org.codehaus.plexus.util.ReflectionUtils;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
- * @version $Id: ReflectiveSetter.java 677117 2008-07-16 00:29:56Z vsiveton $
+ * @version $Id: ReflectiveSetter.java 1345445 2012-06-02 05:36:33Z hboutemy $
  */
 public class ReflectiveSetter
 {
-    private Map cachedPropertySetters = new HashMap();
+    private Map<String, Setter> cachedPropertySetters = new HashMap<String, Setter>();
 
-    private final Class targetClass;
+    private final Class<?> targetClass;
 
     /**
      * @param targetClass
      */
-    public ReflectiveSetter( Class targetClass )
+    public ReflectiveSetter( Class<?> targetClass )
     {
         this.targetClass = targetClass;
     }
@@ -72,13 +72,6 @@ public class ReflectiveSetter
             setter = new FieldSetter( propertyName, field );
         }
 
-        if ( setter == null )
-        {
-            throw new IllegalArgumentException( "No such property: " + propertyName + " in: " + targetClass
-                + ". Searched for: {method:" + preferredMethodName + ", method:" + propertyName + ", field:"
-                + propertyName + "}" );
-        }
-
         cachedPropertySetters.put( setter.getProperty(), setter );
 
         try
diff --git a/pom.xml b/pom.xml
index a612cf6..589682d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@ under the License.
 
   <groupId>org.apache.maven.plugin-testing</groupId>
   <artifactId>maven-plugin-testing</artifactId>
-  <version>2.0</version>
+  <version>2.1</version>
   <packaging>pom</packaging>
 
   <name>Maven Plugin Testing</name>
@@ -124,9 +124,9 @@ under the License.
   </modules>
 
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.0</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.0</developerConnection>
-    <url>http://svn.apache.org/viewvc/maven/plugin-testing/tags/maven-plugin-testing-2.0</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.1</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-testing/tags/maven-plugin-testing-2.1</developerConnection>
+    <url>http://svn.apache.org/viewvc/maven/plugin-testing/tags/maven-plugin-testing-2.1</url>
   </scm>
   <issueManagement>
     <system>jira</system>
@@ -152,38 +152,45 @@ under the License.
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-core</artifactId>
         <version>${mavenVersion}</version>
+        <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-compat</artifactId>
         <version>${mavenVersion}</version>
+        <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-model</artifactId>
         <version>${mavenVersion}</version>
+        <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-plugin-api</artifactId>
         <version>${mavenVersion}</version>
+        <scope>provided</scope>
       </dependency>    
       <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-aether-provider</artifactId>
         <version>${mavenVersion}</version>
+        <scope>provided</scope>
       </dependency>    
     
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-utils</artifactId>
-        <version>2.0.1</version>
+        <version>3.0.8</version>
+        <scope>provided</scope>
       </dependency>    
     
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>4.10</version>
+        <scope>provided</scope>
       </dependency>    
     </dependencies>
   </dependencyManagement>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/maven-plugin-testing-1.3.git



More information about the pkg-java-commits mailing list