maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1633832 [2/2] - in /maven/plugins/trunk/maven-assembly-plugin/src: main/java/org/apache/maven/plugin/assembly/archive/ main/java/org/apache/maven/plugin/assembly/archive/archiver/ main/java/org/apache/maven/plugin/assembly/archive/phase/ m...
Date Thu, 23 Oct 2014 15:03:49 GMT
Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddFileSetsTaskTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddFileSetsTaskTest.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddFileSetsTaskTest.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddFileSetsTaskTest.java
Thu Oct 23 15:03:47 2014
@@ -139,7 +139,7 @@ public class AddFileSetsTaskTest
 
         final int[] modes = { -1, -1, -1, -1 };
 
-        macTask.expectAdditionOfSingleFileSet( null, null, null, true, modes, 1, true, false
);
+        macTask.expectAdditionOfSingleFileSet( null, null, true, modes, 1, true, false );
 
         macTask.expectGetProject( null );
 
@@ -174,7 +174,7 @@ public class AddFileSetsTaskTest
 
         final int[] modes = { -1, -1, -1, -1 };
 
-        macTask.expectAdditionOfSingleFileSet( null, null, null, true, modes, 1, true, false
);
+        macTask.expectAdditionOfSingleFileSet( null, null, true, modes, 1, true, false );
 
         macTask.expectGetProject( null );
 

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/ArtifactMock.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/ArtifactMock.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/ArtifactMock.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/ArtifactMock.java
Thu Oct 23 15:03:47 2014
@@ -86,9 +86,9 @@ public class ArtifactMock
         this( mockManager, groupId, artifactId, version, type, classifier, isSnapshot, baseVersion,
null );
     }
 
-    public ArtifactMock( final MockManager mockManager, final String groupId, final String
artifactId,
-                         final String version, final String type, final String classifier,
final boolean isSnapshot,
-                         final String baseVersion, String scope )
+    private ArtifactMock( final MockManager mockManager, final String groupId, final String
artifactId,
+                          final String version, final String type, final String classifier,
final boolean isSnapshot,
+                          final String baseVersion, String scope )
     {
         artifactCtl = MockControl.createControl( Artifact.class );
 
@@ -133,17 +133,12 @@ public class ArtifactMock
         setTypeAndExt( extension );
     }
 
-    public MockControl getArtifactCtl()
-    {
-        return artifactCtl;
-    }
-
     public Artifact getArtifact()
     {
         return artifact;
     }
 
-    public void setArtifactId( final String artifactId )
+    void setArtifactId( final String artifactId )
     {
         if ( ( artifactId != null ) && ( this.artifactId == null ) )
         {
@@ -176,7 +171,7 @@ public class ArtifactMock
         }
     }
 
-    public void setGroupId( final String groupId )
+    void setGroupId( final String groupId )
     {
         if ( ( groupId != null ) && ( this.groupId == null ) )
         {
@@ -187,7 +182,7 @@ public class ArtifactMock
         }
     }
 
-    public void setVersion( final String version )
+    void setVersion( final String version )
     {
         if ( ( version != null ) && ( this.version == null ) )
         {
@@ -215,7 +210,7 @@ public class ArtifactMock
         }
     }
 
-    public void setId( final String id )
+    void setId( final String id )
     {
         if ( ( id != null ) && ( this.id == null ) )
         {
@@ -226,7 +221,7 @@ public class ArtifactMock
         }
     }
 
-    public void setDependencyConflictId( final String id )
+    void setDependencyConflictId( final String id )
     {
         if ( ( id != null ) && ( dependencyConflictId == null ) )
         {
@@ -237,7 +232,7 @@ public class ArtifactMock
         }
     }
 
-    public void setSnapshot( final boolean snapshot )
+    void setSnapshot( final boolean snapshot )
     {
         if ( isSnapshot == null )
         {
@@ -265,7 +260,7 @@ public class ArtifactMock
         return file;
     }
 
-    public void setType( final String type )
+    void setType( final String type )
     {
         setTypeAndExt( type );
     }

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddArtifactTask.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddArtifactTask.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddArtifactTask.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddArtifactTask.java
Thu Oct 23 15:03:47 2014
@@ -24,7 +24,6 @@ import java.util.List;
 
 import junit.framework.Assert;
 
-import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
 import org.apache.maven.plugin.assembly.testutils.MockManager;
 import org.apache.maven.project.MavenProject;
@@ -35,13 +34,13 @@ import org.easymock.MockControl;
 public class MockAndControlForAddArtifactTask
 {
 
-    public Archiver archiver;
+    public final Archiver archiver;
 
-    public MockControl archiverCtl;
+    private final MockControl archiverCtl;
 
     public AssemblerConfigurationSource configSource;
 
-    public MockControl configSourceCtl;
+    private final MockControl configSourceCtl;
 
     private MavenProject project = null;
 
@@ -177,9 +176,4 @@ public class MockAndControlForAddArtifac
         configSourceCtl.setReturnValue( projects, MockControl.ONE_OR_MORE );
     }
 
-    public void expectGetSession( final MavenSession session )
-    {
-        configSource.getMavenSession();
-        configSourceCtl.setReturnValue( session, MockControl.ONE_OR_MORE );
-    }
 }

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddDependencySetsTask.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddDependencySetsTask.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddDependencySetsTask.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddDependencySetsTask.java
Thu Oct 23 15:03:47 2014
@@ -39,23 +39,23 @@ import org.easymock.MockControl;
 public class MockAndControlForAddDependencySetsTask
 {
 
-    public Archiver archiver;
+    public final Archiver archiver;
 
-    public MockControl archiverCtl;
+    private final MockControl archiverCtl;
 
     public AssemblerConfigurationSource configSource;
 
-    public MockControl configSourceCtl;
+    private final MockControl configSourceCtl;
 
     public MockControl dependencyResolverCtl;
 
     public MavenProjectBuilder projectBuilder;
 
-    public MockControl archiverManagerCtl;
+    private final MockControl archiverManagerCtl;
 
     public ArchiverManager archiverManager;
 
-    public MockControl projectBuilderCtl;
+    private final MockControl projectBuilderCtl;
 
     private final MavenProject project;
 

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddFileSetsTask.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddFileSetsTask.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddFileSetsTask.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/testutils/MockAndControlForAddFileSetsTask.java
Thu Oct 23 15:03:47 2014
@@ -35,15 +35,15 @@ import org.easymock.MockControl;
 public class MockAndControlForAddFileSetsTask
 {
 
-    public AssemblerConfigurationSource configSource;
+    public final AssemblerConfigurationSource configSource;
 
-    public MockControl configSourceCtl;
+    private final MockControl configSourceCtl;
 
     public Archiver archiver;
 
     public MockControl archiverCtl;
 
-    public TestFileManager fileManager;
+    private final TestFileManager fileManager;
 
     public File archiveBaseDir;
 
@@ -79,7 +79,7 @@ public class MockAndControlForAddFileSet
         configSourceCtl.setReturnValue( basedir, MockControl.ONE_OR_MORE );
     }
 
-    public void expectModeChanges( int[] modes, int modeChangeCount )
+    void expectModeChanges( int[] modes, int modeChangeCount )
     {
         archiver.getOverrideDirectoryMode();
         archiverCtl.setReturnValue( modes[0] );
@@ -118,13 +118,12 @@ public class MockAndControlForAddFileSet
                                                boolean shouldAddDir, int[] modes, int modeChangeCount,
                                                boolean isDebugEnabled )
     {
-        expectAdditionOfSingleFileSet( project, basedir, finalName, shouldAddDir, modes,
modeChangeCount,
+        expectAdditionOfSingleFileSet( project, finalName, shouldAddDir, modes, modeChangeCount,
                                        isDebugEnabled, true );
 
     }
 
-    public void expectAdditionOfSingleFileSet( MavenProject project, File basedir, String
finalName,
-                                               boolean shouldAddDir, int[] modes, int modeChangeCount,
+    public void expectAdditionOfSingleFileSet( MavenProject project, String finalName, boolean
shouldAddDir, int[] modes, int modeChangeCount,
                                                boolean isDebugEnabled, boolean isProjectUsed
)
     {
         // the logger sends a debug message with this info inside the addFileSet(..) method..

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=1633832&r1=1633831&r2=1633832&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
Thu Oct 23 15:03:47 2014
@@ -31,7 +31,6 @@ import org.apache.maven.artifact.metadat
 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.ArtifactResolver;
 import org.apache.maven.model.Model;
 import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
@@ -62,8 +61,6 @@ public class DefaultDependencyResolverTe
 
     private ArtifactMetadataSource metadataSource;
 
-    private ArtifactCollector collector;
-
     private ConsoleLogger logger;
 
     @Override
@@ -77,7 +74,6 @@ public class DefaultDependencyResolverTe
         factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
         repoFactory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE
);
         layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default"
);
-        collector = (ArtifactCollector) lookup( ArtifactCollector.class.getName() );
         logger = new ConsoleLogger( Logger.LEVEL_DEBUG, "test" );
     }
 

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/filter/ComponentsXmlArchiverFileFilterTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/filter/ComponentsXmlArchiverFileFilterTest.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/filter/ComponentsXmlArchiverFileFilterTest.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/filter/ComponentsXmlArchiverFileFilterTest.java
Thu Oct 23 15:03:47 2014
@@ -57,6 +57,8 @@ import org.jdom.Text;
 import org.jdom.input.SAXBuilder;
 import org.jdom.xpath.XPath;
 
+import javax.annotation.Nonnull;
+
 public class ComponentsXmlArchiverFileFilterTest
     extends TestCase
 {
@@ -80,8 +82,8 @@ public class ComponentsXmlArchiverFileFi
     public void testAddComponentsXml_ShouldAddComponentWithoutRoleHint()
         throws IOException, XmlPullParserException
     {
-        final Reader reader =
-            writeComponentsXml( Collections.singletonList( new ComponentDef( "role", null,
"org.apache.maven.Impl" ) ) );
+        final Reader reader = writeComponentsXml(
+            Collections.singletonList( new ComponentDef( "role", null, "org.apache.maven.Impl"
) ) );
 
         filter.addComponentsXml( reader );
 
@@ -89,18 +91,16 @@ public class ComponentsXmlArchiverFileFi
 
         final Xpp3Dom componentDom = filter.components.get( "role" );
 
-        assertEquals( "role", componentDom.getChild( "role" )
-                                          .getValue() );
+        assertEquals( "role", componentDom.getChild( "role" ).getValue() );
         assertNull( componentDom.getChild( "role-hint" ) );
-        assertEquals( "org.apache.maven.Impl", componentDom.getChild( "implementation" )
-                                                           .getValue() );
+        assertEquals( "org.apache.maven.Impl", componentDom.getChild( "implementation" ).getValue()
);
     }
 
     public void testAddComponentsXml_ShouldAddComponentWithRoleHint()
         throws IOException, XmlPullParserException
     {
-        final Reader reader =
-            writeComponentsXml( Collections.singletonList( new ComponentDef( "role", "hint",
"org.apache.maven.Impl" ) ) );
+        final Reader reader = writeComponentsXml(
+            Collections.singletonList( new ComponentDef( "role", "hint", "org.apache.maven.Impl"
) ) );
 
         filter.addComponentsXml( reader );
 
@@ -108,12 +108,9 @@ public class ComponentsXmlArchiverFileFi
 
         final Xpp3Dom componentDom = filter.components.get( "rolehint" );
 
-        assertEquals( "role", componentDom.getChild( "role" )
-                                          .getValue() );
-        assertEquals( "hint", componentDom.getChild( "role-hint" )
-                                          .getValue() );
-        assertEquals( "org.apache.maven.Impl", componentDom.getChild( "implementation" )
-                                                           .getValue() );
+        assertEquals( "role", componentDom.getChild( "role" ).getValue() );
+        assertEquals( "hint", componentDom.getChild( "role-hint" ).getValue() );
+        assertEquals( "org.apache.maven.Impl", componentDom.getChild( "implementation" ).getValue()
);
     }
 
     public void testAddComponentsXml_ShouldAddTwoComponentsWithRoleHints()
@@ -132,21 +129,15 @@ public class ComponentsXmlArchiverFileFi
 
         Xpp3Dom componentDom = filter.components.get( "rolehint" );
 
-        assertEquals( "role", componentDom.getChild( "role" )
-                                          .getValue() );
-        assertEquals( "hint", componentDom.getChild( "role-hint" )
-                                          .getValue() );
-        assertEquals( "org.apache.maven.Impl", componentDom.getChild( "implementation" )
-                                                           .getValue() );
+        assertEquals( "role", componentDom.getChild( "role" ).getValue() );
+        assertEquals( "hint", componentDom.getChild( "role-hint" ).getValue() );
+        assertEquals( "org.apache.maven.Impl", componentDom.getChild( "implementation" ).getValue()
);
 
         componentDom = filter.components.get( "rolehint2" );
 
-        assertEquals( "role", componentDom.getChild( "role" )
-                                          .getValue() );
-        assertEquals( "hint2", componentDom.getChild( "role-hint" )
-                                           .getValue() );
-        assertEquals( "org.apache.maven.Impl2", componentDom.getChild( "implementation" )
-                                                            .getValue() );
+        assertEquals( "role", componentDom.getChild( "role" ).getValue() );
+        assertEquals( "hint2", componentDom.getChild( "role-hint" ).getValue() );
+        assertEquals( "org.apache.maven.Impl2", componentDom.getChild( "implementation" ).getValue()
);
     }
 
     public void testAddToArchive_ShouldWriteComponentWithoutHintToFile()
@@ -366,11 +357,11 @@ public class ComponentsXmlArchiverFileFi
 
     private static final class ComponentDef
     {
-        String role;
+        final String role;
 
-        String roleHint;
+        final String roleHint;
 
-        String implementation;
+        final String implementation;
 
         ComponentDef( final String role, final String roleHint, final String implementation
)
         {
@@ -393,32 +384,32 @@ public class ComponentsXmlArchiverFileFi
 
         private boolean ignorePermissions;
 
-        public void addDirectory( final File directory )
+        public void addDirectory( final @Nonnull File directory )
             throws ArchiverException
         {
             throw new UnsupportedOperationException( "not supported" );
         }
 
-        public void addDirectory( final File directory, final String prefix )
+        public void addDirectory( final @Nonnull File directory, final String prefix )
             throws ArchiverException
         {
             throw new UnsupportedOperationException( "not supported" );
         }
 
-        public void addDirectory( final File directory, final String[] includes, final String[]
excludes )
+        public void addDirectory( final @Nonnull File directory, final String[] includes,
final String[] excludes )
             throws ArchiverException
         {
             throw new UnsupportedOperationException( "not supported" );
         }
 
-        public void addDirectory( final File directory, final String prefix, final String[]
includes,
+        public void addDirectory( final @Nonnull File directory, final String prefix, final
String[] includes,
                                   final String[] excludes )
             throws ArchiverException
         {
             throw new UnsupportedOperationException( "not supported" );
         }
 
-        public void addFile( final File inputFile, final String destFileName )
+        public void addFile( final @Nonnull File inputFile, final @Nonnull String destFileName
)
             throws ArchiverException
         {
             this.inputFile = inputFile;
@@ -435,7 +426,7 @@ public class ComponentsXmlArchiverFileFi
             return destFileName;
         }
 
-        public void addFile( final File inputFile, final String destFileName, final int permissions
)
+        public void addFile( final @Nonnull File inputFile, final @Nonnull String destFileName,
final int permissions )
             throws ArchiverException
         {
             throw new UnsupportedOperationException( "not supported" );
@@ -475,7 +466,7 @@ public class ComponentsXmlArchiverFileFi
         }
 
         @SuppressWarnings( "rawtypes" )
-        public Map getFiles()
+        public Map<String, ArchiveEntry> getFiles()
         {
             throw new UnsupportedOperationException( "not supported" );
         }
@@ -505,13 +496,13 @@ public class ComponentsXmlArchiverFileFi
             throw new UnsupportedOperationException( "not supported" );
         }
 
-        public void addArchivedFileSet( final File archiveFile )
+        public void addArchivedFileSet( final @Nonnull File archiveFile )
             throws ArchiverException
         {
             throw new UnsupportedOperationException( "not supported" );
         }
 
-        public void addArchivedFileSet( final File archiveFile, final String prefix )
+        public void addArchivedFileSet( final @Nonnull File archiveFile, final String prefix
)
             throws ArchiverException
         {
             throw new UnsupportedOperationException( "not supported" );
@@ -523,7 +514,7 @@ public class ComponentsXmlArchiverFileFi
             throw new UnsupportedOperationException( "not supported" );
         }
 
-        public void addArchivedFileSet( final File archiveFile, final String prefix, final
String[] includes,
+        public void addArchivedFileSet( final @Nonnull File archiveFile, final String prefix,
final String[] includes,
                                         final String[] excludes )
             throws ArchiverException
         {
@@ -555,7 +546,7 @@ public class ComponentsXmlArchiverFileFi
             throw new UnsupportedOperationException( "not supported" );
         }
 
-        public void addFileSet( final FileSet fileSet )
+        public void addFileSet( final @Nonnull FileSet fileSet )
             throws ArchiverException
         {
             throw new UnsupportedOperationException( "not supported" );
@@ -573,7 +564,9 @@ public class ComponentsXmlArchiverFileFi
             throw new UnsupportedOperationException( "not supported" );
         }
 
-        public ResourceIterator getResources()
+        public
+        @Nonnull
+        ResourceIterator getResources()
             throws ArchiverException
         {
             return new ResourceIterator()

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=1633832&r1=1633831&r2=1633832&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
Thu Oct 23 15:03:47 2014
@@ -19,13 +19,6 @@ package org.apache.maven.plugin.assembly
  * under the License.
  */
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-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;
@@ -37,6 +30,13 @@ import org.codehaus.plexus.logging.Logge
 import org.codehaus.plexus.logging.console.ConsoleLogger;
 import org.easymock.MockControl;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
 public class FileFormatterTest
     extends PlexusTestCase
 {
@@ -187,7 +187,7 @@ public class FileFormatterTest
         build.setOutputDirectory( "C:\\out\\deeper" );
         project.setBuild( build );
 
-        enableBasicFilteringConfiguration( project, sourceDir, true, null );
+        enableBasicFilteringConfiguration( project, sourceDir, null );
 
         final File file = fileManager.createFile( sourceDir, "one.properties", "out=${project.build.outputDirectory}"
);
 
@@ -211,7 +211,7 @@ public class FileFormatterTest
         build.setOutputDirectory( "C:\\out\\deeper" );
         project.setBuild( build );
 
-        enableBasicFilteringConfiguration( project, sourceDir, true, null );
+        enableBasicFilteringConfiguration( project, sourceDir, null );
 
         final File file =
             fileManager.createFile( sourceDir, "one.txt", "project.basedirA=${project.build.outputDirectory}"
);
@@ -507,17 +507,15 @@ public class FileFormatterTest
         return new MavenProject( model );
     }
 
-    private void enableBasicFilteringConfiguration( final MavenProject project, final File
basedir,
-                                                    final boolean useDefault, final List<String>
delimiters )
+    private void enableBasicFilteringConfiguration( final MavenProject project, final File
basedir, final List<String> delimiters )
         throws Exception
     {
 
-        enableFilteringConfiguration( project, basedir, useDefault, delimiters, Collections.<String>
emptyList(), true );
+        enableFilteringConfiguration( project, basedir, delimiters, Collections.<String>
emptyList(), true );
 
     }
 
-    private void enableFilteringConfiguration( final MavenProject project, final File basedir,
-                                               final boolean useDefault, final List<String>
delimiters,
+    private void enableFilteringConfiguration( final MavenProject project, final File basedir,
final List<String> delimiters,
                                                final List<String> filters, final boolean
includeProjectBuildFilters )
         throws Exception
     {
@@ -556,7 +554,7 @@ public class FileFormatterTest
             project.getBuild().setFilters( buildFilterFilenames );
         }
 
-        enableBasicFilteringConfiguration( project, basedir, true, null );
+        enableBasicFilteringConfiguration( project, basedir, null );
     }
 
     private void enableFilteringConfiguration( final File basedir, final List<String>
buildFilterFilenames,
@@ -570,7 +568,7 @@ public class FileFormatterTest
             project.getBuild().setFilters( buildFilterFilenames );
         }
 
-        enableFilteringConfiguration( project, basedir, true, null, configFilterFilenames,
includeProjectBuildFilters );
+        enableFilteringConfiguration( project, basedir, null, configFilterFilenames, includeProjectBuildFilters
);
     }
 
     private void enableBasicFilteringConfiguration( final File basedir, final List<String>
buildFilterFilenames,
@@ -584,6 +582,6 @@ public class FileFormatterTest
             project.getBuild().setFilters( buildFilterFilenames );
         }
 
-        enableBasicFilteringConfiguration( project, basedir, useDefault, delimiters );
+        enableBasicFilteringConfiguration( project, basedir, delimiters );
     }
 }

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/ConfigSourceStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/ConfigSourceStub.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/ConfigSourceStub.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/ConfigSourceStub.java
Thu Oct 23 15:03:47 2014
@@ -172,11 +172,6 @@ public class ConfigSourceStub
         return false;
     }
 
-    public void setArchiverConfig( final String archiverConfig )
-    {
-        this.archiverConfig = archiverConfig;
-    }
-
     public String getArchiverConfig()
     {
         return archiverConfig;

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/TestFileManager.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/TestFileManager.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/TestFileManager.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/TestFileManager.java
Thu Oct 23 15:03:47 2014
@@ -19,6 +19,9 @@ package org.apache.maven.plugin.assembly
  * under the License.
  */
 
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
+
 import java.io.File;
 import java.io.FileReader;
 import java.io.FileWriter;
@@ -27,11 +30,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import junit.framework.Assert;
-
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.IOUtil;
-
 public class TestFileManager
 {
 
@@ -45,8 +43,6 @@ public class TestFileManager
 
     private StackTraceElement callerInfo;
 
-    private Thread cleanupWarning;
-
     private boolean warnAboutCleanup = false;
 
     public TestFileManager( final String baseFilename, final String fileSuffix )
@@ -71,7 +67,7 @@ public class TestFileManager
 
         };
 
-        cleanupWarning = new Thread( warning );
+        Thread cleanupWarning = new Thread( warning );
 
         Runtime.getRuntime()
                .addShutdownHook( cleanupWarning );
@@ -97,12 +93,13 @@ public class TestFileManager
         {
             Thread.sleep( 20 );
         }
-        catch ( final InterruptedException e )
+        catch ( final InterruptedException ignore )
         {
         }
 
         final File dir = new File( TEMP_DIR_PATH, baseFilename + System.currentTimeMillis()
);
 
+        //noinspection ResultOfMethodCallIgnored
         dir.mkdirs();
         markForDeletion( dir );
 
@@ -142,33 +139,10 @@ public class TestFileManager
         warnAboutCleanup = false;
     }
 
-    public void assertFileExistence( final File dir, final String filename, final boolean
shouldExist )
-    {
-        final File file = new File( dir, filename );
-
-        if ( shouldExist )
-        {
-            Assert.assertTrue( file.exists() );
-        }
-        else
-        {
-            Assert.assertFalse( file.exists() );
-        }
-    }
-
-    public void assertFileContents( final File dir, final String filename, final String contentsTest
)
-        throws IOException
-    {
-        assertFileExistence( dir, filename, true );
-
-        final File file = new File( dir, filename );
-
-        Assert.assertEquals( contentsTest, getFileContents( file ) );
-    }
-
     /**
      * NOTE: the file content is written using platform encoding.
      */
+    @SuppressWarnings( "ResultOfMethodCallIgnored" )
     public File createFile( final File dir, final String filename, final String contents
) throws IOException
     {
         final File file = new File( dir, filename );
@@ -224,10 +198,4 @@ public class TestFileManager
         super.finalize();
     }
 
-    public File createFile( final String filename, final String content ) throws IOException
-    {
-        final File dir = createTempDir();
-        return createFile( dir, filename, content );
-    }
-
 }

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/TrackingArchiverStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/TrackingArchiverStub.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/TrackingArchiverStub.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/testutils/TrackingArchiverStub.java
Thu Oct 23 15:03:47 2014
@@ -28,6 +28,7 @@ import java.util.Map;
 
 import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
 import org.apache.maven.plugin.assembly.utils.TypeConversionUtils;
+import org.codehaus.plexus.archiver.ArchiveEntry;
 import org.codehaus.plexus.archiver.ArchivedFileSet;
 import org.codehaus.plexus.archiver.Archiver;
 import org.codehaus.plexus.archiver.ArchiverException;
@@ -38,6 +39,9 @@ import org.codehaus.plexus.components.io
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.logging.console.ConsoleLogger;
 import org.codehaus.plexus.util.StringUtils;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+import javax.annotation.Nonnull;
 
 public class TrackingArchiverStub
     implements Archiver
@@ -45,14 +49,10 @@ public class TrackingArchiverStub
 
     private static final Logger logger = new ConsoleLogger( Logger.LEVEL_DEBUG, "test" );
 
-    public boolean forced;
-
-    public File destFile;
+    private File destFile;
 
     public final List<Addition> added = new ArrayList<Addition>();
 
-    public boolean created;
-
     private boolean useJvmChmod;
 
     private boolean ignorePermissions;
@@ -60,59 +60,58 @@ public class TrackingArchiverStub
     public void createArchive()
         throws ArchiverException, IOException
     {
-        created = true;
     }
 
-    public void addDirectory( final File directory )
+    public void addDirectory( final @Nonnull File directory )
         throws ArchiverException
     {
         added.add( new Addition( directory, null, null, null, -1 ) );
     }
 
-    public void addDirectory( final File directory, final String prefix )
+    public void addDirectory( final @Nonnull File directory, final String prefix )
         throws ArchiverException
     {
         added.add( new Addition( directory, prefix, null, null, -1 ) );
     }
 
-    public void addDirectory( final File directory, final String[] includes, final String[]
excludes )
+    public void addDirectory( final @Nonnull File directory, final String[] includes, final
String[] excludes )
         throws ArchiverException
     {
         added.add( new Addition( directory, null, includes, excludes, -1 ) );
     }
 
-    public void addDirectory( final File directory, final String prefix, final String[] includes,
+    public void addDirectory( final @Nonnull File directory, final String prefix, final String[]
includes,
                               final String[] excludes )
         throws ArchiverException
     {
         added.add( new Addition( directory, prefix, includes, excludes, -1 ) );
     }
 
-    public void addFileSet( final FileSet fileSet )
+    public void addFileSet( final @Nonnull FileSet fileSet )
         throws ArchiverException
     {
         added.add( new Addition( fileSet, null, null, null, -1 ) );
     }
 
-    public void addFile( final File inputFile, final String destFileName )
+    public void addFile( final @Nonnull File inputFile, final @Nonnull String destFileName
)
         throws ArchiverException
     {
         added.add( new Addition( inputFile, destFileName, null, null, -1 ) );
     }
 
-    public void addFile( final File inputFile, final String destFileName, final int permissions
)
+    public void addFile( final @Nonnull File inputFile, final @Nonnull String destFileName,
final int permissions )
         throws ArchiverException
     {
         added.add( new Addition( inputFile, destFileName, null, null, permissions ) );
     }
 
-    public void addArchivedFileSet( final File archiveFile )
+    public void addArchivedFileSet( final @Nonnull File archiveFile )
         throws ArchiverException
     {
         added.add( new Addition( archiveFile, null, null, null, -1 ) );
     }
 
-    public void addArchivedFileSet( final File archiveFile, final String prefix )
+    public void addArchivedFileSet( final @Nonnull File archiveFile, final String prefix
)
         throws ArchiverException
     {
         added.add( new Addition( archiveFile, prefix, null, null, -1 ) );
@@ -137,7 +136,7 @@ public class TrackingArchiverStub
         added.add( new Addition( archiveFile, null, includes, excludes, -1 ) );
     }
 
-    public void addArchivedFileSet( final File archiveFile, final String prefix, final String[]
includes,
+    public void addArchivedFileSet( final @Nonnull File archiveFile, final String prefix,
final String[] includes,
                                     final String[] excludes )
         throws ArchiverException
     {
@@ -273,16 +272,18 @@ public class TrackingArchiverStub
     {
     }
 
-    public ResourceIterator getResources()
+    public
+    @Nonnull
+    ResourceIterator getResources()
         throws ArchiverException
     {
-        return null;
+        throw new NotImplementedException();
     }
 
     @SuppressWarnings( "rawtypes" )
-    public Map getFiles()
+    public Map<String, ArchiveEntry> getFiles()
     {
-        return new HashMap();
+        return new HashMap<String, ArchiveEntry>();
     }
 
     public boolean isForced()
@@ -312,13 +313,18 @@ public class TrackingArchiverStub
     {
         /**
          * {@inheritDoc}
-         * 
+         *
          * @see java.lang.Object#toString()
          */
         @Override
         public String toString()
         {
-            return "Addition (\n    resource= " + resource + "\n    directory= " + directory
+ "\n    destination= " + destination + "\n    permissions= " + permissions + "\n    includes=
" + (includes == null ? "-none-" : StringUtils.join(includes, ", ")) + "\n    excludes= "
+ (excludes == null ? "-none-" : StringUtils.join(excludes, ", ")) + "\n)";
+            return "Addition (\n    resource= " + resource + "\n    directory= " + directory
+ "\n    destination= "
+                + destination + "\n    permissions= " + permissions + "\n    includes= "
+ ( includes == null
+                ? "-none-"
+                : StringUtils.join( includes, ", " ) ) + "\n    excludes= " + ( excludes
== null
+                ? "-none-"
+                : StringUtils.join( excludes, ", " ) ) + "\n)";
         }
 
         public final Object resource;

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/AssemblyFileUtilsTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/AssemblyFileUtilsTest.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/AssemblyFileUtilsTest.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/AssemblyFileUtilsTest.java
Thu Oct 23 15:03:47 2014
@@ -37,7 +37,7 @@ public class AssemblyFileUtilsTest
     extends TestCase
 {
 
-    private TestFileManager fileManager = new TestFileManager( "file-utils.test.", "" );
+    private final TestFileManager fileManager = new TestFileManager( "file-utils.test.",
"" );
 
     public void tearDown()
         throws IOException

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/AssemblyFormatUtilsTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/AssemblyFormatUtilsTest.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/AssemblyFormatUtilsTest.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/AssemblyFormatUtilsTest.java
Thu Oct 23 15:03:47 2014
@@ -774,9 +774,9 @@ public class AssemblyFormatUtilsTest
 
     private final class MockAndControlForGetDistroName
     {
-        MockControl control;
+        final MockControl control;
 
-        AssemblerConfigurationSource configSource;
+        final AssemblerConfigurationSource configSource;
 
         private final String classifier;
 

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/FilterUtilsTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/FilterUtilsTest.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/FilterUtilsTest.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/FilterUtilsTest.java
Thu Oct 23 15:03:47 2014
@@ -357,7 +357,7 @@ public class FilterUtilsTest
     private final class ProjectWithArtifactMockControl
         extends MavenProject
     {
-        ArtifactMockAndControl mac;
+        final ArtifactMockAndControl mac;
 
         ProjectWithArtifactMockControl( final String groupId, final String artifactId, final
List<String> depTrail )
         {
@@ -372,15 +372,15 @@ public class FilterUtilsTest
 
     private final class ArtifactMockAndControl
     {
-        MockControl control;
+        final MockControl control;
 
-        Artifact artifact;
+        final Artifact artifact;
 
-        String groupId;
+        final String groupId;
 
-        String artifactId;
+        final String artifactId;
 
-        List<String> dependencyTrail;
+        final List<String> dependencyTrail;
 
         ArtifactMockAndControl( final String groupId, final String artifactId, final List<String>
dependencyTrail )
         {

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/LineEndingsUtilsTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/LineEndingsUtilsTest.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/LineEndingsUtilsTest.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/LineEndingsUtilsTest.java
Thu Oct 23 15:03:47 2014
@@ -36,9 +36,9 @@ import org.junit.Test;
 public class LineEndingsUtilsTest
 {
 
-    public static final String CRLF = "\r\n";
+    private static final String CRLF = "\r\n";
 
-    public static final String LF = "\n";
+    private static final String LF = "\n";
 
     @Test
     public void shouldWorkCauseWeTestJdkEnumConversion()

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/LinuxLineFeedInputStreamTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/LinuxLineFeedInputStreamTest.java?rev=1633832&r1=1633831&r2=1633832&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/LinuxLineFeedInputStreamTest.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/utils/LinuxLineFeedInputStreamTest.java
Thu Oct 23 15:03:47 2014
@@ -20,13 +20,10 @@ package org.apache.maven.plugin.assembly
  */
 
 import junit.framework.TestCase;
-import org.codehaus.plexus.components.io.resources.LinefeedMode;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 
-import static org.codehaus.plexus.components.io.resources.LinefeedMode.unix;
-
 public class LinuxLineFeedInputStreamTest
     extends TestCase
 {
@@ -34,25 +31,25 @@ public class LinuxLineFeedInputStreamTes
     public void testSimpleString()
         throws Exception
     {
-        assertEquals( "abc\n", roundtrip( "abc", unix ) );
+        assertEquals( "abc\n", roundtrip( "abc" ) );
     }
 
     public void testInTheMiddleOfTheLine()
         throws Exception
     {
-        assertEquals( "a\nbc\n", roundtrip( "a\r\nbc", unix ) );
+        assertEquals( "a\nbc\n", roundtrip( "a\r\nbc" ) );
     }
 
     public void testMultipleBlankLines()
         throws Exception
     {
-        assertEquals( "a\n\nbc\n", roundtrip( "a\r\n\r\nbc", unix ) );
+        assertEquals( "a\n\nbc\n", roundtrip( "a\r\n\r\nbc" ) );
     }
 
     public void testTwoLinesAtEnd()
         throws Exception
     {
-        assertEquals( "a\n\n", roundtrip( "a\r\n\r\n", unix ) );
+        assertEquals( "a\n\n", roundtrip( "a\r\n\r\n" ) );
     }
 
     public void testMalformed()
@@ -68,7 +65,7 @@ public class LinuxLineFeedInputStreamTes
         assertEquals( "a", roundtrip( "a", false ) );
     }
 
-    private String roundtrip( String msg, LinefeedMode linefeedMode )
+    private String roundtrip( String msg )
         throws IOException
     {
         return roundtrip( msg, true );



Mime
View raw message