You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2010/09/21 22:26:57 UTC

svn commit: r999602 - in /maven/plugins/trunk/maven-assembly-plugin: ./ src/main/java/org/apache/maven/plugin/assembly/archive/phase/ src/main/java/org/apache/maven/plugin/assembly/mojos/ src/main/mdo/ src/test/java/org/apache/maven/plugin/assembly/art...

Author: jdcasey
Date: Tue Sep 21 20:26:56 2010
New Revision: 999602

URL: http://svn.apache.org/viewvc?rev=999602&view=rev
Log:
[MASSEMBLY-501] Add useAllReactorProjects flag to moduleSet, to provide access to all modules from within a child project build. This should allow moduleSet/binaries to be used.

Modified:
    maven/plugins/trunk/maven-assembly-plugin/pom.xml
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/component.mdo
    maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/descriptor.mdo
    maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolverTest.java
    maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/format/FileFormatterTest.java
    maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/format/FileSetFormatterTest.java

Modified: maven/plugins/trunk/maven-assembly-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/pom.xml?rev=999602&r1=999601&r2=999602&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-assembly-plugin/pom.xml Tue Sep 21 20:26:56 2010
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <artifactId>maven-plugins</artifactId>
     <groupId>org.apache.maven.plugins</groupId>
-    <version>17</version>
+    <version>18</version>
   </parent>
 
   <artifactId>maven-assembly-plugin</artifactId>
@@ -50,19 +50,20 @@ under the License.
   </issueManagement>
 
   <properties>
-    <mdoVersion>1.1.1</mdoVersion>
+    <mdoVersion>1.1.2</mdoVersion>
+    <mavenVersion>2.2.1</mavenVersion>
   </properties>
 
   <dependencies>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-common-artifact-filters</artifactId>
-      <version>1.1</version>
+      <version>1.3-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-interpolation</artifactId>
-      <version>1.7</version>
+      <version>1.13</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
@@ -88,7 +89,7 @@ under the License.
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-filtering</artifactId>
-      <version>1.0-beta-2</version>
+      <version>1.0-beta-4</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
@@ -115,17 +116,17 @@ under the License.
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>2.0.4</version>
+      <version>${mavenVersion}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
-      <version>2.0.4</version>
+      <version>${mavenVersion}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-archiver</artifactId>
-      <version>2.4</version>
+      <version>2.4.1</version>
     </dependency>
     <!-- FIXME: I'm specifying a dependency on plexus-container-default
                 in order to force the version to be compatible with maven
@@ -144,12 +145,12 @@ under the License.
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
-      <version>2.0.4</version>
+      <version>${mavenVersion}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-model</artifactId>
-      <version>2.0.4</version>
+      <version>${mavenVersion}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
@@ -290,6 +291,14 @@ under the License.
     <pluginManagement>
       <plugins>
         <plugin>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>2.3.1</version>
+          <configuration>
+            <source>1.5</source>
+            <target>1.5</target>
+          </configuration>
+        </plugin>
+        <plugin>
           <artifactId>maven-surefire-plugin</artifactId>
           <configuration>
             <excludes>

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java?rev=999602&r1=999601&r2=999602&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java Tue Sep 21 20:26:56 2010
@@ -65,8 +65,8 @@ import java.util.Set;
  * @plexus.component role="org.apache.maven.plugin.assembly.archive.phase.AssemblyArchiverPhase" role-hint="module-sets"
  */
 public class ModuleSetAssemblyPhase
-    extends AbstractLogEnabled
-    implements AssemblyArchiverPhase
+extends AbstractLogEnabled
+implements AssemblyArchiverPhase
 {
 
     /**
@@ -97,17 +97,17 @@ public class ModuleSetAssemblyPhase
      * {@inheritDoc}
      */
     public void execute( Assembly assembly, Archiver archiver, AssemblerConfigurationSource configSource )
-        throws ArchiveCreationException, AssemblyFormattingException, InvalidAssemblerConfigurationException
+    throws ArchiveCreationException, AssemblyFormattingException, InvalidAssemblerConfigurationException
     {
         execute( assembly, archiver, configSource, new DefaultAssemblyContext() );
     }
-    
+
     /**
      * {@inheritDoc}
      */
     public void execute( Assembly assembly, Archiver archiver, AssemblerConfigurationSource configSource,
                          AssemblyContext context )
-        throws ArchiveCreationException, AssemblyFormattingException, InvalidAssemblerConfigurationException
+    throws ArchiveCreationException, AssemblyFormattingException, InvalidAssemblerConfigurationException
     {
         List moduleSets = assembly.getModuleSets();
 
@@ -115,32 +115,71 @@ public class ModuleSetAssemblyPhase
         {
             ModuleSet moduleSet = ( ModuleSet ) i.next();
 
+            validate( moduleSet, configSource );
+
             Set moduleProjects = getModuleProjects( moduleSet, configSource, getLogger() );
 
             ModuleSources sources = moduleSet.getSources();
+            addModuleSourceFileSets( sources, moduleProjects, archiver, configSource );
+
             ModuleBinaries binaries = moduleSet.getBinaries();
+            addModuleBinaries( binaries, moduleProjects, archiver, configSource, context );
+        }
+    }
 
-            if ( ( sources == null ) && ( binaries == null ) )
+    private void validate( ModuleSet moduleSet, AssemblerConfigurationSource configSource )
+    {
+        if ( ( moduleSet.getSources() == null ) && ( moduleSet.getBinaries() == null ) )
+        {
+            getLogger().warn( "Encountered ModuleSet with no sources or binaries specified. Skipping." );
+        }
+
+        if ( moduleSet.isUseAllReactorProjects() && !moduleSet.isIncludeSubModules() )
+        {
+            getLogger().warn( "includeSubModules == false is incompatible with useAllReactorProjects. Ignoring."
+                              + "\n\nTo refactor, remove the <includeSubModules/> flag, and use the <includes/> "
+                              + "and <excludes/> sections to fine-tune the modules included." );
+        }
+
+        if ( configSource.getMavenSession() != null && configSource.getMavenSession().getSortedProjects() != null )
+        {
+            List projects = configSource.getMavenSession().getSortedProjects();
+            if ( projects.size() > 1 && projects.indexOf( configSource.getProject() ) == 0
+                            && moduleSet.getBinaries() != null )
             {
-                getLogger().warn( "Encountered ModuleSet with no sources or binaries specified. Skipping." );
-                continue;
+                getLogger().warn( "[DEPRECATION] moduleSet/binaries section detected in root-project assembly."
+                                  + "\n\nMODULE BINARIES MAY NOT BE AVAILABLE FOR THIS ASSEMBLY!"
+                                  + "\n\n To refactor, move this assembly into a child project and use the flag "
+                                  + "<useAllReactorProjects>true</useAllReactorProjects> in each moduleSet." );
             }
+        }
 
-            addModuleSourceFileSets( moduleSet.getSources(), moduleProjects, archiver, configSource );
-
-            addModuleBinaries( moduleSet.getBinaries(), moduleProjects, archiver, configSource, context );
+        if ( moduleSet.getSources() != null )
+        {
+            ModuleSources sources = moduleSet.getSources();
+            if ( isDeprecatedModuleSourcesConfigPresent( sources ) )
+            {
+                getLogger().warn( "[DEPRECATION] Use of <moduleSources/> as a file-set is deprecated. "
+                                  + "Please use the <fileSets/> sub-element of <moduleSources/> instead." );
+            }
+            else if ( !sources.isUseDefaultExcludes() )
+            {
+                getLogger().warn( "[DEPRECATION] Use of directoryMode, fileMode, or useDefaultExcludes "
+                                  + "elements directly within <moduleSources/> are all deprecated. "
+                                  + "Please use the <fileSets/> sub-element of <moduleSources/> instead." );
+            }
         }
     }
 
     protected void addModuleBinaries( ModuleBinaries binaries, Set projects, Archiver archiver,
                                       AssemblerConfigurationSource configSource, AssemblyContext context )
-        throws ArchiveCreationException, AssemblyFormattingException, InvalidAssemblerConfigurationException
+    throws ArchiveCreationException, AssemblyFormattingException, InvalidAssemblerConfigurationException
     {
         if ( binaries == null )
         {
             return;
         }
-        
+
         Set moduleProjects = new HashSet( projects );
 
         for ( Iterator it = moduleProjects.iterator(); it.hasNext(); )
@@ -158,7 +197,7 @@ public class ModuleSetAssemblyPhase
         }
 
         String classifier = binaries.getAttachmentClassifier();
-        
+
         Map chosenModuleArtifacts = new HashMap();
 
         for ( Iterator j = moduleProjects.iterator(); j.hasNext(); )
@@ -209,15 +248,15 @@ public class ModuleSetAssemblyPhase
             for ( Iterator it = depSets.iterator(); it.hasNext(); )
             {
                 DependencySet ds = (DependencySet) it.next();
-                
+
                 // NOTE: Disabling useProjectArtifact flag, since module artifact has already been handled!
                 ds.setUseProjectArtifact( false );
             }
 
             // FIXME: This will produce unpredictable results when module dependencies have a version conflict.
             getLogger().warn(
-                              "NOTE: Currently, inclusion of module dependencies may produce unpredictable "
-                                              + "results if a version conflict occurs." );
+                             "NOTE: Currently, inclusion of module dependencies may produce unpredictable "
+                             + "results if a version conflict occurs." );
 
             for ( Iterator it = moduleProjects.iterator(); it.hasNext(); )
             {
@@ -257,7 +296,7 @@ public class ModuleSetAssemblyPhase
 
             depSets = Collections.singletonList( impliedDependencySet );
         }
-        
+
         return depSets;
     }
 
@@ -283,14 +322,14 @@ public class ModuleSetAssemblyPhase
     }
 
     protected void addModuleArtifact( Artifact artifact, MavenProject project, Archiver archiver,
-                                AssemblerConfigurationSource configSource, ModuleBinaries binaries )
-        throws ArchiveCreationException, AssemblyFormattingException
+                                      AssemblerConfigurationSource configSource, ModuleBinaries binaries )
+    throws ArchiveCreationException, AssemblyFormattingException
     {
         if ( artifact.getFile() == null )
         {
             throw new ArchiveCreationException( "Artifact: " + artifact.getId()
-                            + " (included by module) does not have an artifact with a file. "
-                            + "Please ensure the package phase is run before the assembly is generated." );
+                                                + " (included by module) does not have an artifact with a file. "
+                                                + "Please ensure the package phase is run before the assembly is generated." );
         }
 
         AddArtifactTask task = new AddArtifactTask( artifact, getLogger() );
@@ -300,21 +339,21 @@ public class ModuleSetAssemblyPhase
         task.setProject( project );
         task.setModuleProject( project );
         task.setModuleArtifact( artifact );
-        
+
         int dirMode = TypeConversionUtils.modeToInt( binaries.getDirectoryMode(), getLogger() );
         if ( dirMode != -1 )
         {
             task.setDirectoryMode( dirMode );
         }
-        
+
         int fileMode = TypeConversionUtils.modeToInt( binaries.getFileMode(), getLogger() );
         if ( fileMode != -1 )
         {
             task.setFileMode( fileMode );
         }
-        
+
         task.setUnpack( binaries.isUnpack() );
-        
+
         if ( binaries.isUnpack() && binaries.getUnpackOptions() != null )
         {
             task.setIncludes( binaries.getUnpackOptions().getIncludes() );
@@ -326,7 +365,7 @@ public class ModuleSetAssemblyPhase
 
     protected void addModuleSourceFileSets( ModuleSources sources, Set moduleProjects, Archiver archiver,
                                             AssemblerConfigurationSource configSource )
-        throws ArchiveCreationException, AssemblyFormattingException
+    throws ArchiveCreationException, AssemblyFormattingException
     {
         if ( sources == null )
         {
@@ -363,7 +402,7 @@ public class ModuleSetAssemblyPhase
             MavenProject moduleProject = ( MavenProject ) j.next();
 
             getLogger().info( "Processing sources for module project: " + moduleProject.getId() );
-            
+
             List moduleFileSets = new ArrayList();
 
             for ( Iterator fsIterator = fileSets.iterator(); fsIterator.hasNext(); )
@@ -372,7 +411,7 @@ public class ModuleSetAssemblyPhase
 
                 moduleFileSets.add( createFileSet( fileSet, sources, moduleProject, configSource ) );
             }
-            
+
             AddFileSetsTask task = new AddFileSetsTask( moduleFileSets );
 
             task.setProject( moduleProject );
@@ -403,25 +442,11 @@ public class ModuleSetAssemblyPhase
             result = true;
         }
 
-        if ( result )
-        {
-            getLogger().warn(
-                              "[DEPRECATION] Use of <moduleSources/> as a file-set is deprecated. "
-                                              + "Please use the <fileSets/> sub-element of <moduleSources/> instead." );
-        }
-        else if ( !sources.isUseDefaultExcludes() )
-        {
-            getLogger().warn(
-                              "[DEPRECATION] Use of directoryMode, fileMode, or useDefaultExcludes "
-                                              + "elements directly within <moduleSources/> are all deprecated. "
-                                              + "Please use the <fileSets/> sub-element of <moduleSources/> instead." );
-        }
-
         return result;
     }
 
     protected FileSet createFileSet( FileSet fileSet, ModuleSources sources, MavenProject moduleProject, AssemblerConfigurationSource configSource )
-        throws AssemblyFormattingException
+    throws AssemblyFormattingException
     {
         FileSet fs = new FileSet();
 
@@ -510,21 +535,27 @@ public class ModuleSetAssemblyPhase
     }
 
     public static Set getModuleProjects( ModuleSet moduleSet, AssemblerConfigurationSource configSource, Logger logger )
-        throws ArchiveCreationException
+    throws ArchiveCreationException
     {
         MavenProject project = configSource.getProject();
 
+
+        if ( moduleSet.isUseAllReactorProjects() )
+        {
+            project = (MavenProject) configSource.getReactorProjects().get( 0 );
+        }
+
         Set moduleProjects;
         try
         {
             moduleProjects =
-                ProjectUtils.getProjectModules( project, configSource.getReactorProjects(), moduleSet.isIncludeSubModules(),
-                                                logger );
+                ProjectUtils.getProjectModules( project, configSource.getReactorProjects(),
+                                                moduleSet.isIncludeSubModules(), logger );
         }
         catch ( IOException e )
         {
             throw new ArchiveCreationException( "Error retrieving module-set for project: " + project.getId() + ": "
-                            + e.getMessage(), e );
+                                                + e.getMessage(), e );
         }
 
         FilterUtils.filterProjects( moduleProjects, moduleSet.getIncludes(), moduleSet.getExcludes(), true, logger );

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java?rev=999602&r1=999601&r2=999602&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java Tue Sep 21 20:26:56 2010
@@ -41,6 +41,7 @@ import org.apache.maven.shared.filtering
 import org.codehaus.plexus.configuration.PlexusConfiguration;
 
 import java.io.File;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
@@ -50,8 +51,8 @@ import java.util.List;
  * @version $Id$
  */
 public abstract class AbstractAssemblyMojo
-    extends AbstractMojo
-    implements AssemblerConfigurationSource
+extends AbstractMojo
+implements AssemblerConfigurationSource
 {
 
     /**
@@ -211,7 +212,7 @@ public abstract class AbstractAssemblyMo
      * @component
      */
     private MavenProjectHelper projectHelper;
-    
+
     /**
      * Maven shared filtering utility.
      *
@@ -297,7 +298,7 @@ public abstract class AbstractAssemblyMo
      * @component
      */
     private AssemblyReader assemblyReader;
-    
+
     /**
      * Allows additional configuration options that are specific to a particular
      * type of archive format. This is intended to capture an XML configuration
@@ -315,7 +316,7 @@ public abstract class AbstractAssemblyMo
      * @since 2.2-beta-3
      */
     private PlexusConfiguration archiverConfig;
-    
+
     /**
      * This will cause the assembly to run only at the top of a given module tree. That is, run in the project 
      * contained in the same folder where the mvn execution was launched.
@@ -331,14 +332,14 @@ public abstract class AbstractAssemblyMo
      *
      */
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+    throws MojoExecutionException, MojoFailureException
     {
         if ( skipAssembly )
         {
             getLog().info( "Assemblies have been skipped per configuration of the skipAssembly parameter." );
             return;
         }
-        
+
         //run only at the execution root.
         if (runOnlyAtExecutionRoot && !isThisTheExecutionRoot())
         {
@@ -435,7 +436,7 @@ public abstract class AbstractAssemblyMo
             catch ( InvalidAssemblerConfigurationException e )
             {
                 throw new MojoFailureException( assembly, "Assembly is incorrectly configured: " + assembly.getId(), "Assembly: "
-                                + assembly.getId() + " is not configured correctly: " + e.getMessage() );
+                                                + assembly.getId() + " is not configured correctly: " + e.getMessage() );
             }
         }
     }
@@ -458,10 +459,10 @@ public abstract class AbstractAssemblyMo
         {
             log.debug( "This is NOT the execution root." );
         }
-        
+
         return result;
     }
-    
+
     protected AssemblyArchiver getAssemblyArchiver()
     {
         return assemblyArchiver;
@@ -564,6 +565,10 @@ public abstract class AbstractAssemblyMo
         if ( filters == null )
         {
             filters = getProject().getBuild().getFilters();
+            if ( filters == null )
+            {
+                filters = Collections.EMPTY_LIST;
+            }
         }
         return filters;
     }
@@ -721,11 +726,11 @@ public abstract class AbstractAssemblyMo
     public void setIgnoreMissingDescriptor(boolean ignoreMissingDescriptor) {
         this.ignoreMissingDescriptor = ignoreMissingDescriptor;
     }
-    
+
     public MavenSession getMavenSession() {
-    	return this.mavenSession;
+        return this.mavenSession;
     }
-    
+
     public String getArchiverConfig()
     {
         return archiverConfig == null ? null : archiverConfig.toString();

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/component.mdo
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/component.mdo?rev=999602&r1=999601&r2=999602&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/component.mdo (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/component.mdo Tue Sep 21 20:26:56 2010
@@ -21,8 +21,8 @@
      Modello currently does not have capability to share files
 -->
 
-<model xsd.namespace="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.1" 
-       xsd.targetNamespace="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.1">
+<model xsd.namespace="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2" 
+       xsd.targetNamespace="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2">
        
   <id>component</id>
   <name>Component</name>
@@ -603,7 +603,7 @@
         </field>
         <field>
           <name>configuration</name>
-          <version>1.1.1</version>
+          <version>1.1.1+</version>
           <description>
             Configuration options for the handler.
           </description>

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/descriptor.mdo
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/descriptor.mdo?rev=999602&r1=999601&r2=999602&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/descriptor.mdo (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/descriptor.mdo Tue Sep 21 20:26:56 2010
@@ -23,8 +23,8 @@
   to "component.mdo".
 -->
 
-<model xsd.namespace="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1" 
-       xsd.targetNamespace="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1">
+<model xsd.namespace="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" 
+       xsd.targetNamespace="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2">
        
   <id>assembly</id>
   <name>Assembly</name>
@@ -609,6 +609,17 @@
       <version>1.0.0+</version>
       <fields>
         <field>
+          <name>useAllReactorProjects</name>
+          <version>1.1.2+</version>
+          <type>boolean</type>
+          <defaultValue>false</defaultValue>
+          <description>
+          If set to true, the plugin will include all projects in the current reactor for processing 
+          in this ModuleSet. These will be subject to include/exclude rules.
+          Default value is true. (Since 2.2-beta-6)
+          </description>
+        </field>
+        <field>
           <name>includeSubModules</name>
           <version>1.1.0+</version>
           <type>boolean</type>
@@ -983,7 +994,7 @@
         </field>
         <field>
           <name>configuration</name>
-          <version>1.1.1</version>
+          <version>1.1.1+</version>
           <description>
             Configuration options for the handler.
           </description>

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolverTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolverTest.java?rev=999602&r1=999601&r2=999602&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolverTest.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolverTest.java Tue Sep 21 20:26:56 2010
@@ -1,129 +1,121 @@
 package org.apache.maven.plugin.assembly.artifact;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.metadata.ResolutionGroup;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.apache.maven.artifact.resolver.ArtifactCollector;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.DependencyManagement;
 import org.apache.maven.model.Model;
 import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
 import org.apache.maven.plugin.assembly.archive.ArchiveCreationException;
-import org.apache.maven.plugin.assembly.model.Assembly;
 import org.apache.maven.plugin.assembly.model.DependencySet;
 import org.apache.maven.plugin.assembly.model.ModuleBinaries;
 import org.apache.maven.plugin.assembly.model.ModuleSet;
 import org.apache.maven.plugin.assembly.model.Repository;
 import org.apache.maven.plugin.assembly.testutils.MockManager;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.logging.console.ConsoleLogger;
-import org.easymock.ArgumentsMatcher;
 import org.easymock.MockControl;
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 public class DefaultDependencyResolverTest
-    extends PlexusTestCase
+extends PlexusTestCase
 {
-    
+
     private ArtifactFactory factory;
-    
+
     private ArtifactRepositoryFactory repoFactory;
-    
+
     private ArtifactRepositoryLayout layout;
-    
-    private ArtifactCollector collector;
-    
+
+    // private ArtifactCollector collector;
+
     public void setUp()
-        throws Exception
+    throws Exception
     {
         super.setUp();
-        
+
         factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
         repoFactory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE );
         layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" );
-        
-        collector = (ArtifactCollector) lookup( ArtifactCollector.class.getName() );
+
+        // collector = (ArtifactCollector) lookup( ArtifactCollector.class.getName() );
     }
-    
+
     public void test_getDependencySetResolutionRequirements()
     {
         List depSets = new ArrayList();
-        
+
         DependencySet ds1 = new DependencySet();
         ds1.setScope( Artifact.SCOPE_COMPILE );
         ds1.setUseTransitiveDependencies( false );
-        
+
         depSets.add( ds1 );
-        
+
         DependencySet ds2 = new DependencySet();
         ds2.setScope( Artifact.SCOPE_SYSTEM );
         ds2.setUseTransitiveDependencies( false );
-        
+
         depSets.add( ds2 );
-        
+
         ResolutionManagementInfo info = new ResolutionManagementInfo( new MavenProject( new Model() ) );
-        
+
         new DefaultDependencyResolver().getDependencySetResolutionRequirements( depSets, info );
-        
+
         assertTrue( info.isResolutionRequired() );
         assertFalse( info.isResolvedTransitively() );
-        
+
         assertTrue( info.getScopeFilter().isIncludeCompileScope() );
         assertTrue( info.getScopeFilter().isIncludeSystemScope() );
-        
+
         assertTrue( info.getScopeFilter().isIncludeProvidedScope() );
-        
+
         assertFalse( info.getScopeFilter().isIncludeRuntimeScope() );
         assertFalse( info.getScopeFilter().isIncludeTestScope() );
     }
-    
+
     public void test_getModuleSetResolutionRequirements()
-        throws ArchiveCreationException
+    throws ArchiveCreationException
     {
         MockManager mm = new MockManager();
-        
+
         MockControl csControl = MockControl.createControl( AssemblerConfigurationSource.class );
         mm.add( csControl );
-        
+
         AssemblerConfigurationSource cs = (AssemblerConfigurationSource) csControl.getMock();
-        
+
         File rootDir = new File( "root" );
         MavenProject project = createMavenProject( "main-group", "main-artifact", "1", rootDir );
-        
+
         File module1Dir = new File( rootDir, "module-1" );
         MavenProject module1 = createMavenProject( "main-group", "module-1", "1", module1Dir );
         MavenProject module1a = createMavenProject( "group1", "module-1a", "1", new File( module1Dir, "module-1a" ) );
         MavenProject module1b = createMavenProject( "group1.b", "module-1b", "1", new File( module1Dir, "module-1b" ) );
-        
+
         module1.getModel().addModule( module1a.getArtifactId() );
         module1.getModel().addModule( module1b.getArtifactId() );
-        
+
         File module2Dir = new File( rootDir, "module-2" );
         MavenProject module2 = createMavenProject( "main-group", "module-2", "1", module2Dir );
         MavenProject module2a = createMavenProject( "main-group", "module-2a", "1", new File( module2Dir, "module-2a" ) );
-        
+
         module2.getModel().addModule( module2a.getArtifactId() );
-        
+
         project.getModel().addModule( module1.getArtifactId() );
         project.getModel().addModule( module2.getArtifactId() );
-        
+
         List allProjects = new ArrayList();
         allProjects.add( project );
         allProjects.add( module1 );
@@ -131,184 +123,184 @@ public class DefaultDependencyResolverTe
         allProjects.add( module1b );
         allProjects.add( module2 );
         allProjects.add( module2a );
-        
+
         cs.getReactorProjects();
         csControl.setReturnValue( allProjects, MockControl.ZERO_OR_MORE );
-        
+
         cs.getProject();
         csControl.setReturnValue( project, MockControl.ZERO_OR_MORE );
-        
+
         ResolutionManagementInfo info = new ResolutionManagementInfo( project );
-        
+
         List moduleSets = new ArrayList();
-        
+
         {
             ModuleSet ms = new ModuleSet();
             ms.addInclude( "*module1*" );
             ms.setIncludeSubModules( false );
-            
+
             ModuleBinaries mb = new ModuleBinaries();
-            
+
             DependencySet ds = new DependencySet();
             ds.setScope( Artifact.SCOPE_COMPILE );
-            
+
             mb.addDependencySet( ds );
             ms.setBinaries( mb );
             moduleSets.add( ms );
         }
-        
+
         {
             ModuleSet ms = new ModuleSet();
             ms.addInclude( "main-group:*" );
             ms.setIncludeSubModules( true );
-            
+
             ModuleBinaries mb = new ModuleBinaries();
-            
+
             DependencySet ds = new DependencySet();
             ds.setScope( Artifact.SCOPE_TEST );
-            
+
             mb.addDependencySet( ds );
             ms.setBinaries( mb );
             moduleSets.add( ms );
         }
-        
+
         mm.replayAll();
-        
+
         DefaultDependencyResolver resolver = new DefaultDependencyResolver();
         resolver.enableLogging( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
-        
+
         resolver.getModuleSetResolutionRequirements( moduleSets, info, cs );
-        
+
         assertTrue( info.isResolutionRequired() );
-        
+
         Set enabledProjects = info.getEnabledProjects();
         assertTrue( enabledProjects.contains( project ) );
-        
+
         assertTrue( enabledProjects.contains( module1 ) );
-        
+
         // these should be excluded since sub-modules are not traversable
         assertFalse( enabledProjects.contains( module1a ) );
         assertFalse( enabledProjects.contains( module1b ) );
-        
+
         assertTrue( enabledProjects.contains( module2 ) );
         assertTrue( enabledProjects.contains( module2a ) );
-        
+
         // these are the two we directly set above.
         assertTrue( info.getScopeFilter().isIncludeTestScope() );
         assertTrue( info.getScopeFilter().isIncludeCompileScope() );
-        
+
         // this combination should be implied by the two direct scopes set above.
         assertTrue( info.getScopeFilter().isIncludeRuntimeScope() );
         assertTrue( info.getScopeFilter().isIncludeProvidedScope() );
         assertTrue( info.getScopeFilter().isIncludeSystemScope() );
-        
+
         mm.verifyAll();
     }
 
     public void test_getRepositoryResolutionRequirements()
     {
         List repositories = new ArrayList();
-        
+
         {
             Repository r = new Repository();
             r.setScope( Artifact.SCOPE_COMPILE );
             repositories.add( r );
         }
-        
+
         {
             Repository r = new Repository();
             r.setScope( Artifact.SCOPE_SYSTEM );
             repositories.add( r );
         }
-        
+
         ResolutionManagementInfo info = new ResolutionManagementInfo( new MavenProject( new Model() ) );
-        
+
         new DefaultDependencyResolver().getRepositoryResolutionRequirements( repositories, info );
-        
+
         assertTrue( info.isResolutionRequired() );
-        
+
         assertTrue( info.getScopeFilter().isIncludeCompileScope() );
         assertTrue( info.getScopeFilter().isIncludeSystemScope() );
-        
+
         assertTrue( info.getScopeFilter().isIncludeProvidedScope() );
-        
+
         assertFalse( info.getScopeFilter().isIncludeRuntimeScope() );
         assertFalse( info.getScopeFilter().isIncludeTestScope() );
     }
-    
+
     public void test_getManagedVersionMap()
-        throws InvalidVersionSpecificationException
+    throws InvalidVersionSpecificationException
     {
         MavenProject project = createMavenProject( "group", "artifact", "1", new File( "base" ) );
-        
+
         DependencyManagement dm = new DependencyManagement();
         project.getModel().setDependencyManagement( dm );
-        
+
         Dependency d1 = new Dependency();
         d1.setGroupId( "group" );
         d1.setArtifactId( "dep1" );
         d1.setVersion( "2" );
         d1.setScope( Artifact.SCOPE_PROVIDED );
-        
+
         dm.addDependency( d1 );
-        
+
         Dependency d2 = new Dependency();
         d2.setGroupId( "group" );
         d2.setArtifactId( "dep2" );
         d2.setVersion( "2.1" );
-        
+
         dm.addDependency( d2 );
-        
+
         DefaultDependencyResolver resolver = new DefaultDependencyResolver();
         resolver.setLogger( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
         resolver.setArtifactFactory( factory );
-        
+
         Map managedVersionMap = resolver.getManagedVersionMap( project );
-        
+
         Artifact a1 = (Artifact) managedVersionMap.get( d1.getManagementKey() );
         assertNotNull( a1 );
         assertEquals( d1.getVersion(), a1.getVersion() );
         assertEquals( d1.getScope(), a1.getScope() );
-        
+
         Artifact a2 = (Artifact) managedVersionMap.get( d2.getManagementKey() );
         assertNotNull( a2 );
         assertEquals( d2.getVersion(), a2.getVersion() );
         assertNull( a2.getScope() );
     }
-    
+
     public void test_aggregateRemoteArtifactRepositories()
     {
         List externalRepos = new ArrayList();
-        
+
         ArtifactRepository er1 = repoFactory.createArtifactRepository( "test.1", "http://test.com/path", layout, null, null );
         externalRepos.add( er1 );
-        
+
         ArtifactRepository er2 = repoFactory.createArtifactRepository( "test.2", "http://test2.com/path", layout, null, null );
         externalRepos.add( er2 );
-        
+
         List projectRepos = new ArrayList();
-        
+
         ArtifactRepository pr1 = repoFactory.createArtifactRepository( "project.1", "http://test.com/project", layout, null, null );
         projectRepos.add( pr1 );
-        
+
         ArtifactRepository pr2 = repoFactory.createArtifactRepository( "project.2", "http://test2.com/path", layout, null, null );
         projectRepos.add( pr2 );
-        
+
         MavenProject project = createMavenProject( "group", "artifact", "1", new File( "base" ) );
         project.setRemoteArtifactRepositories( projectRepos );
-        
+
         List aggregated = new DefaultDependencyResolver().aggregateRemoteArtifactRepositories( externalRepos, project );
-        
+
         assertRepositoryWithId( er1.getId(), aggregated, true );
         assertRepositoryWithId( er2.getId(), aggregated, true );
         assertRepositoryWithId( pr1.getId(), aggregated, true );
         assertRepositoryWithId( pr2.getId(), aggregated, false );
     }
-    
+
     public void test_manageArtifact()
     {
         Artifact managed = factory.createArtifact( "group", "artifact", "1", Artifact.SCOPE_PROVIDED, "jar" );
-        
+
         Artifact target =
             factory.createArtifact( managed.getGroupId(), managed.getArtifactId(), "2", Artifact.SCOPE_COMPILE,
                                     managed.getType() );
@@ -316,266 +308,269 @@ public class DefaultDependencyResolverTe
         Artifact target2 =
             factory.createArtifact( "other-group", managed.getArtifactId(), "2", Artifact.SCOPE_COMPILE,
                                     managed.getType() );
-        
+
         Map managedVersions = Collections.singletonMap( managed.getDependencyConflictId(), managed );
 
         DefaultDependencyResolver resolver =
             new DefaultDependencyResolver().setLogger( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
-        
+
         resolver.manageArtifact( target, managedVersions );
         resolver.manageArtifact( target2, managedVersions );
-        
+
         assertEquals( managed.getVersion(), target.getVersion() );
         assertEquals( managed.getScope(), target.getScope() );
-        
+
         assertEquals( "2", target2.getVersion() );
         assertEquals( Artifact.SCOPE_COMPILE, target2.getScope() );
     }
-    
-    public void test_buildManagedVersionMap_NonTransitiveResolution()
-        throws ArtifactResolutionException, ArchiveCreationException, InvalidVersionSpecificationException,
-        InvalidDependencyVersionException
-    {
-        Assembly assembly = new Assembly();
-        
-        DependencySet ds = new DependencySet();
-        ds.setScope( Artifact.SCOPE_PROVIDED );
-        ds.setUseTransitiveDependencies( false );
-        
-        assembly.addDependencySet( ds );
-        
-        ModuleSet ms = new ModuleSet();
-        ModuleBinaries mb = new ModuleBinaries();
-        ms.setBinaries( mb );
-        
-        DependencySet mds = new DependencySet();
-        mds.setScope( Artifact.SCOPE_PROVIDED );
-        mds.setUseTransitiveDependencies( false );
-        
-        mb.addDependencySet( mds );
-        
-        assembly.addModuleSet( ms );
-        
-        MavenProject project = createMavenProject( "group", "artifact", "1", new File( "base" ) );
-        
-        Dependency d1 = new Dependency();
-        d1.setGroupId( "group.dep" );
-        d1.setArtifactId( "dep1" );
-        d1.setVersion( "1" );
-        d1.setScope( Artifact.SCOPE_COMPILE );
-        
-        project.getModel().addDependency( d1 );
-        
-        Dependency d2 = new Dependency();
-        d2.setGroupId( "group.dep" );
-        d2.setArtifactId( "dep2" );
-        d2.setVersion( "1" );
-        d2.setScope( Artifact.SCOPE_PROVIDED );
-        
-        project.getModel().addDependency( d2 );
-        
-        Dependency d3 = new Dependency();
-        d3.setGroupId( "group.dep" );
-        d3.setArtifactId( "dep3" );
-        d3.setVersion( "1" );
-        d3.setScope( Artifact.SCOPE_PROVIDED );
-        
-        project.getModel().addDependency( d3 );
-        
-        MavenProject module = createMavenProject( "group", "module", "1", new File( "base/module" ) );
-        
-        project.getModel().addModule( module.getArtifactId() );
-        
-        Dependency md = new Dependency();
-        md.setGroupId( "group.dep" );
-        md.setArtifactId( "dep3" );
-        md.setVersion( "2" );
-        md.setScope( Artifact.SCOPE_PROVIDED );
-        
-        module.getModel().addDependency( md );
-        
-        List allProjects = new ArrayList();
-        allProjects.add( project );
-        allProjects.add( module );
-        
-        MockManager mm = new MockManager();
-        
-        MockControl csControl = MockControl.createControl( AssemblerConfigurationSource.class );
-        mm.add( csControl );
-        
-        AssemblerConfigurationSource cs = (AssemblerConfigurationSource) csControl.getMock();
-        
-        cs.getProject();
-        csControl.setReturnValue( project, MockControl.ZERO_OR_MORE );
-        
-        cs.getReactorProjects();
-        csControl.setReturnValue( allProjects, MockControl.ZERO_OR_MORE );
-        
-        cs.getRemoteRepositories();
-        csControl.setReturnValue( Collections.EMPTY_LIST, MockControl.ZERO_OR_MORE );
-        
-        mm.replayAll();
-        
-        DefaultDependencyResolver resolver = new DefaultDependencyResolver();
-        resolver.setArtifactFactory( factory );
-        resolver.setLogger( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
-        
-        Map managedVersionMap = resolver.buildManagedVersionMap( assembly, cs );
-        
-        {
-            Dependency d = d1;
-            Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
-            assertNull( a );
-        }
-        
-        {
-            Dependency d = d2;
-            Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
-            assertNotNull( a );
-            assertEquals( d.getVersion(), a.getVersion() );
-            assertEquals( d.getScope(), a.getScope() );
-        }
-        
-        {
-            Dependency d = d3;
-            Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
-            assertNotNull( a );
-            assertEquals( d.getVersion(), a.getVersion() );
-            assertEquals( d.getScope(), a.getScope() );
-        }
-        
-        mm.verifyAll();
-    }
-    
-    public void test_buildManagedVersionMap_TransitiveResolution()
-        throws ArtifactResolutionException, ArchiveCreationException, InvalidVersionSpecificationException,
-        InvalidDependencyVersionException
-    {
-        Assembly assembly = new Assembly();
-        
-        DependencySet ds = new DependencySet();
-        ds.setScope( Artifact.SCOPE_COMPILE );
-        ds.setUseTransitiveDependencies( true );
-        
-        assembly.addDependencySet( ds );
-        
-        MavenProject project = createMavenProject( "group", "artifact", "1", new File( "base" ) );
-        
-        Dependency d1 = new Dependency();
-        d1.setGroupId( "group.dep" );
-        d1.setArtifactId( "dep1" );
-        d1.setVersion( "1" );
-        d1.setScope( Artifact.SCOPE_COMPILE );
-        
-        project.getModel().addDependency( d1 );
-        
-        Dependency d2 = new Dependency();
-        d2.setGroupId( "group.dep" );
-        d2.setArtifactId( "dep2" );
-        d2.setVersion( "1" );
-        d2.setScope( Artifact.SCOPE_COMPILE );
-        final Artifact a2 = factory.createArtifact( d2.getGroupId(), d2.getArtifactId(), d2.getVersion(), d2.getScope(), "jar" );
-        
-        project.getModel().addDependency( d2 );
-        
-        Dependency d3 = new Dependency();
-        d3.setGroupId( "group.dep" );
-        d3.setArtifactId( "dep3" );
-        d3.setVersion( "1" );
-        d3.setScope( Artifact.SCOPE_COMPILE );
-        
-        project.getModel().addDependency( d3 );
-        
-        final Artifact a2a = factory.createArtifact( d3.getGroupId(), d3.getArtifactId(), "2", Artifact.SCOPE_RUNTIME, "jar" );
-        
-        MockManager mm = new MockManager();
-        
-        MockControl msControl = MockControl.createControl( ArtifactMetadataSource.class );
-        mm.add( msControl );
-        
-        ArtifactMetadataSource ms = (ArtifactMetadataSource) msControl.getMock();
-        
-        try
-        {
-            ms.retrieve( null, null, null );
-        }
-        catch ( ArtifactMetadataRetrievalException e )
-        {
-        }
-        
-        msControl.setDefaultReturnValue( new ResolutionGroup( null, Collections.EMPTY_SET, Collections.EMPTY_LIST ) );
-        msControl.setMatcher( new ArgumentsMatcher()
-        {
-            public boolean matches( Object[] expected, Object[] actual )
-            {
-                Artifact a = (Artifact) actual[0];
 
-                return a2.getArtifactId().equals( a.getArtifactId() );
-            }
 
-            public String toString( Object[] args )
-            {
-                return "with artifact: " + args[0] ;
-            }
-            
-        } );
-        msControl.setReturnValue( new ResolutionGroup( a2, Collections.singleton( a2a ), Collections.EMPTY_LIST ) );
-        
-        
-        MockControl csControl = MockControl.createControl( AssemblerConfigurationSource.class );
-        mm.add( csControl );
-        
-        AssemblerConfigurationSource cs = (AssemblerConfigurationSource) csControl.getMock();
-        
-        cs.getProject();
-        csControl.setReturnValue( project, MockControl.ZERO_OR_MORE );
-        
-        String tmpDir = System.getProperty( "java.io.tmpdir" );
-        ArtifactRepository lr = repoFactory.createArtifactRepository( "local", "file://" + tmpDir, layout, null, null );
-        
-        cs.getLocalRepository();
-        csControl.setReturnValue( lr, MockControl.ZERO_OR_MORE );
-        
-        cs.getRemoteRepositories();
-        csControl.setReturnValue( Collections.EMPTY_LIST, MockControl.ZERO_OR_MORE );
-        
-        mm.replayAll();
-        
-        DefaultDependencyResolver resolver = new DefaultDependencyResolver();
-        resolver.setArtifactMetadataSource( ms );
-        resolver.setArtifactCollector( collector );
-        resolver.setArtifactFactory( factory );
-        resolver.setLogger( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
-        
-        Map managedVersionMap = resolver.buildManagedVersionMap( assembly, cs );
-        
-        {
-            Dependency d = d1;
-            Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
-            assertNotNull( a );
-            assertEquals( d.getVersion(), a.getVersion() );
-            assertEquals( d.getScope(), a.getScope() );
-        }
-        
-        {
-            Dependency d = d2;
-            Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
-            assertNotNull( a );
-            assertEquals( d.getVersion(), a.getVersion() );
-            assertEquals( d.getScope(), a.getScope() );
-        }
-        
-        {
-            Dependency d = d3;
-            Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
-            assertNotNull( a );
-            assertEquals( d.getVersion(), a.getVersion() );
-            assertEquals( d.getScope(), a.getScope() );
-        }
-        
-        mm.verifyAll();
-    }
-    
+    // public void test_buildManagedVersionMap_NonTransitiveResolution()
+    // throws ArtifactResolutionException, ArchiveCreationException, InvalidVersionSpecificationException,
+    // InvalidDependencyVersionException
+    // {
+    // Assembly assembly = new Assembly();
+    //
+    // DependencySet ds = new DependencySet();
+    // ds.setScope( Artifact.SCOPE_PROVIDED );
+    // ds.setUseTransitiveDependencies( false );
+    //
+    // assembly.addDependencySet( ds );
+    //
+    // ModuleSet ms = new ModuleSet();
+    // ModuleBinaries mb = new ModuleBinaries();
+    // ms.setBinaries( mb );
+    //
+    // DependencySet mds = new DependencySet();
+    // mds.setScope( Artifact.SCOPE_PROVIDED );
+    // mds.setUseTransitiveDependencies( false );
+    //
+    // mb.addDependencySet( mds );
+    //
+    // assembly.addModuleSet( ms );
+    //
+    // MavenProject project = createMavenProject( "group", "artifact", "1", new File( "base" ) );
+    //
+    // Dependency d1 = new Dependency();
+    // d1.setGroupId( "group.dep" );
+    // d1.setArtifactId( "dep1" );
+    // d1.setVersion( "1" );
+    // d1.setScope( Artifact.SCOPE_COMPILE );
+    //
+    // project.getModel().addDependency( d1 );
+    //
+    // Dependency d2 = new Dependency();
+    // d2.setGroupId( "group.dep" );
+    // d2.setArtifactId( "dep2" );
+    // d2.setVersion( "1" );
+    // d2.setScope( Artifact.SCOPE_PROVIDED );
+    //
+    // project.getModel().addDependency( d2 );
+    //
+    // Dependency d3 = new Dependency();
+    // d3.setGroupId( "group.dep" );
+    // d3.setArtifactId( "dep3" );
+    // d3.setVersion( "1" );
+    // d3.setScope( Artifact.SCOPE_PROVIDED );
+    //
+    // project.getModel().addDependency( d3 );
+    //
+    // MavenProject module = createMavenProject( "group", "module", "1", new File( "base/module" ) );
+    //
+    // project.getModel().addModule( module.getArtifactId() );
+    //
+    // Dependency md = new Dependency();
+    // md.setGroupId( "group.dep" );
+    // md.setArtifactId( "dep3" );
+    // md.setVersion( "2" );
+    // md.setScope( Artifact.SCOPE_PROVIDED );
+    //
+    // module.getModel().addDependency( md );
+    //
+    // List allProjects = new ArrayList();
+    // allProjects.add( project );
+    // allProjects.add( module );
+    //
+    // MockManager mm = new MockManager();
+    //
+    // MockControl csControl = MockControl.createControl( AssemblerConfigurationSource.class );
+    // mm.add( csControl );
+    //
+    // AssemblerConfigurationSource cs = (AssemblerConfigurationSource) csControl.getMock();
+    //
+    // cs.getProject();
+    // csControl.setReturnValue( project, MockControl.ZERO_OR_MORE );
+    //
+    // cs.getReactorProjects();
+    // csControl.setReturnValue( allProjects, MockControl.ZERO_OR_MORE );
+    //
+    // cs.getRemoteRepositories();
+    // csControl.setReturnValue( Collections.EMPTY_LIST, MockControl.ZERO_OR_MORE );
+    //
+    // mm.replayAll();
+    //
+    // DefaultDependencyResolver resolver = new DefaultDependencyResolver();
+    // resolver.setArtifactFactory( factory );
+    // resolver.setLogger( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
+    //
+    // Map managedVersionMap = resolver.buildManagedVersionMap( assembly, cs );
+    //
+    // {
+    // Dependency d = d1;
+    // Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
+    // assertNull( a );
+    // }
+    //
+    // {
+    // Dependency d = d2;
+    // Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
+    // assertNotNull( a );
+    // assertEquals( d.getVersion(), a.getVersion() );
+    // assertEquals( d.getScope(), a.getScope() );
+    // }
+    //
+    // {
+    // Dependency d = d3;
+    // Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
+    // assertNotNull( a );
+    // assertEquals( d.getVersion(), a.getVersion() );
+    // assertEquals( d.getScope(), a.getScope() );
+    // }
+    //
+    // mm.verifyAll();
+    // }
+    //
+    // public void test_buildManagedVersionMap_TransitiveResolution()
+    // throws ArtifactResolutionException, ArchiveCreationException, InvalidVersionSpecificationException,
+    // InvalidDependencyVersionException
+    // {
+    // Assembly assembly = new Assembly();
+    //
+    // DependencySet ds = new DependencySet();
+    // ds.setScope( Artifact.SCOPE_COMPILE );
+    // ds.setUseTransitiveDependencies( true );
+    //
+    // assembly.addDependencySet( ds );
+    //
+    // MavenProject project = createMavenProject( "group", "artifact", "1", new File( "base" ) );
+    //
+    // Dependency d1 = new Dependency();
+    // d1.setGroupId( "group.dep" );
+    // d1.setArtifactId( "dep1" );
+    // d1.setVersion( "1" );
+    // d1.setScope( Artifact.SCOPE_COMPILE );
+    //
+    // project.getModel().addDependency( d1 );
+    //
+    // Dependency d2 = new Dependency();
+    // d2.setGroupId( "group.dep" );
+    // d2.setArtifactId( "dep2" );
+    // d2.setVersion( "1" );
+    // d2.setScope( Artifact.SCOPE_COMPILE );
+    // final Artifact a2 = factory.createArtifact( d2.getGroupId(), d2.getArtifactId(), d2.getVersion(), d2.getScope(),
+    // "jar" );
+    //
+    // project.getModel().addDependency( d2 );
+    //
+    // Dependency d3 = new Dependency();
+    // d3.setGroupId( "group.dep" );
+    // d3.setArtifactId( "dep3" );
+    // d3.setVersion( "1" );
+    // d3.setScope( Artifact.SCOPE_COMPILE );
+    //
+    // project.getModel().addDependency( d3 );
+    //
+    // final Artifact a2a = factory.createArtifact( d3.getGroupId(), d3.getArtifactId(), "2", Artifact.SCOPE_RUNTIME,
+    // "jar" );
+    //
+    // MockManager mm = new MockManager();
+    //
+    // MockControl msControl = MockControl.createControl( ArtifactMetadataSource.class );
+    // mm.add( msControl );
+    //
+    // ArtifactMetadataSource ms = (ArtifactMetadataSource) msControl.getMock();
+    //
+    // try
+    // {
+    // ms.retrieve( null, null, null );
+    // }
+    // catch ( ArtifactMetadataRetrievalException e )
+    // {
+    // }
+    //
+    // msControl.setDefaultReturnValue( new ResolutionGroup( null, Collections.EMPTY_SET, Collections.EMPTY_LIST ) );
+    // msControl.setMatcher( new ArgumentsMatcher()
+    // {
+    // public boolean matches( Object[] expected, Object[] actual )
+    // {
+    // Artifact a = (Artifact) actual[0];
+    //
+    // return a2.getArtifactId().equals( a.getArtifactId() );
+    // }
+    //
+    // public String toString( Object[] args )
+    // {
+    // return "with artifact: " + args[0] ;
+    // }
+    //
+    // } );
+    // msControl.setReturnValue( new ResolutionGroup( a2, Collections.singleton( a2a ), Collections.EMPTY_LIST ) );
+    //
+    //
+    // MockControl csControl = MockControl.createControl( AssemblerConfigurationSource.class );
+    // mm.add( csControl );
+    //
+    // AssemblerConfigurationSource cs = (AssemblerConfigurationSource) csControl.getMock();
+    //
+    // cs.getProject();
+    // csControl.setReturnValue( project, MockControl.ZERO_OR_MORE );
+    //
+    // String tmpDir = System.getProperty( "java.io.tmpdir" );
+    // ArtifactRepository lr = repoFactory.createArtifactRepository( "local", "file://" + tmpDir, layout, null, null );
+    //
+    // cs.getLocalRepository();
+    // csControl.setReturnValue( lr, MockControl.ZERO_OR_MORE );
+    //
+    // cs.getRemoteRepositories();
+    // csControl.setReturnValue( Collections.EMPTY_LIST, MockControl.ZERO_OR_MORE );
+    //
+    // mm.replayAll();
+    //
+    // DefaultDependencyResolver resolver = new DefaultDependencyResolver();
+    // resolver.setArtifactMetadataSource( ms );
+    // resolver.setArtifactCollector( collector );
+    // resolver.setArtifactFactory( factory );
+    // resolver.setLogger( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
+    //
+    // Map managedVersionMap = resolver.buildManagedVersionMap( assembly, cs );
+    //
+    // {
+    // Dependency d = d1;
+    // Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
+    // assertNotNull( a );
+    // assertEquals( d.getVersion(), a.getVersion() );
+    // assertEquals( d.getScope(), a.getScope() );
+    // }
+    //
+    // {
+    // Dependency d = d2;
+    // Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
+    // assertNotNull( a );
+    // assertEquals( d.getVersion(), a.getVersion() );
+    // assertEquals( d.getScope(), a.getScope() );
+    // }
+    //
+    // {
+    // Dependency d = d3;
+    // Artifact a = (Artifact) managedVersionMap.get( d.getManagementKey() );
+    // assertNotNull( a );
+    // assertEquals( d.getVersion(), a.getVersion() );
+    // assertEquals( d.getScope(), a.getScope() );
+    // }
+    //
+    // mm.verifyAll();
+    // }
+
     private void assertRepositoryWithId( String repoId, List repos, boolean shouldExist )
     {
         if ( ( repos == null || repos.isEmpty() ) )
@@ -597,7 +592,7 @@ public class DefaultDependencyResolverTe
                     break;
                 }
             }
-            
+
             if ( shouldExist )
             {
                 assertTrue( "Repository with id: " + repoId + " should be present in repository list.", found );
@@ -612,19 +607,19 @@ public class DefaultDependencyResolverTe
     private MavenProject createMavenProject( String groupId, String artifactId, String version, File basedir )
     {
         Model model = new Model();
-        
+
         model.setGroupId( groupId );
         model.setArtifactId( artifactId );
         model.setVersion( version );
         model.setPackaging( "pom" );
-        
+
         MavenProject project = new MavenProject( model );
-        
+
         Artifact pomArtifact = factory.createProjectArtifact( groupId, artifactId, version );
         project.setArtifact( pomArtifact );
-        
+
         project.setFile( new File( basedir, "pom.xml" ) );
-        
+
         return project;
     }
 

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/format/FileFormatterTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/format/FileFormatterTest.java?rev=999602&r1=999601&r2=999602&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/format/FileFormatterTest.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/format/FileFormatterTest.java Tue Sep 21 20:26:56 2010
@@ -19,25 +19,25 @@ package org.apache.maven.plugin.assembly
  * under the License.
  */
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Model;
 import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
 import org.apache.maven.plugin.assembly.testutils.MockManager;
 import org.apache.maven.plugin.assembly.testutils.TestFileManager;
 import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.logging.console.ConsoleLogger;
-import org.codehaus.plexus.PlexusTestCase;
 import org.easymock.MockControl;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 public class FileFormatterTest
-    extends PlexusTestCase
+extends PlexusTestCase
 {
 
     private Logger logger = new ConsoleLogger( Logger.LEVEL_DEBUG, "test" );
@@ -51,7 +51,7 @@ public class FileFormatterTest
     private MockControl configSourceControl;
 
     public void setUp()
-        throws Exception
+    throws Exception
     {
         super.setUp();
 
@@ -62,13 +62,13 @@ public class FileFormatterTest
     }
 
     public void tearDown()
-        throws IOException
+    throws IOException
     {
         fileManager.cleanUp();
     }
 
     public void testTemporaryRootDirectoryNotExist()
-        throws IOException, AssemblyFormattingException
+    throws IOException, AssemblyFormattingException
     {
         File basedir = fileManager.createTempDir();
         File tempRoot = new File(basedir, "tempdir");
@@ -88,7 +88,7 @@ public class FileFormatterTest
     }
 
     public void testShouldNotTransformOneFile()
-        throws IOException, AssemblyFormattingException
+    throws IOException, AssemblyFormattingException
     {
         File basedir = fileManager.createTempDir();
 
@@ -118,7 +118,7 @@ public class FileFormatterTest
 
     // TODO: Should not be appending line-ending at the end if there is none in the source.
     public void testShouldConvertCRLFLineEndingsInFile()
-        throws IOException, AssemblyFormattingException
+    throws IOException, AssemblyFormattingException
     {
         File basedir = fileManager.createTempDir();
 
@@ -138,7 +138,7 @@ public class FileFormatterTest
 
     // TODO: Should not be appending line-ending at the end if there is none in the source.
     public void testShouldConvertLFLineEndingsInFile()
-        throws IOException, AssemblyFormattingException
+    throws IOException, AssemblyFormattingException
     {
         File basedir = fileManager.createTempDir();
 
@@ -157,7 +157,7 @@ public class FileFormatterTest
     }
 
     public void testShouldFilterProjectExpressionInFile()
-        throws Exception
+    throws Exception
     {
         File basedir = fileManager.createTempDir();
 
@@ -175,57 +175,57 @@ public class FileFormatterTest
     }
 
     public void testShouldFilterExpressionInPropertiesFileWithWindowsEscapes()
-        throws Exception
+    throws Exception
     {
 
-       File sourceDir = fileManager.createTempDir();
-       MavenProject project = createBasicMavenProject();
-       Build build = new Build();
-       
-       // project.build.outputDirectory = C:\out\deeper
-       build.setOutputDirectory( "C:\\out\\deeper" );
-       project.setBuild(build);
-       
-       enableBasicFilteringConfiguration( project, sourceDir );
+        File sourceDir = fileManager.createTempDir();
+        MavenProject project = createBasicMavenProject();
+        Build build = new Build();
 
-       File file = fileManager.createFile(sourceDir, "one.properties", "out=${project.build.outputDirectory}");
+        // project.build.outputDirectory = C:\out\deeper
+        build.setOutputDirectory( "C:\\out\\deeper" );
+        project.setBuild(build);
 
-       mockManager.replayAll();
+        enableBasicFilteringConfiguration( project, sourceDir );
 
-       File result = new FileFormatter(configSource, logger).format(file, true, null);
+        File file = fileManager.createFile(sourceDir, "one.properties", "out=${project.build.outputDirectory}");
 
-       // expect: C\:\\out\\deeper
-       assertEquals("out=C\\:\\\\out\\\\deeper",fileManager.getFileContents(result));
+        mockManager.replayAll();
+
+        File result = new FileFormatter(configSource, logger).format(file, true, null);
 
-       mockManager.verifyAll();
-   }
+        // expect: C:\\out\\deeper
+        assertEquals( "out=C:\\\\out\\\\deeper", fileManager.getFileContents( result ) );
+
+        mockManager.verifyAll();
+    }
 
     public void testShouldFilterExpressionInPropertiesFileWithoutWindowsEscapes()
-        throws Exception
+    throws Exception
     {
 
-       File sourceDir = fileManager.createTempDir();
-       MavenProject project = createBasicMavenProject();
-       Build build = new Build();
-       build.setOutputDirectory( "C:\\out\\deeper" );
-       project.setBuild(build);
-     
-       enableBasicFilteringConfiguration( project, sourceDir );
+        File sourceDir = fileManager.createTempDir();
+        MavenProject project = createBasicMavenProject();
+        Build build = new Build();
+        build.setOutputDirectory( "C:\\out\\deeper" );
+        project.setBuild(build);
 
-       File file = fileManager.createFile(sourceDir, "one.txt", "project.basedirA=${project.build.outputDirectory}");
+        enableBasicFilteringConfiguration( project, sourceDir );
 
-       mockManager.replayAll();
+        File file = fileManager.createFile(sourceDir, "one.txt", "project.basedirA=${project.build.outputDirectory}");
 
-       File result = new FileFormatter(configSource, logger).format(file, true, null);
+        mockManager.replayAll();
 
-       assertEquals("project.basedirA=C:\\out\\deeper",fileManager.getFileContents(result));
+        File result = new FileFormatter(configSource, logger).format(file, true, null);
 
-       mockManager.verifyAll();
+        assertEquals("project.basedirA=C:\\out\\deeper",fileManager.getFileContents(result));
+
+        mockManager.verifyAll();
     }
 
-    
+
     public void testShouldFilterExpressionFromFiltersFileInFile()
-        throws Exception
+    throws Exception
     {
         File basedir = fileManager.createTempDir();
 
@@ -243,49 +243,49 @@ public class FileFormatterTest
 
         mockManager.verifyAll();
     }
-    
+
     public void testShouldFilterExpressionFromFiltersFileInPropertiesFileWithoutWindowsEscapes()
-        throws Exception
+    throws Exception
     {
-       File basedir = fileManager.createTempDir();
+        File basedir = fileManager.createTempDir();
 
-       File filterProps = fileManager.createFile( basedir, "filter.properties", "property=C:\\\\Test" );
+        File filterProps = fileManager.createFile( basedir, "filter.properties", "property=C:\\\\Test" );
 
-       enableBasicFilteringConfiguration( basedir, Collections.singletonList( filterProps.getCanonicalPath() ) );
+        enableBasicFilteringConfiguration( basedir, Collections.singletonList( filterProps.getCanonicalPath() ) );
 
-       File file = fileManager.createFile( basedir, "one.properties", "project: ${property} @property@." );
+        File file = fileManager.createFile( basedir, "one.properties", "project: ${property} @property@." );
 
-       mockManager.replayAll();
+        mockManager.replayAll();
 
-       File result = new FileFormatter( configSource, logger ).format( file, true, null );
+        File result = new FileFormatter( configSource, logger ).format( file, true, null );
 
-       assertEquals( "project: C\\:\\\\Test C\\:\\\\Test.", fileManager.getFileContents( result ) );
+        assertEquals( "project: C:\\\\Test C:\\\\Test.", fileManager.getFileContents( result ) );
 
-       mockManager.verifyAll();
+        mockManager.verifyAll();
     }
 
     public void testShouldFilterExpressionFromFiltersFileInNonPropertiesFileWithoutWindowsEscapes()
-        throws Exception
+    throws Exception
     {
-       File basedir = fileManager.createTempDir();
+        File basedir = fileManager.createTempDir();
 
-       File filterProps = fileManager.createFile( basedir, "filter.properties", "property=C:\\\\Test" );
+        File filterProps = fileManager.createFile( basedir, "filter.properties", "property=C:\\\\Test" );
 
-       enableBasicFilteringConfiguration( basedir, Collections.singletonList( filterProps.getCanonicalPath() ) );
+        enableBasicFilteringConfiguration( basedir, Collections.singletonList( filterProps.getCanonicalPath() ) );
 
-       File file = fileManager.createFile( basedir, "one.txt", "This is a test for project: ${property} @property@." );
+        File file = fileManager.createFile( basedir, "one.txt", "This is a test for project: ${property} @property@." );
 
-       mockManager.replayAll();
+        mockManager.replayAll();
 
-       File result = new FileFormatter( configSource, logger ).format( file, true, null );
+        File result = new FileFormatter( configSource, logger ).format( file, true, null );
 
-       assertEquals( "This is a test for project: C:\\Test C:\\Test.", fileManager.getFileContents( result ) );
+        assertEquals( "This is a test for project: C:\\Test C:\\Test.", fileManager.getFileContents( result ) );
 
-       mockManager.verifyAll();
+        mockManager.verifyAll();
     }
 
     public void testShouldNotIgnoreFirstWordInDotNotationExpressions()
-        throws Exception
+    throws Exception
     {
         File basedir = fileManager.createTempDir();
 
@@ -303,7 +303,7 @@ public class FileFormatterTest
     }
 
     public void testShouldFilterExpressionsFromTwoFiltersFilesInFile()
-        throws Exception
+    throws Exception
     {
         File basedir = fileManager.createTempDir();
 
@@ -317,7 +317,7 @@ public class FileFormatterTest
         enableBasicFilteringConfiguration( basedir, filters );
 
         File file = fileManager.createFile( basedir, "one.txt",
-                                            "property: ${property} @property@ otherProperty: ${otherProperty} @otherProperty@." );
+        "property: ${property} @property@ otherProperty: ${otherProperty} @otherProperty@." );
 
         mockManager.replayAll();
 
@@ -329,7 +329,7 @@ public class FileFormatterTest
     }
 
     public void testShouldOverrideOneFilterValueWithAnotherAndFilterFile()
-        throws Exception
+    throws Exception
     {
         File basedir = fileManager.createTempDir();
 
@@ -354,7 +354,7 @@ public class FileFormatterTest
     }
 
     public void testShouldOverrideProjectValueWithFilterValueAndFilterFile()
-        throws Exception
+    throws Exception
     {
         File basedir = fileManager.createTempDir();
 
@@ -387,7 +387,7 @@ public class FileFormatterTest
     }
 
     private void enableBasicFilteringConfiguration( MavenProject project, File basedir )
-        throws Exception
+    throws Exception
     {
         configSource.getTemporaryRootDirectory();
         configSourceControl.setReturnValue( basedir );
@@ -402,11 +402,11 @@ public class FileFormatterTest
         configSourceControl.setReturnValue( null );
 
         configSource.getFilters();
-        configSourceControl.setReturnValue( null );
+        configSourceControl.setReturnValue( Collections.EMPTY_LIST );
     }
 
     private void enableBasicFilteringConfiguration( File basedir, List filterFilenames )
-        throws Exception
+    throws Exception
     {
         MavenProject project = createBasicMavenProject();
         project.getBuild().setFilters( filterFilenames );

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/format/FileSetFormatterTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/format/FileSetFormatterTest.java?rev=999602&r1=999601&r2=999602&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/format/FileSetFormatterTest.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/format/FileSetFormatterTest.java Tue Sep 21 20:26:56 2010
@@ -19,7 +19,6 @@ package org.apache.maven.plugin.assembly
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.maven.model.Model;
 import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
 import org.apache.maven.plugin.assembly.model.FileSet;
@@ -27,10 +26,10 @@ import org.apache.maven.plugin.assembly.
 import org.apache.maven.plugin.assembly.testutils.TestFileManager;
 import org.apache.maven.plugin.assembly.utils.AssemblyFileUtils;
 import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.logging.console.ConsoleLogger;
 import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.PlexusTestCase;
 import org.easymock.MockControl;
 
 import java.io.File;
@@ -39,7 +38,7 @@ import java.util.Collections;
 import java.util.List;
 
 public class FileSetFormatterTest
-    extends PlexusTestCase
+extends PlexusTestCase
 {
 
     private MockManager mockManager;
@@ -53,7 +52,7 @@ public class FileSetFormatterTest
     private MockControl configSourceControl;
 
     public void setUp()
-        throws Exception
+    throws Exception
     {
         super.setUp();
 
@@ -70,13 +69,13 @@ public class FileSetFormatterTest
     }
 
     public void tearDown()
-        throws IOException
+    throws IOException
     {
         fileManager.cleanUp();
     }
 
     public void testShouldReturnOriginalUnalteredDirectoryWhenLineEndingIsNull()
-        throws AssemblyFormattingException, IOException
+    throws AssemblyFormattingException, IOException
     {
         FileSet fs = new FileSet();
 
@@ -90,7 +89,7 @@ public class FileSetFormatterTest
     }
 
     public void testShouldReturnOriginalUnalteredDirectoryWhenLineEndingIsKeep()
-        throws AssemblyFormattingException, IOException
+    throws AssemblyFormattingException, IOException
     {
         FileSet fs = new FileSet();
         fs.setLineEnding( AssemblyFileUtils.LINE_ENDING_KEEP );
@@ -105,7 +104,7 @@ public class FileSetFormatterTest
     }
 
     public void testShouldReturnOriginalUnalteredDirectoryWhenIncludedFileSetIsEmpty()
-        throws AssemblyFormattingException, IOException
+    throws AssemblyFormattingException, IOException
     {
         File dir = fileManager.createTempDir();
 
@@ -123,7 +122,7 @@ public class FileSetFormatterTest
     }
 
     public void testShouldConvertLineEndingsOnTwoFiles()
-        throws AssemblyFormattingException, IOException
+    throws AssemblyFormattingException, IOException
     {
         File dir = fileManager.createTempDir();
 
@@ -157,7 +156,7 @@ public class FileSetFormatterTest
     }
 
     public void testShouldConvertLineEndingsOnOneFileWithAnotherExplicitlyExcluded()
-        throws AssemblyFormattingException, IOException
+    throws AssemblyFormattingException, IOException
     {
         File dir = fileManager.createTempDir();
 
@@ -191,7 +190,7 @@ public class FileSetFormatterTest
     }
 
     public void testShouldConvertLineEndingsOnOneExplicitlyIncludedFile()
-        throws AssemblyFormattingException, IOException
+    throws AssemblyFormattingException, IOException
     {
         File dir = fileManager.createTempDir();
 
@@ -224,7 +223,7 @@ public class FileSetFormatterTest
     }
 
     public void testShouldConvertLineEndingsOnOneFileAndIgnoreFileWithinDefaultExcludedDir()
-        throws AssemblyFormattingException, IOException
+    throws AssemblyFormattingException, IOException
     {
         File dir = fileManager.createTempDir();
 
@@ -257,7 +256,7 @@ public class FileSetFormatterTest
     }
 
     public void testShouldFilterSeveralFiles()
-        throws Exception
+    throws Exception
     {
         File basedir = fileManager.createTempDir();
 
@@ -298,7 +297,7 @@ public class FileSetFormatterTest
     }
 
     private void enableBasicFilteringConfiguration( File basedir, List filterFilenames )
-        throws Exception
+    throws Exception
     {
         configSource.getTemporaryRootDirectory();
         configSourceControl.setReturnValue( basedir );
@@ -321,7 +320,7 @@ public class FileSetFormatterTest
         configSourceControl.setReturnValue( null, MockControl.ONE_OR_MORE );
 
         configSource.getFilters();
-        configSourceControl.setReturnValue( null, MockControl.ONE_OR_MORE );
+        configSourceControl.setReturnValue( Collections.EMPTY_LIST, MockControl.ONE_OR_MORE );
     }
 
 }