Modified: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/WarMojoTest.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/WarMojoTest.java?view=diff&rev=543968&r1=543967&r2=543968
==============================================================================
--- 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/WarMojoTest.java
 (original)
+++ 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/WarMojoTest.java
 Sun Jun  3 12:32:46 2007
@@ -21,7 +21,7 @@
 
 import org.apache.maven.plugin.war.stub.MavenProject4CopyConstructor;
 import org.apache.maven.plugin.war.stub.ProjectHelperStub;
-import org.apache.maven.plugin.war.stub.SimpleWarArtifact4CCStub;
+import org.apache.maven.plugin.war.stub.WarArtifact4CCStub;
 import org.codehaus.plexus.util.IOUtil;
 
 import java.io.File;
@@ -70,7 +70,7 @@
         MavenProject4CopyConstructor project = new 
MavenProject4CopyConstructor();
         String outputDir = getTestDirectory().getAbsolutePath() + "/" + testId 
+ "-output";
         File webAppDirectory = new File( getTestDirectory(), testId );
-        SimpleWarArtifact4CCStub warArtifact = new SimpleWarArtifact4CCStub( 
getBasedir() );
+        WarArtifact4CCStub warArtifact = new WarArtifact4CCStub( getBasedir() 
);
         String warName = "simple";
         File webAppSource = createWebAppSource( testId );
         File classesDir = createClassesDir( testId, true );
@@ -120,7 +120,7 @@
         MavenProject4CopyConstructor project = new 
MavenProject4CopyConstructor();
         String outputDir = getTestDirectory().getAbsolutePath() + "/" + testId 
+ "-output";
         File webAppDirectory = new File( getTestDirectory(), testId );
-        SimpleWarArtifact4CCStub warArtifact = new SimpleWarArtifact4CCStub( 
getBasedir() );
+        WarArtifact4CCStub warArtifact = new WarArtifact4CCStub( getBasedir() 
);
         ProjectHelperStub projectHelper = new ProjectHelperStub();
         String warName = "simple";
         File webAppSource = createWebAppSource( testId );
@@ -172,7 +172,7 @@
         MavenProject4CopyConstructor project = new 
MavenProject4CopyConstructor();
         String outputDir = getTestDirectory().getAbsolutePath() + "/" + testId 
+ "-output";
         File webAppDirectory = new File( getTestDirectory(), testId );
-        SimpleWarArtifact4CCStub warArtifact = new SimpleWarArtifact4CCStub( 
getBasedir() );
+        WarArtifact4CCStub warArtifact = new WarArtifact4CCStub( getBasedir() 
);
         ProjectHelperStub projectHelper = new ProjectHelperStub();
         String warName = "simple";
         File webAppSource = createWebAppSource( testId );
@@ -229,7 +229,7 @@
         MavenProject4CopyConstructor project = new 
MavenProject4CopyConstructor();
         String outputDir = getTestDirectory().getAbsolutePath() + "/" + testId 
+ "-output";
         File webAppDirectory = new File( getTestDirectory(), testId );
-        SimpleWarArtifact4CCStub warArtifact = new SimpleWarArtifact4CCStub( 
getBasedir() );
+        WarArtifact4CCStub warArtifact = new WarArtifact4CCStub( getBasedir() 
);
         ProjectHelperStub projectHelper = new ProjectHelperStub();
         String warName = "simple";
         File webAppSource = createWebAppSource( testId );

Copied: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/WarOverlaysTest.java
 (from r543834, 
maven/plugins/branches/MWAR-97/src/test/java/org/apache/maven/plugin/war/WarOverlaysTest.java)
URL: 
http://svn.apache.org/viewvc/maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/WarOverlaysTest.java?view=diff&rev=543968&p1=maven/plugins/branches/MWAR-97/src/test/java/org/apache/maven/plugin/war/WarOverlaysTest.java&r1=543834&p2=maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/WarOverlaysTest.java&r2=543968
==============================================================================
--- 
maven/plugins/branches/MWAR-97/src/test/java/org/apache/maven/plugin/war/WarOverlaysTest.java
 (original)
+++ 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/WarOverlaysTest.java
 Sun Jun  3 12:32:46 2007
@@ -1,9 +1,26 @@
 package org.apache.maven.plugin.war;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import org.apache.maven.plugin.testing.stubs.ArtifactStub;
-import org.apache.maven.plugin.war.stub.MavenProjectArtifactsStub;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.war.overlay.DefaultOverlay;
 import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;
@@ -196,9 +213,9 @@
 
         // Add the tags
         final List overlays = new ArrayList();
-        overlays.add( new Overlay(overlay1));
-        overlays.add( new Overlay(overlay2));
-        overlays.add( new Overlay(overlay3));
+        overlays.add( new DefaultOverlay(overlay1));
+        overlays.add( new DefaultOverlay(overlay2));
+        overlays.add( new DefaultOverlay(overlay3));
         mojo.setOverlays( overlays);
 
         // current project ignored. Should be on top of the list
@@ -232,12 +249,12 @@
         final List overlays = new ArrayList();
 
         // Add the default project explicitely
-        overlays.add(Overlay.createLocalProjectInstance());
+        overlays.add(Overlay.currentProjectInstance());
 
         // Other overlays
-        overlays.add( new Overlay(overlay1));
-        overlays.add( new Overlay(overlay2));
-        overlays.add( new Overlay(overlay3));
+        overlays.add( new DefaultOverlay(overlay1));
+        overlays.add( new DefaultOverlay(overlay2));
+        overlays.add( new DefaultOverlay(overlay3));
         mojo.setOverlays( overlays);
 
         // current project ignored. Should be on top of the list
@@ -312,23 +329,23 @@
         final File webAppDirectory = setUpMojo( testId, new 
ArtifactStub[]{overlay1, overlay2, overlay3},
                                                 new 
String[]{"org/sample/company/test.jsp", "jsp/b.jsp"} );
 
-        Overlay over1 = new Overlay( overlay3 );
+        Overlay over1 = new DefaultOverlay( overlay3 );
         over1.setExcludes( "**/a.*,**/c.*,**/*.xml" );
 
-        Overlay over2 = new Overlay( overlay1 );
+        Overlay over2 = new DefaultOverlay( overlay1 );
         over2.setIncludes( "jsp/d/*" );
         over2.setExcludes( "jsp/d/a.jsp" );
 
-        Overlay over3 = new Overlay( overlay3 );
+        Overlay over3 = new DefaultOverlay( overlay3 );
         over3.setIncludes( "**/*.jsp" );
 
-        Overlay over4 = new Overlay( overlay2 );
+        Overlay over4 = new DefaultOverlay( overlay2 );
 
         mojo.setOverlays( new LinkedList() );
         mojo.addOverlay( over1 );
         mojo.addOverlay( over2 );
         mojo.addOverlay( over3 );
-        mojo.addOverlay( Overlay.createLocalProjectInstance() );
+        mojo.addOverlay( Overlay.currentProjectInstance() );
         mojo.addOverlay( over4 );
 
         final List assertedFiles = new ArrayList();
@@ -383,24 +400,24 @@
                                                 new 
String[]{"org/sample/company/test.jsp", "jsp/b.jsp"} );
 
 
-        Overlay over1 = new Overlay( overlay3 );
+        Overlay over1 = new DefaultOverlay( overlay3 );
         over1.setExcludes( "**/a.*,**/c.*,**/*.xml,jsp/b.jsp" );
 
-        Overlay over2 = new Overlay( overlay1 );
+        Overlay over2 = new DefaultOverlay( overlay1 );
         over2.setIncludes( "jsp/d/*" );
         over2.setExcludes( "jsp/d/a.jsp" );
 
-        Overlay over3 = new Overlay( overlay3 );
+        Overlay over3 = new DefaultOverlay( overlay3 );
         over3.setIncludes( "**/*.jsp" );
         over3.setExcludes( "jsp/b.jsp" );
 
-        Overlay over4 = new Overlay( overlay2 );
+        Overlay over4 = new DefaultOverlay( overlay2 );
 
         mojo.setOverlays( new LinkedList() );
         mojo.addOverlay( over1 );
         mojo.addOverlay( over2 );
         mojo.addOverlay( over3 );
-        mojo.addOverlay( Overlay.createLocalProjectInstance() );
+        mojo.addOverlay( Overlay.currentProjectInstance() );
         mojo.addOverlay( over4 );
 
         final List assertedFiles = new ArrayList();

Added: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/overlay/OverlayManagerTest.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/overlay/OverlayManagerTest.java?view=auto&rev=543968
==============================================================================
--- 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/overlay/OverlayManagerTest.java
 (added)
+++ 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/overlay/OverlayManagerTest.java
 Sun Jun  3 12:32:46 2007
@@ -0,0 +1,170 @@
+package org.apache.maven.plugin.war.overlay;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.plugin.testing.stubs.ArtifactStub;
+import org.apache.maven.plugin.war.Overlay;
+import org.apache.maven.plugin.war.stub.MavenProjectArtifactsStub;
+import org.apache.maven.plugin.war.stub.WarArtifactStub;
+import org.codehaus.plexus.PlexusTestCase;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Stephane Nicoll
+ */
+public class OverlayManagerTest
+    extends PlexusTestCase
+{
+
+
+    public void testEmptyProject()
+        throws Exception
+    {
+        final MavenProjectArtifactsStub project = new 
MavenProjectArtifactsStub();
+        final List overlays = new ArrayList();
+        try
+        {
+            OverlayManager manager = new OverlayManager( overlays, project );
+            assertNotNull( manager.getOverlays() );
+            assertEquals( 1, manager.getOverlays().size() );
+            assertEquals( Overlay.currentProjectInstance(), 
manager.getOverlays().get( 0 ) );
+        }
+        catch ( InvalidOverlayConfigurationException e )
+        {
+            e.printStackTrace();
+            fail( "Should not have failed to validate a valid overly config " 
+ e.getMessage() );
+        }
+    }
+
+    public void testAutodetectSimpleOverlay()
+        throws Exception
+    {
+
+        final MavenProjectArtifactsStub project = new 
MavenProjectArtifactsStub();
+        final ArtifactStub first = newWarArtifact( "test", "test-webapp" );
+        project.addArtifact( first );
+
+        final List overlays = new ArrayList();
+
+        try
+        {
+            OverlayManager manager = new OverlayManager( overlays, project );
+            assertNotNull( manager.getOverlays() );
+            assertEquals( 2, manager.getOverlays().size() );
+            assertEquals( Overlay.currentProjectInstance(), 
manager.getOverlays().get( 0 ) );
+            assertEquals( new DefaultOverlay( first ), 
manager.getOverlays().get( 1 ) );
+        }
+        catch ( InvalidOverlayConfigurationException e )
+        {
+            e.printStackTrace();
+            fail( "Should not have failed to validate a valid overlay config " 
+ e.getMessage() );
+        }
+    }
+
+    public void testSimpleOverlay()
+        throws Exception
+    {
+
+        final MavenProjectArtifactsStub project = new 
MavenProjectArtifactsStub();
+        final ArtifactStub first = newWarArtifact( "test", "test-webapp" );
+        project.addArtifact( first );
+
+        final List overlays = new ArrayList();
+        overlays.add( new DefaultOverlay( first ) );
+
+        try
+        {
+            OverlayManager manager = new OverlayManager( overlays, project );
+            assertNotNull( manager.getOverlays() );
+            assertEquals( 2, manager.getOverlays().size() );
+            assertEquals( Overlay.currentProjectInstance(), 
manager.getOverlays().get( 0 ) );
+            assertEquals( overlays.get( 0 ), manager.getOverlays().get( 1 ) );
+        }
+        catch ( InvalidOverlayConfigurationException e )
+        {
+            e.printStackTrace();
+            fail( "Should not have failed to validate a valid overlay config " 
+ e.getMessage() );
+        }
+    }
+
+    public void testUnknonwnOverlay()
+        throws Exception
+    {
+
+        final MavenProjectArtifactsStub project = new 
MavenProjectArtifactsStub();
+        final ArtifactStub first = newWarArtifact( "test", "test-webapp" );
+        project.addArtifact( first );
+
+        final List overlays = new ArrayList();
+        overlays.add( new Overlay( "test", "test-webapp-2" ) );
+
+        try
+        {
+            new OverlayManager( overlays, project );
+            fail( "Should have failed to validate an unknown overlay" );
+        }
+        catch ( InvalidOverlayConfigurationException e )
+        {
+            // OK
+        }
+    }
+
+    public void testCustomCurrentProject()
+        throws Exception
+    {
+
+        final MavenProjectArtifactsStub project = new 
MavenProjectArtifactsStub();
+        final ArtifactStub first = newWarArtifact( "test", "test-webapp" );
+        final ArtifactStub second = newWarArtifact( "test", "test-webapp-2" );
+        project.addArtifact( first );
+        project.addArtifact( second );
+
+        final List overlays = new ArrayList();
+        overlays.add( new DefaultOverlay( first ) );
+        overlays.add( Overlay.currentProjectInstance() );
+
+        try
+        {
+            OverlayManager manager = new OverlayManager( overlays, project );
+            assertNotNull( manager.getOverlays() );
+            assertEquals( 3, manager.getOverlays().size() );
+            assertEquals( overlays.get( 0 ), manager.getOverlays().get( 0 ) );
+            assertEquals( Overlay.currentProjectInstance(), 
manager.getOverlays().get( 1 ) );
+            assertEquals( new DefaultOverlay( second ), 
manager.getOverlays().get( 2 ) );
+
+        }
+        catch ( InvalidOverlayConfigurationException e )
+        {
+            e.printStackTrace();
+            fail( "Should not have failed to validate a valid overlay config " 
+ e.getMessage() );
+        }
+    }
+
+
+    protected ArtifactStub newWarArtifact( String groupId, String artifactId )
+    {
+        final ArtifactStub a = new WarArtifactStub( getBasedir() );
+        a.setGroupId( groupId );
+        a.setArtifactId( artifactId );
+        return a;
+    }
+}

Modified: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/AbstractArtifactStub.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/AbstractArtifactStub.java?view=diff&rev=543968&r1=543967&r2=543968
==============================================================================
--- 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/AbstractArtifactStub.java
 (original)
+++ 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/AbstractArtifactStub.java
 Sun Jun  3 12:32:46 2007
@@ -53,4 +53,104 @@
     {
         return new DefaultArtifactHandler( getType() );
     }
+
+    /*
+     * TODO: Coppied from org/apache/maven/artifact/DefaultArtifact.java; 
Consider merging...
+     */
+    public int compareTo( Object o )
+    {
+        Artifact a = (Artifact) o;
+
+        /* -- We need to support groupId=null (it is missing in 
DefaultArtifact.java) */
+        int result;
+        if ( a.getGroupId() != null )
+        {
+            result = getGroupId().compareTo( a.getGroupId() );
+        }
+        else
+        {
+            result = ( getGroupId() == null ? 0 : -1 );
+        }
+        /* -- */
+
+        if ( result == 0 )
+        {
+            result = getArtifactId().compareTo( a.getArtifactId() );
+            if ( result == 0 )
+            {
+                result = getType().compareTo( a.getType() );
+                if ( result == 0 )
+                {
+                    if ( getClassifier() == null )
+                    {
+                        if ( a.getClassifier() != null )
+                        {
+                            result = 1;
+                        }
+                    }
+                    else
+                    {
+                        if ( a.getClassifier() != null )
+                        {
+                            result = getClassifier().compareTo( 
a.getClassifier() );
+                        }
+                        else
+                        {
+                            result = -1;
+                        }
+                    }
+                    if ( result == 0 )
+                    {
+                        // We don't consider the version range in the 
comparison, just the resolved version
+                        result = getVersion().compareTo( a.getVersion() );
+                    }
+                }
+            }
+        }
+        return result;
+    }
+
+    /*
+     * TODO: Coppied from org/apache/maven/artifact/DefaultArtifact.java; 
Consider merging...
+     */
+    public boolean equals( Object o )
+    {
+        if ( o == this )
+        {
+            return true;
+        }
+
+        if ( !( o instanceof Artifact ) )
+        {
+            return false;
+        }
+
+        Artifact a = (Artifact) o;
+
+        /* -- We need to support groupId=null (it is missing in 
DefaultArtifact.java) */
+        if ( a.getGroupId() == null ? ( getGroupId() != null ) : 
a.getGroupId().equals( getGroupId() ) )
+        {
+            return false;
+        }
+        else if ( !a.getArtifactId().equals( getArtifactId() ) )
+        {
+            return false;
+        }
+        else if ( !a.getVersion().equals( getVersion() ) )
+        {
+            return false;
+        }
+        else if ( !a.getType().equals( getType() ) )
+        {
+            return false;
+        }
+        else if ( a.getClassifier() == null ? getClassifier() != null : 
!a.getClassifier().equals( getClassifier() ) )
+        {
+            return false;
+        }
+
+        // We don't consider the version range in the comparison, just the 
resolved version
+
+        return true;
+    }
 }

Modified: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/IncludeExcludeWarArtifactStub.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/IncludeExcludeWarArtifactStub.java?view=diff&rev=543968&r1=543967&r2=543968
==============================================================================
--- 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/IncludeExcludeWarArtifactStub.java
 (original)
+++ 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/IncludeExcludeWarArtifactStub.java
 Sun Jun  3 12:32:46 2007
@@ -22,7 +22,7 @@
 import java.io.File;
 
 public class IncludeExcludeWarArtifactStub
-    extends SimpleWarArtifactStub
+    extends WarArtifactStub
 {
     public IncludeExcludeWarArtifactStub( String id )
     {

Copied: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifact4CCStub.java
 (from r543832, 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifact4CCStub.java)
URL: 
http://svn.apache.org/viewvc/maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifact4CCStub.java?view=diff&rev=543968&p1=maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifact4CCStub.java&r1=543832&p2=maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifact4CCStub.java&r2=543968
==============================================================================
--- 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifact4CCStub.java
 (original)
+++ 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifact4CCStub.java
 Sun Jun  3 12:32:46 2007
@@ -29,10 +29,10 @@
  *  to preven the copy constructor frow blowing up
  *
  */
-public class SimpleWarArtifact4CCStub
-    extends SimpleWarArtifactStub
+public class WarArtifact4CCStub
+    extends WarArtifactStub
 {
-    public SimpleWarArtifact4CCStub( String basedir )
+    public WarArtifact4CCStub( String basedir )
     {
         super( basedir );
     }

Propchange: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifact4CCStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifact4CCStub.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Copied: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifactStub.java
 (from r543832, 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifactStub.java)
URL: 
http://svn.apache.org/viewvc/maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifactStub.java?view=diff&rev=543968&p1=maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifactStub.java&r1=543832&p2=maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifactStub.java&r2=543968
==============================================================================
--- 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifactStub.java
 (original)
+++ 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifactStub.java
 Sun Jun  3 12:32:46 2007
@@ -24,15 +24,16 @@
 /**
  * Stub
  */
-public class SimpleWarArtifactStub
+public class WarArtifactStub
     extends AbstractArtifactStub
 {
 
+    private String groupId;
     private String artifactId;
 
     private File file;
 
-    public SimpleWarArtifactStub( String _basedir )
+    public WarArtifactStub( String _basedir )
     {
         super( _basedir );
     }
@@ -59,6 +60,17 @@
         artifactId = _artifactId;
     }
 
+
+    public String getGroupId()
+    {
+        return groupId;
+    }
+
+    public void setGroupId( String groupId )
+    {
+        this.groupId = groupId;
+    }
+
     public File getFile()
     {
         if ( file == null )
@@ -75,4 +87,6 @@
     {
         file = _file;
     }
+
+
 }

Propchange: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifactStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/stub/WarArtifactStub.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Copied: 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/util/PathSetTest.java
 (from r543834, 
maven/plugins/branches/MWAR-97/src/test/java/org/apache/maven/plugin/war/PathsSetTest.java)
URL: 
http://svn.apache.org/viewvc/maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/util/PathSetTest.java?view=diff&rev=543968&p1=maven/plugins/branches/MWAR-97/src/test/java/org/apache/maven/plugin/war/PathsSetTest.java&r1=543834&p2=maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/util/PathSetTest.java&r2=543968
==============================================================================
--- 
maven/plugins/branches/MWAR-97/src/test/java/org/apache/maven/plugin/war/PathsSetTest.java
 (original)
+++ 
maven/plugins/branches/MWAR-97-2/src/test/java/org/apache/maven/plugin/war/util/PathSetTest.java
 Sun Jun  3 12:32:46 2007
@@ -1,4 +1,23 @@
-package org.apache.maven.plugin.war;
+package org.apache.maven.plugin.war.util;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 
 import junit.framework.TestCase;
 import org.codehaus.plexus.util.StringUtils;
@@ -9,52 +28,52 @@
 import java.util.Iterator;
 import java.util.Set;
 
-public class PathsSetTest
+public class PathSetTest
     extends TestCase
 {
 
     /* --------------- Normalization tests --------------*/
 
     /**
-     * Test method for 
'org.apache.maven.plugin.war.PathsSet.normalizeFilePathStatic(String)'
+     * Test method for 
'org.apache.maven.plugin.war.PathSet.normalizeFilePathStatic(String)'
      */
     public void testNormalizeFilePathStatic()
     {
-        assertEquals( "Normalized path error", "", 
PathsSet.normalizeFilePathStatic( "" ) );
-        assertEquals( "Normalized path error", "", 
PathsSet.normalizeFilePathStatic( "/" ) );
-        assertEquals( "Normalized path error", "", 
PathsSet.normalizeFilePathStatic( "////" ) );
-        assertEquals( "Normalized path error", "", 
PathsSet.normalizeFilePathStatic( "\\" ) );
-        assertEquals( "Normalized path error", "", 
PathsSet.normalizeFilePathStatic( "\\\\\\\\" ) );
-
-        assertEquals( "Normalized path error", "abc", 
PathsSet.normalizeFilePathStatic( "abc" ) );
-        assertEquals( "Normalized path error", "abc", 
PathsSet.normalizeFilePathStatic( "/abc" ) );
-        assertEquals( "Normalized path error", "abc", 
PathsSet.normalizeFilePathStatic( "////abc" ) );
-        assertEquals( "Normalized path error", "abc", 
PathsSet.normalizeFilePathStatic( "\\abc" ) );
-        assertEquals( "Normalized path error", "abc", 
PathsSet.normalizeFilePathStatic( "\\\\\\\\abc" ) );
-
-        assertEquals( "Normalized path error", "abc/def/xyz/", 
PathsSet.normalizeFilePathStatic( "abc/def\\xyz\\" ) );
-        assertEquals( "Normalized path error", "abc/def/xyz/", 
PathsSet.normalizeFilePathStatic( "/abc/def/xyz/" ) );
-        assertEquals( "Normalized path error", "abc/def/xyz/", 
PathsSet.normalizeFilePathStatic( "////abc/def/xyz/" ) );
-        assertEquals( "Normalized path error", "abc/def/xyz/", 
PathsSet.normalizeFilePathStatic( "\\abc/def/xyz/" ) );
+        assertEquals( "Normalized path error", "", 
PathSet.normalizeFilePathStatic( "" ) );
+        assertEquals( "Normalized path error", "", 
PathSet.normalizeFilePathStatic( "/" ) );
+        assertEquals( "Normalized path error", "", 
PathSet.normalizeFilePathStatic( "////" ) );
+        assertEquals( "Normalized path error", "", 
PathSet.normalizeFilePathStatic( "\\" ) );
+        assertEquals( "Normalized path error", "", 
PathSet.normalizeFilePathStatic( "\\\\\\\\" ) );
+
+        assertEquals( "Normalized path error", "abc", 
PathSet.normalizeFilePathStatic( "abc" ) );
+        assertEquals( "Normalized path error", "abc", 
PathSet.normalizeFilePathStatic( "/abc" ) );
+        assertEquals( "Normalized path error", "abc", 
PathSet.normalizeFilePathStatic( "////abc" ) );
+        assertEquals( "Normalized path error", "abc", 
PathSet.normalizeFilePathStatic( "\\abc" ) );
+        assertEquals( "Normalized path error", "abc", 
PathSet.normalizeFilePathStatic( "\\\\\\\\abc" ) );
+
+        assertEquals( "Normalized path error", "abc/def/xyz/", 
PathSet.normalizeFilePathStatic( "abc/def\\xyz\\" ) );
+        assertEquals( "Normalized path error", "abc/def/xyz/", 
PathSet.normalizeFilePathStatic( "/abc/def/xyz/" ) );
+        assertEquals( "Normalized path error", "abc/def/xyz/", 
PathSet.normalizeFilePathStatic( "////abc/def/xyz/" ) );
+        assertEquals( "Normalized path error", "abc/def/xyz/", 
PathSet.normalizeFilePathStatic( "\\abc/def/xyz/" ) );
         assertEquals( "Normalized path error", "abc/def/xyz/",
-                      PathsSet.normalizeFilePathStatic( "\\\\\\\\abc/def/xyz/" 
) );
+                      PathSet.normalizeFilePathStatic( "\\\\\\\\abc/def/xyz/" 
) );
     }
 
     /**
-     * Test method for 
'org.apache.maven.plugin.war.PathsSet.trimTrailingSlashes(String)'
+     * Test method for 
'org.apache.maven.plugin.war.PathSet.trimTrailingSlashes(String)'
      */
     public void testTrimTrailingSlashes()
     {
-        assertEquals( "Trimed path error", "", PathsSet.trimTrailingSlashes( 
"" ) );
-        assertEquals( "Trimed path error", "", PathsSet.trimTrailingSlashes( 
"/" ) );
-        assertEquals( "Trimed path error", "", PathsSet.trimTrailingSlashes( 
"//" ) );
-        assertEquals( "Trimed path error", "\\", PathsSet.trimTrailingSlashes( 
"\\" ) );
-        assertEquals( "Trimed path error", "abc/def\\xyz\\", 
PathsSet.trimTrailingSlashes( "abc/def\\xyz\\" ) );
-        assertEquals( "Trimed path error", "abc/def/xyz/", 
PathsSet.trimTrailingSlashes( "/abc/def/xyz/" ) );
-        assertEquals( "Trimed path error", "abc/def/xyz/", 
PathsSet.trimTrailingSlashes( "////abc/def/xyz/" ) );
-        assertEquals( "Trimed path error", "\\abc/def/xyz\\", 
PathsSet.trimTrailingSlashes( "\\abc/def/xyz\\" ) );
+        assertEquals( "Trimed path error", "", PathSet.trimTrailingSlashes( "" 
) );
+        assertEquals( "Trimed path error", "", PathSet.trimTrailingSlashes( 
"/" ) );
+        assertEquals( "Trimed path error", "", PathSet.trimTrailingSlashes( 
"//" ) );
+        assertEquals( "Trimed path error", "\\", PathSet.trimTrailingSlashes( 
"\\" ) );
+        assertEquals( "Trimed path error", "abc/def\\xyz\\", 
PathSet.trimTrailingSlashes( "abc/def\\xyz\\" ) );
+        assertEquals( "Trimed path error", "abc/def/xyz/", 
PathSet.trimTrailingSlashes( "/abc/def/xyz/" ) );
+        assertEquals( "Trimed path error", "abc/def/xyz/", 
PathSet.trimTrailingSlashes( "////abc/def/xyz/" ) );
+        assertEquals( "Trimed path error", "\\abc/def/xyz\\", 
PathSet.trimTrailingSlashes( "\\abc/def/xyz\\" ) );
         assertEquals( "Trimed path error", "\\\\\\\\abc/def/xyz",
-                      PathsSet.trimTrailingSlashes( "\\\\\\\\abc/def/xyz" ) );
+                      PathSet.trimTrailingSlashes( "\\\\\\\\abc/def/xyz" ) );
     }
 
     /* -------------- Operations tests ------------------*/
@@ -62,36 +81,36 @@
     /**
      * Test method for:
      * <ul>
-     * <li>org.apache.maven.plugin.war.PathsSet.PathsSet()</li>
-     * <li>org.apache.maven.plugin.war.PathsSet.size()</li>
-     * <li>org.apache.maven.plugin.war.PathsSet.add()</li>
-     * <li>org.apache.maven.plugin.war.PathsSet.addAll()</li>
-     * <li>org.apache.maven.plugin.war.PathsSet.iterate()</li>
-     * <li>org.apache.maven.plugin.war.PathsSet.contains()</li>
-     * <li>org.apache.maven.plugin.war.PathsSet.addPrefix(String)</li>
+     * <li>org.apache.maven.plugin.war.PathSet.PathSet()</li>
+     * <li>org.apache.maven.plugin.war.PathSet.size()</li>
+     * <li>org.apache.maven.plugin.war.PathSet.add()</li>
+     * <li>org.apache.maven.plugin.war.PathSet.addAll()</li>
+     * <li>org.apache.maven.plugin.war.PathSet.iterate()</li>
+     * <li>org.apache.maven.plugin.war.PathSet.contains()</li>
+     * <li>org.apache.maven.plugin.war.PathSet.addPrefix(String)</li>
      * </ul>
      */
     public void testPathsSetBasic()
     {
-        PathsSet ps = new PathsSet();
-        assertEquals( "Unexpected PathsSet size", ps.size(), 0 );
+        PathSet ps = new PathSet();
+        assertEquals( "Unexpected PathSet size", ps.size(), 0 );
         Iterator iter = ps.iterator();
         assertNotNull( "Iterator is null", iter );
         assertFalse( "Can iterate on empty set", iter.hasNext() );
 
         ps.add( "abc" );
-        assertEquals( "Unexpected PathsSet size", ps.size(), 1 );
+        assertEquals( "Unexpected PathSet size", ps.size(), 1 );
         ps.add( "abc" );
-        assertEquals( "Unexpected PathsSet size", ps.size(), 1 );
+        assertEquals( "Unexpected PathSet size", ps.size(), 1 );
         ps.add( "xyz/abc" );
-        assertEquals( "Unexpected PathsSet size", ps.size(), 2 );
+        assertEquals( "Unexpected PathSet size", ps.size(), 2 );
         ps.add( "///abc" );
-        assertEquals( "Unexpected PathsSet size", ps.size(), 2 );
+        assertEquals( "Unexpected PathSet size", ps.size(), 2 );
         ps.add( "///xyz\\abc" );
-        assertEquals( "Unexpected PathsSet size", ps.size(), 2 );
+        assertEquals( "Unexpected PathSet size", ps.size(), 2 );
 
         ps.addAll( ps );
-        assertEquals( "Unexpected PathsSet size", ps.size(), 2 );
+        assertEquals( "Unexpected PathSet size", ps.size(), 2 );
 
         int i = 0;
         for ( Iterator iter2 = ps.iterator(); iter2.hasNext(); )
@@ -126,11 +145,11 @@
     /**
      * Test method for:
      * <ul>
-     * <li>org.apache.maven.plugin.war.PathsSet.PathsSet(Collection)</li>
-     * <li>org.apache.maven.plugin.war.PathsSet.PathsSet(String[])</li>
-     * <li>org.apache.maven.plugin.war.PathsSet.Add</li>
-     * <li>org.apache.maven.plugin.war.PathsSet.AddAll(String[],String)</li>
-     * <li>org.apache.maven.plugin.war.PathsSet.AddAll(Collection,String)</li>
+     * <li>org.apache.maven.plugin.war.PathSet.PathSet(Collection)</li>
+     * <li>org.apache.maven.plugin.war.PathSet.PathSet(String[])</li>
+     * <li>org.apache.maven.plugin.war.PathSet.Add</li>
+     * <li>org.apache.maven.plugin.war.PathSet.AddAll(String[],String)</li>
+     * <li>org.apache.maven.plugin.war.PathSet.AddAll(Collection,String)</li>
      * </ul>
      */
     public void testPathsSetAddAlls()
@@ -143,17 +162,17 @@
 
         String[] s2ar = new String[]{"/a/b", "a2/b2/c2", "a2\\b2/c2", 
"//21//22\23a"};
 
-        PathsSet ps1 = new PathsSet( s1set );
-        assertEquals( "Unexpected PathsSet size", 3, ps1.size() );
+        PathSet ps1 = new PathSet( s1set );
+        assertEquals( "Unexpected PathSet size", 3, ps1.size() );
 
-        PathsSet ps2 = new PathsSet( s2ar );
-        assertEquals( "Unexpected PathsSet size", 3, ps2.size() );
+        PathSet ps2 = new PathSet( s2ar );
+        assertEquals( "Unexpected PathSet size", 3, ps2.size() );
 
         ps1.addAll( s2ar );
-        assertEquals( "Unexpected PathsSet size", 5, ps1.size() );
+        assertEquals( "Unexpected PathSet size", 5, ps1.size() );
 
         ps2.addAll( s1set );
-        assertEquals( "Unexpected PathsSet size", 5, ps2.size() );
+        assertEquals( "Unexpected PathSet size", 5, ps2.size() );
 
         for ( Iterator iter = ps1.iterator(); iter.hasNext(); )
         {
@@ -174,10 +193,10 @@
         }
 
         ps1.addAll( s2ar, "/pref/" );
-        assertEquals( "Unexpected PathsSet size", 8, ps1.size() );
+        assertEquals( "Unexpected PathSet size", 8, ps1.size() );
 
         ps2.addAll( s2ar, "/pref/" );
-        assertEquals( "Unexpected PathsSet size", 8, ps2.size() );
+        assertEquals( "Unexpected PathSet size", 8, ps2.size() );
 
         for ( Iterator iter = ps1.iterator(); iter.hasNext(); )
         {
@@ -200,14 +219,14 @@
     }
 
     /**
-     * Test method for 
'org.apache.maven.plugin.war.PathsSet.addAllFilesInDirectory(File, String)'
+     * Test method for 
'org.apache.maven.plugin.war.PathSet.addAllFilesInDirectory(File, String)'
      *
-     * @throws IOException
+     * @throws IOException if an io error occured
      */
     public void testAddAllFilesInDirectory()
         throws IOException
     {
-        PathsSet ps = new PathsSet();
+        PathSet ps = new PathSet();
 
         /* Preparing directory structure*/
         File testDir = new File( "target/testAddAllFilesInDirectory" );
@@ -227,11 +246,11 @@
         d1d2f2.createNewFile();
 
         ps.addAllFilesInDirectory( new File( 
"target/testAddAllFilesInDirectory" ), "123/" );
-        assertEquals( "Unexpected PathsSet size", 4, ps.size() );
+        assertEquals( "Unexpected PathSet size", 4, ps.size() );
 
         /*No changes after adding duplicates*/
         ps.addAllFilesInDirectory( new File( 
"target/testAddAllFilesInDirectory" ), "123/" );
-        assertEquals( "Unexpected PathsSet size", 4, ps.size() );
+        assertEquals( "Unexpected PathSet size", 4, ps.size() );
 
         /*Cleanup*/
 
@@ -240,7 +259,7 @@
 
         /*No changes after adding a subset of files*/
         ps.addAllFilesInDirectory( new File( 
"target/testAddAllFilesInDirectory" ), "123/" );
-        assertEquals( "Unexpected PathsSet size", 4, ps.size() );
+        assertEquals( "Unexpected PathSet size", 4, ps.size() );
 
         d1d2f1.delete();
         d1d2f2.delete();


Reply via email to