maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r546341 - in /maven/plugins/trunk/maven-dependency-plugin/src: main/java/org/apache/maven/plugin/dependency/ main/java/org/apache/maven/plugin/dependency/utils/filters/ site/apt/ test/java/org/apache/maven/plugin/dependency/ test/java/org/a...
Date Tue, 12 Jun 2007 00:57:02 GMT
Author: brianf
Date: Mon Jun 11 17:57:01 2007
New Revision: 546341

URL: http://svn.apache.org/viewvc?view=rev&rev=546341
Log:
MDEP-96: allow includes and excludes in the same filter

Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/AbstractArtifactFeatureFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/AbstractArtifactFeatureFilterTestCase.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestArtifactFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestGroupIdFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTypeFilter.java

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java?view=diff&rev=546341&r1=546340&r2=546341
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
Mon Jun 11 17:57:01 2007
@@ -71,7 +71,7 @@
 
     /**
      * Comma Separated list of Types to exclude. Empty String indicates don't
-     * exclude anything (default). Ignored if includeTypes is used.
+     * exclude anything (default).
      * 
      * @since 2.0
      * @parameter expression="${excludeTypes}" default-value=""
@@ -89,8 +89,7 @@
     protected String includeScope;
 
     /**
-     * Scope to exclude. An Empty string indicates no scopes (default). Ignored
-     * if includeScope is used.
+     * Scope to exclude. An Empty string indicates no scopes (default).
      * 
      * @since 2.0
      * @parameter expression="${excludeScope}" default-value=""
@@ -110,7 +109,7 @@
 
     /**
      * Comma Separated list of Classifiers to exclude. Empty String indicates
-     * don't exclude anything (default). Ignored if includeClassifiers is used.
+     * don't exclude anything (default).
      * 
      * @since 2.0
      * @parameter expression="${excludeClassifiers}" default-value=""
@@ -138,8 +137,7 @@
     protected String type;
 
     /**
-     * Comma Seperated list of Artifact names too exclude. Ignored if
-     * includeArtifacts is used.
+     * Comma separated list of Artifact names too exclude.
      * 
      * @since 2.0
      * @optional
@@ -148,7 +146,7 @@
     protected String excludeArtifactIds;
 
     /**
-     * Comma Seperated list of Artifact names to include.
+     * Comma separated list of Artifact names to include.
      * 
      * @since 2.0
      * @optional
@@ -157,8 +155,7 @@
     protected String includeArtifactIds;
 
     /**
-     * Comma Seperated list of GroupId Names to exclude. Ignored if
-     * includeGroupsIds is used.
+     * Comma separated list of GroupId Names to exclude.
      * 
      * @since 2.0
      * @optional
@@ -167,7 +164,7 @@
     protected String excludeGroupIds;
 
     /**
-     * Comma Seperated list of GroupIds to include.
+     * Comma separated list of GroupIds to include.
      * 
      * @since 2.0
      * @optional

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/AbstractArtifactFeatureFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/AbstractArtifactFeatureFilter.java?view=diff&rev=546341&r1=546340&r2=546341
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/AbstractArtifactFeatureFilter.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/AbstractArtifactFeatureFilter.java
Mon Jun 11 17:57:01 2007
@@ -30,11 +30,13 @@
 import org.codehaus.plexus.util.StringUtils;
 
 /**
- * This is the common base class of ClassifierFilter and TypeFilter
+ * This is the common base class of ClassifierFilter and
+ * TypeFilter
  * 
- * @author <a href="richardv@mxtelecom.com">Richard van der Hoff</a>
- * @version $Id: AbstractArtifactFeatureFilter.java 522374 2007-03-25 22:58:03Z
- *          brianf $
+ * @author <a href="richardv@mxtelecom.com">Richard van der
+ *         Hoff</a>
+ * @version $Id: AbstractArtifactFeatureFilter.java 522374
+ *          2007-03-25 22:58:03Z brianf $
  */
 public abstract class AbstractArtifactFeatureFilter
     extends AbstractArtifactsFilter
@@ -42,18 +44,27 @@
     /** The list of types or classifiers to include */
     private List includes;
 
-    /** The list of types or classifiers to exclude (ignored if includes != null) */
+    /**
+     * The list of types or classifiers to exclude (ignored
+     * if includes != null)
+     */
     private List excludes;
 
-    /** The configuration string for the include list - comma separated */
+    /**
+     * The configuration string for the include list - comma
+     * separated
+     */
     private String includeString;
 
-    /** The configuration string for the exclude list - comma separated */
+    /**
+     * The configuration string for the exclude list - comma
+     * separated
+     */
     private String excludeString;
 
     /**
-     * The name of the feature we are filtering on - for logging - "Classifiers"
-     * or "Types"
+     * The name of the feature we are filtering on - for
+     * logging - "Classifiers" or "Types"
      */
     private String featureName;
 
@@ -65,11 +76,11 @@
     }
 
     /**
-     * This function determines if filtering needs to be performed. Excludes are
-     * ignored if Includes are used.
+     * This function determines if filtering needs to be
+     * performed. Includes are processed before Excludes.
      * 
-     * @param dependencies
-     *            the set of dependencies to filter.
+     * @param dependencies the set of dependencies to
+     *            filter.
      * 
      * @return a Set of filtered dependencies.
      */
@@ -83,29 +94,27 @@
             log.debug( "Including only " + size + " " + featureName + ( ( size > 1 ) ?
"s" : "" ) + ": "
                 + this.includeString );
 
-            results = filterIncludes( artifacts, this.includes );
+            results = filterIncludes( results, this.includes );
         }
-        else
+
+        if ( this.excludes != null && !this.excludes.isEmpty() )
         {
-            if ( this.excludes != null && !this.excludes.isEmpty() )
-            {
-                int size = excludes.size();
-                log.debug( "Excluding " + size + " " + featureName + ( ( size > 1 ) ?
"s" : "" ) + ": "
-                    + this.excludeString );
-                results = filterExcludes( artifacts, this.excludes );
-            }
+            int size = excludes.size();
+            log.debug( "Excluding " + size + " " + featureName + ( ( size > 1 ) ? "s"
: "" ) + ": "
+                + this.excludeString );
+            results = filterExcludes( results, this.excludes );
         }
+
         return results;
     }
 
     /**
-     * Processes the dependencies list and includes the dependencies that match
-     * a filter in the list.
+     * Processes the dependencies list and includes the
+     * dependencies that match a filter in the list.
      * 
-     * @param depends
-     *            List of dependencies.
-     * @param includes
-     *            List of types or classifiers to include.
+     * @param depends List of dependencies.
+     * @param includes List of types or classifiers to
+     *            include.
      * 
      * @return a set of filtered artifacts.
      */
@@ -122,7 +131,8 @@
             {
                 Artifact artifact = (Artifact) iter.next();
 
-                // if the classifier or type of the artifact matches the feature
+                // if the classifier or type of the artifact
+                // matches the feature
                 // to include, add to the
                 // results
                 if ( compareFeatures( getArtifactFeature( artifact ), include ) )
@@ -135,13 +145,12 @@
     }
 
     /**
-     * Processes the dependencies list and excludes the dependencies that match
-     * a filter in the list.
+     * Processes the dependencies list and excludes the
+     * dependencies that match a filter in the list.
      * 
-     * @param depends
-     *            List of dependencies.
-     * @param excludes
-     *            List of types or classifiers to exclude.
+     * @param depends List of dependencies.
+     * @param excludes List of types or classifiers to
+     *            exclude.
      * 
      * @return a set of filtered artifacts.
      */
@@ -156,7 +165,8 @@
             Artifact artifact = (Artifact) iter.next();
             String artifactFeature = getArtifactFeature( artifact );
 
-            // look through all types or classifiers. If no matches are found
+            // look through all types or classifiers. If no
+            // matches are found
             // then it can be added to the results.
             Iterator excludeIter = theExcludes.iterator();
             while ( excludeIter.hasNext() )
@@ -179,11 +189,11 @@
     }
 
     /**
-     * Should return the type or classifier of the given artifact, so that we
-     * can filter it
+     * Should return the type or classifier of the given
+     * artifact, so that we can filter it
      * 
-     * @param artifact
-     *            artifact to return type or classifier of
+     * @param artifact artifact to return type or classifier
+     *            of
      * @return type or classifier
      */
     protected abstract String getArtifactFeature( Artifact artifact );
@@ -227,10 +237,9 @@
     /**
      * Allows Feature comparison to be customized
      * 
-     * @param lhs
-     *            String artifact's feature
-     * @param rhs
-     *            String feature from exclude or include list
+     * @param lhs String artifact's feature
+     * @param rhs String feature from exclude or include
+     *            list
      * @return boolean true if features match
      */
     protected boolean compareFeatures( String lhs, String rhs )

Modified: maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt?view=diff&rev=546341&r1=546340&r2=546341
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt Mon Jun 11 17:57:01
2007
@@ -157,7 +157,9 @@
    <<<mvn dependency:copy-dependencies -Dclassifer=sources>>> will try
to find
    the sources for all dependencies and copy them.
 
-   	Also included is the ability to include or exclude by type (war, jar etc), scope (runtime,
test, etc), classifier (jdk14, sources, etc), groupId, artifactId, or a combination of them.
NOTE: If you mix includes and excludes of the same category (ie scope), then only the includes
will be used.
+   	Also included is the ability to include or exclude by type (war, jar etc), scope (runtime,
test, etc), classifier (jdk14, sources, etc), groupId, artifactId, or a combination of them.

+   	
+   	NOTE: As of 2.0-alpha-5, you may mix includes and excludes of the same category (ie scope).
Includes are processed before excludes.
 
    See the {{#Overwrite Rules}} section for rules about how overwriting is handled.
 
@@ -305,7 +307,9 @@
    <<<mvn dependency:unpack-dependencies -Dclassifer=sources>>> will try
to find
    the sources for all dependencies and unpack them.
    
-      	Also included is the ability to include or exclude by type (war, jar etc), scope (runtime,
test, etc), classifier (jdk14, sources, etc), groupId, artifactId, or a combination of them.
NOTE: If you mix includes and excludes of the same category (ie scope), then only the includes
will be used.
+      	Also included is the ability to include or exclude by type (war, jar etc), scope (runtime,
test, etc), classifier (jdk14, sources, etc), groupId, artifactId, or a combination of them.

+      	
+      	NOTE: As of 2.0-alpha-5, you may mix includes and excludes of the same category (ie
scope). Includes are processed before excludes.
 
    See the {{#Overwrite Rules}} section for rules about how overwriting is handled.
                                       

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java?view=diff&rev=546341&r1=546340&r2=546341
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java
Mon Jun 11 17:57:01 2007
@@ -173,8 +173,8 @@
         mojo.project.setDependencyArtifacts( new HashSet() );
 
         mojo.includeTypes = "jar";
-        // if include is used, exclude should be ignored.
         mojo.excludeTypes = "jar";
+        //shouldn't get anything.
 
         mojo.execute();
 
@@ -184,10 +184,23 @@
             Artifact artifact = (Artifact) iter.next();
             String fileName = DependencyUtil.getFormattedFileName( artifact, false );
             File file = new File( mojo.outputDirectory, fileName );
+            assertFalse(file.exists() );
+        }
+        
+        mojo.excludeTypes = "";
+        mojo.execute();
+
+        iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
+            File file = new File( mojo.outputDirectory, fileName );
             assertEquals( artifact.getType().equalsIgnoreCase( "jar" ), file.exists() );
         }
     }
 
+    
     public void testExcludeArtifactId()
         throws Exception
     {
@@ -213,9 +226,9 @@
         mojo.project.setDependencyArtifacts( new HashSet() );
 
         mojo.includeArtifactIds = "one";
-        // if include is used, exclude should be ignored.
         mojo.excludeArtifactIds = "one";
-
+        //shouldn't get anything
+        
         mojo.execute();
 
         Iterator iter = mojo.project.getArtifacts().iterator();
@@ -224,6 +237,18 @@
             Artifact artifact = (Artifact) iter.next();
             String fileName = DependencyUtil.getFormattedFileName( artifact, false );
             File file = new File( mojo.outputDirectory, fileName );
+            assertFalse( file.exists() );
+        }
+        
+        mojo.excludeArtifactIds = "";
+        mojo.execute();
+
+        iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
+            File file = new File( mojo.outputDirectory, fileName );
             assertEquals( artifact.getArtifactId().equals( "one" ), file.exists() );
         }
     }
@@ -234,8 +259,8 @@
         mojo.project.setArtifacts( stubFactory.getGroupIdArtifacts() );
         mojo.project.setDependencyArtifacts( new HashSet() );
         mojo.includeGroupIds = "one";
-        // if include is used, exclude should be ignored.
         mojo.excludeGroupIds = "one";
+        //shouldn't get anything
 
         mojo.execute();
 
@@ -245,8 +270,21 @@
             Artifact artifact = (Artifact) iter.next();
             String fileName = DependencyUtil.getFormattedFileName( artifact, false );
             File file = new File( mojo.outputDirectory, fileName );
+            assertFalse(file.exists() );
+        }
+        
+        mojo.excludeGroupIds = "";
+        mojo.execute();
+
+        iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
+            File file = new File( mojo.outputDirectory, fileName );
             assertEquals( artifact.getGroupId().equals( "one" ), file.exists() );
         }
+
     }
 
     public void testExcludeGroupId()
@@ -311,8 +349,8 @@
         mojo.project.setDependencyArtifacts( new HashSet() );
 
         mojo.includeClassifiers = "one";
-        // if include is used, exclude should be ignored.
         mojo.excludeClassifiers = "one";
+        //shouldn't get anything
 
         mojo.execute();
 
@@ -322,8 +360,21 @@
             Artifact artifact = (Artifact) iter.next();
             String fileName = DependencyUtil.getFormattedFileName( artifact, false );
             File file = new File( mojo.outputDirectory, fileName );
+            assertFalse( file.exists() );
+        }
+        
+        mojo.excludeClassifiers = "";
+        mojo.execute();
+
+         iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
+            File file = new File( mojo.outputDirectory, fileName );
             assertEquals( artifact.getClassifier().equals( "one" ), file.exists() );
         }
+
     }
 
     public void testSubPerType()

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java?view=diff&rev=546341&r1=546340&r2=546341
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java
Mon Jun 11 17:57:01 2007
@@ -256,8 +256,8 @@
         mojo.project.setDependencyArtifacts( new HashSet() );
 
         mojo.includeTypes = "jar";
-        // if include is used, exclude should be ignored.
         mojo.excludeTypes = "jar";
+        //shouldn't get anything
 
         mojo.execute();
 
@@ -266,6 +266,17 @@
         {
             Artifact artifact = (Artifact) iter.next();
 
+            assertUnpacked( false, artifact );
+        }
+        
+        mojo.excludeTypes = "";
+        mojo.execute();
+
+        iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+
             assertUnpacked( artifact.getType().equalsIgnoreCase( "jar" ), artifact );
         }
     }
@@ -442,17 +453,26 @@
         mojo.project.setDependencyArtifacts( new HashSet() );
 
         mojo.includeArtifactIds = "one";
-        // if include is used, exclude should be ignored.
         mojo.excludeArtifactIds = "one";
-
+        //shouldn't get anything
         mojo.execute();
 
         Iterator iter = mojo.project.getArtifacts().iterator();
         while ( iter.hasNext() )
         {
             Artifact artifact = (Artifact) iter.next();
+            assertUnpacked( false, artifact );
+        }
+        mojo.excludeArtifactIds ="";
+        mojo.execute();
+
+        iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
             assertUnpacked( artifact.getArtifactId().equals( "one" ), artifact );
         }
+
     }
 
     public void testExcludeArtifactId()
@@ -496,9 +516,9 @@
         mojo.project.setArtifacts( stubFactory.getGroupIdArtifacts() );
         mojo.project.setDependencyArtifacts( new HashSet() );
         mojo.includeGroupIds = "one";
-        // if include is used, exclude should be ignored.
         mojo.excludeGroupIds = "one";
-
+        //shouldn't get anything
+        
         mojo.execute();
 
         Iterator iter = mojo.project.getArtifacts().iterator();
@@ -506,8 +526,20 @@
         {
             Artifact artifact = (Artifact) iter.next();
             // Testing with artifact id because group id is not in filename
+            assertUnpacked( false, artifact );
+        }
+        
+        mojo.excludeGroupIds = "";
+        mojo.execute();
+
+        iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+            // Testing with artifact id because group id is not in filename
             assertUnpacked( artifact.getGroupId().equals( "one" ), artifact );
         }
+        
     }
 
     public void testCDMClassifier()

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/AbstractArtifactFeatureFilterTestCase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/AbstractArtifactFeatureFilterTestCase.java?view=diff&rev=546341&r1=546340&r2=546341
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/AbstractArtifactFeatureFilterTestCase.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/AbstractArtifactFeatureFilterTestCase.java
Mon Jun 11 17:57:01 2007
@@ -103,7 +103,7 @@
         AbstractArtifactFeatureFilter filter = (AbstractArtifactFeatureFilter) createObjectViaReflection(
filterClass,
                                                                                         
                 conArgs );
         Set result = filter.filter( artifacts, log );
-        assertEquals( 2, result.size() );
+        assertEquals( 1, result.size() );
         return result;
     }
 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestArtifactFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestArtifactFilter.java?view=diff&rev=546341&r1=546340&r2=546341
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestArtifactFilter.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestArtifactFilter.java
Mon Jun 11 17:57:01 2007
@@ -61,7 +61,7 @@
         while ( iter.hasNext() )
         {
             Artifact artifact = (Artifact) iter.next();
-            assertTrue( artifact.getArtifactId().equals( "one" ) || artifact.getArtifactId().equals(
"two" ) );
+            assertTrue( artifact.getArtifactId().equals( "two" ));
         }
     }
 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestGroupIdFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestGroupIdFilter.java?view=diff&rev=546341&r1=546340&r2=546341
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestGroupIdFilter.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestGroupIdFilter.java
Mon Jun 11 17:57:01 2007
@@ -95,7 +95,7 @@
         SilentLog log = new SilentLog();
         // include o* from groupIds one,two should leave one
         Set result = filtering();
-        assertTrue( result.size() == 2 );
+        assertEquals( 1, result.size());
         GroupIdFilter filter = new GroupIdFilter( "o", null );
         result = filter.filter( result, log );
         Iterator iter = result.iterator();
@@ -108,7 +108,7 @@
 
         // exclude on* from groupIds one,two should leave two
         result = filtering();
-        assertTrue( result.size() == 2 );
+        assertEquals(1, result.size());
         filter = new GroupIdFilter( null, "on" );
         result = filter.filter( result, log );
         iter = result.iterator();

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTypeFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTypeFilter.java?view=diff&rev=546341&r1=546340&r2=546341
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTypeFilter.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTypeFilter.java
Mon Jun 11 17:57:01 2007
@@ -72,13 +72,13 @@
     {
         TypeFilter filter = new TypeFilter( "war,jar", "war,zip," );
         Set result = filter.filter( artifacts, log );
-        assertEquals( 2, result.size() );
+        assertEquals( 1, result.size() );
 
         Iterator iter = result.iterator();
         while ( iter.hasNext() )
         {
             Artifact artifact = (Artifact) iter.next();
-            assertTrue( artifact.getType().equals( "war" ) || artifact.getType().equals(
"jar" ) );
+            assertTrue( artifact.getType().equals( "jar" ) );
         }
     }
 



Mime
View raw message