You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mp...@apache.org on 2007/01/16 16:31:19 UTC
svn commit: r496730 - in /maven/sandbox/maven/patches/MNG-1577/trunk:
maven-artifact/src/main/java/org/apache/maven/artifact/versioning/
maven-project/src/test/java/org/apache/maven/project/inheritance/t04/
maven-project/src/test/java/org/apache/maven/...
Author: mperham
Date: Tue Jan 16 07:31:17 2007
New Revision: 496730
URL: http://svn.apache.org/viewvc?view=rev&rev=496730
Log:
Fix dupe patch application
Modified:
maven/sandbox/maven/patches/MNG-1577/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java
maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t04/ProjectInheritanceTest.java
maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t05/ProjectInheritanceTest.java
maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t06/ProjectInheritanceTest.java
maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t07/ProjectInheritanceTest.java
maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t08/ProjectInheritanceTest.java
maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t09/ProjectInheritanceTest.java
maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t10/ProjectInheritanceTest.java
Modified: maven/sandbox/maven/patches/MNG-1577/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java
URL: http://svn.apache.org/viewvc/maven/sandbox/maven/patches/MNG-1577/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java?view=diff&rev=496730&r1=496729&r2=496730
==============================================================================
--- maven/sandbox/maven/patches/MNG-1577/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java (original)
+++ maven/sandbox/maven/patches/MNG-1577/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java Tue Jan 16 07:31:17 2007
@@ -50,55 +50,3 @@
return buffer.toString();
}
}
-package org.apache.maven.artifact.versioning;
-
-/*
- * 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 java.util.HashMap;
-import java.util.Map;
-import java.util.Iterator;
-
-public class ManagedVersionMap extends HashMap
-{
- public ManagedVersionMap(Map map)
- {
- super();
- if (map != null)
- {
- putAll(map);
- }
- }
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer("ManagedVersionMap\n");
- Iterator iter = this.keySet().iterator();
- while (iter.hasNext())
- {
- String key = (String)iter.next();
- buffer.append(key).append("=").append(get(key));
- if (iter.hasNext())
- {
- buffer.append("\n");
- }
- }
- return buffer.toString();
- }
-}
Modified: maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t04/ProjectInheritanceTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t04/ProjectInheritanceTest.java?view=diff&rev=496730&r1=496729&r2=496730
==============================================================================
--- maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t04/ProjectInheritanceTest.java (original)
+++ maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t04/ProjectInheritanceTest.java Tue Jan 16 07:31:17 2007
@@ -81,86 +81,3 @@
}
}
-package org.apache.maven.project.inheritance.t04;
-
-/*
- * 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 java.io.File;
-import java.util.Set;
-import java.util.Iterator;
-
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase;
-import org.apache.maven.artifact.Artifact;
-
-/**
- * Verifies the version of a dependency listed in a parent's
- * dependencyManagement section is chosen over another version of the same
- * dependency, listed transitively.
- *
- * @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
- * @version $Id$
- */
-public class ProjectInheritanceTest
- extends AbstractProjectInheritanceTestCase
-{
- // ----------------------------------------------------------------------
- //
- // p1 inherits from p0
- // p0 inhertis from super model
- //
- // or we can show it graphically as:
- //
- // p1 ---> p0 --> super model
- //
- // p1 has a depMgmt section that specifies versions 1.0 of jars "a" & "b"
- // jar "a" has a transitive dependency on 2.0 of jar "b", but maven should
- // prefer to use version 1.0.
- //
- // ----------------------------------------------------------------------
-
- public void testDependencyManagementOverridesTransitiveDependencyVersion()
- throws Exception
- {
- File localRepo = getLocalRepositoryPath();
- File pom0 = new File( localRepo, "p0/pom.xml" );
- File pom0Basedir = pom0.getParentFile();
- File pom1 = new File( pom0Basedir, "p1/pom.xml" );
-
- // load the child project, which inherits from p0...
- MavenProject project0 = getProjectWithDependencies( pom0 );
- MavenProject project1 = getProjectWithDependencies( pom1 );
-
- assertEquals( pom0Basedir, project1.getParent().getBasedir() );
- Set set = project1.getArtifacts();
- assertNotNull("No artifacts", set);
- assertTrue("No Artifacts", set.size() > 0);
- assertTrue("Set size should be 3, is " + set.size(), set.size() == 3);
-
- Iterator iter = set.iterator();
- while (iter.hasNext()) {
- Artifact artifact = (Artifact)iter.next();
- System.out.println("Artifact: " + artifact.getDependencyConflictId() + " " + artifact.getVersion() +
- " Optional=" + (artifact.isOptional() ? "true" : "false"));
- assertTrue("Incorrect version for " + artifact.getDependencyConflictId(), artifact.getVersion().equals("1.0"));
- }
-
- }
-}
Modified: maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t05/ProjectInheritanceTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t05/ProjectInheritanceTest.java?view=diff&rev=496730&r1=496729&r2=496730
==============================================================================
--- maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t05/ProjectInheritanceTest.java (original)
+++ maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t05/ProjectInheritanceTest.java Tue Jan 16 07:31:17 2007
@@ -77,82 +77,3 @@
}
}
-package org.apache.maven.project.inheritance.t05;
-
-/*
- * 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 java.io.File;
-import java.util.Set;
-import java.util.Iterator;
-
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase;
-import org.apache.maven.artifact.Artifact;
-
-/**
- * A test which demonstrates maven's dependency management
- *
- * @author <a href="rgoers@apache.org">Ralph Goers</a>
- * @version $Id$
- */
-public class ProjectInheritanceTest
- extends AbstractProjectInheritanceTestCase
-{
- // ----------------------------------------------------------------------
- //
- // p1 inherits from p0
- // p0 inhertis from super model
- //
- // or we can show it graphically as:
- //
- // p1 ---> p0 --> super model
- //
- // ----------------------------------------------------------------------
-
- public void testDependencyManagement()
- throws Exception
- {
- File localRepo = getLocalRepositoryPath();
- File pom0 = new File( localRepo, "p0/pom.xml" );
-
- File pom0Basedir = pom0.getParentFile();
-
- File pom1 = new File( pom0Basedir, "p1/pom.xml" );
-
- // load everything...
- MavenProject project0 = getProjectWithDependencies( pom0 );
- MavenProject project1 = getProjectWithDependencies( pom1 );
-
- assertEquals( pom0Basedir, project1.getParent().getBasedir() );
- Set set = project1.getArtifacts();
- assertNotNull("No artifacts", set);
- assertTrue("No Artifacts", set.size() > 0);
- Iterator iter = set.iterator();
-
- while (iter.hasNext())
- {
- Artifact artifact = (Artifact)iter.next();
- System.out.println("Artifact: " + artifact.getDependencyConflictId() + " " +
- artifact.getVersion() + " Scope: " + artifact.getScope());
- assertTrue("Incorrect version for " + artifact.getDependencyConflictId(), artifact.getVersion().equals("1.0"));
- }
-
- }
-}
Modified: maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t06/ProjectInheritanceTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t06/ProjectInheritanceTest.java?view=diff&rev=496730&r1=496729&r2=496730
==============================================================================
--- maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t06/ProjectInheritanceTest.java (original)
+++ maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t06/ProjectInheritanceTest.java Tue Jan 16 07:31:17 2007
@@ -79,84 +79,3 @@
}
}
-package org.apache.maven.project.inheritance.t06;
-
-/*
- * 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 java.io.File;
-import java.util.Set;
-import java.util.Iterator;
-
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase;
-import org.apache.maven.artifact.Artifact;
-
-/**
- * A test which demonstrates maven's dependency management
- *
- * @author <a href="rgoers@apache.org">Ralph Goers</a>
- * @version $Id$
- */
-public class ProjectInheritanceTest
- extends AbstractProjectInheritanceTestCase
-{
- // ----------------------------------------------------------------------
- //
- // p1 inherits from p0
- // p0 inhertis from super model
- //
- // or we can show it graphically as:
- //
- // p1 ---> p0 --> super model
- //
- // ----------------------------------------------------------------------
-
- public void testDependencyManagement()
- throws Exception
- {
- File localRepo = getLocalRepositoryPath();
- File pom0 = new File( localRepo, "p0/pom.xml" );
-
- File pom0Basedir = pom0.getParentFile();
-
- File pom1 = new File( pom0Basedir, "p1/pom.xml" );
-
- // load everything...
- MavenProject project0 = getProjectWithDependencies( pom0 );
- MavenProject project1 = getProjectWithDependencies( pom1 );
-
- assertEquals( pom0Basedir, project1.getParent().getBasedir() );
- System.out.println("Project " + project1.getId() + " " + project1);
- Set set = project1.getArtifacts();
- assertNotNull("No artifacts", set);
- assertTrue("No Artifacts", set.size() > 0);
- Iterator iter = set.iterator();
- assertTrue("Set size should be 4, is " + set.size(), set.size() == 4);
-
- while (iter.hasNext())
- {
- Artifact artifact = (Artifact)iter.next();
- System.out.println("Artifact: " + artifact.getDependencyConflictId() + " " + artifact.getVersion() +
- " Optional=" + (artifact.isOptional() ? "true" : "false"));
- assertTrue("Incorrect version for " + artifact.getDependencyConflictId(), artifact.getVersion().equals("1.0"));
- }
-
- }
-}
Modified: maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t07/ProjectInheritanceTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t07/ProjectInheritanceTest.java?view=diff&rev=496730&r1=496729&r2=496730
==============================================================================
--- maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t07/ProjectInheritanceTest.java (original)
+++ maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t07/ProjectInheritanceTest.java Tue Jan 16 07:31:17 2007
@@ -89,94 +89,3 @@
}
}
-package org.apache.maven.project.inheritance.t07;
-
-/*
- * 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 java.io.File;
-import java.util.List;
-import java.util.Set;
-import java.util.Iterator;
-
-import org.apache.maven.model.Build;
-import org.apache.maven.model.MailingList;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.PluginExecution;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase;
-import org.apache.maven.artifact.Artifact;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.codehaus.plexus.logging.LoggerManager;
-import org.codehaus.plexus.logging.Logger;
-
-/**
- * A test which demonstrates maven's dependency management
- *
- * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id: ProjectInheritanceTest.java 391202 2006-04-04 00:40:13Z jdcasey $
- */
-public class ProjectInheritanceTest
- extends AbstractProjectInheritanceTestCase
-{
- // ----------------------------------------------------------------------
- //
- // p1 inherits from p0
- // p0 inhertis from super model
- //
- // or we can show it graphically as:
- //
- // p1 ---> p0 --> super model
- //
- // ----------------------------------------------------------------------
-
- public void testDependencyManagement()
- throws Exception
- {
- File localRepo = getLocalRepositoryPath();
- File pom0 = new File( localRepo, "p0/pom.xml" );
-
- File pom0Basedir = pom0.getParentFile();
-
- File pom1 = new File( pom0Basedir, "p1/pom.xml" );
-
- // load everything...
- MavenProject project0 = getProjectWithDependencies( pom0 );
- MavenProject project1 = getProjectWithDependencies( pom1 );
-
- assertEquals( pom0Basedir, project1.getParent().getBasedir() );
- System.out.println("Project " + project1.getId() + " " + project1);
- Set set = project1.getArtifacts();
- assertNotNull("No artifacts", set);
- assertTrue("No Artifacts", set.size() > 0);
- Iterator iter = set.iterator();
- assertTrue("Set size should be 3, is " + set.size(), set.size() == 3);
-
- while (iter.hasNext())
- {
- Artifact artifact = (Artifact)iter.next();
- assertFalse("", artifact.getArtifactId().equals("maven-test-d"));
- System.out.println("Artifact: " + artifact.getDependencyConflictId() + " " + artifact.getVersion() +
- " Optional=" + (artifact.isOptional() ? "true" : "false"));
- assertTrue("Incorrect version for " + artifact.getDependencyConflictId(), artifact.getVersion().equals("1.0"));
- }
-
- }
-}
Modified: maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t08/ProjectInheritanceTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t08/ProjectInheritanceTest.java?view=diff&rev=496730&r1=496729&r2=496730
==============================================================================
--- maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t08/ProjectInheritanceTest.java (original)
+++ maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t08/ProjectInheritanceTest.java Tue Jan 16 07:31:17 2007
@@ -79,84 +79,3 @@
}
}
-package org.apache.maven.project.inheritance.t08;
-
-/*
- * 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 java.io.File;
-import java.util.Set;
-import java.util.Iterator;
-
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase;
-import org.apache.maven.artifact.Artifact;
-
-/**
- * A test which demonstrates maven's dependency management
- *
- * @author <a href="rgoers@apache.org">Ralph Goers</a>
- * @version $Id$
- */
-public class ProjectInheritanceTest
- extends AbstractProjectInheritanceTestCase
-{
- // ----------------------------------------------------------------------
- //
- // p1 inherits from p0
- // p0 inhertis from super model
- //
- // or we can show it graphically as:
- //
- // p1 ---> p0 --> super model
- //
- // ----------------------------------------------------------------------
-
- public void testDependencyManagement()
- throws Exception
- {
- File localRepo = getLocalRepositoryPath();
- File pom0 = new File( localRepo, "p0/pom.xml" );
-
- File pom0Basedir = pom0.getParentFile();
-
- File pom1 = new File( pom0Basedir, "p1/pom.xml" );
-
- // load everything...
- MavenProject project0 = getProjectWithDependencies( pom0 );
- MavenProject project1 = getProjectWithDependencies( pom1 );
-
- assertEquals( pom0Basedir, project1.getParent().getBasedir() );
- System.out.println("Project " + project1.getId() + " " + project1);
- Set set = project1.getArtifacts();
- assertNotNull("No artifacts", set);
- assertTrue("No Artifacts", set.size() > 0);
- Iterator iter = set.iterator();
- assertTrue("Set size should be 4, is " + set.size(), set.size() == 4);
-
- while (iter.hasNext())
- {
- Artifact artifact = (Artifact)iter.next();
- System.out.println("Artifact: " + artifact.getDependencyConflictId() + " " + artifact.getVersion() +
- " Optional=" + (artifact.isOptional() ? "true" : "false"));
- assertTrue("Incorrect version for " + artifact.getDependencyConflictId(), artifact.getVersion().equals("1.0"));
- }
-
- }
-}
Modified: maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t09/ProjectInheritanceTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t09/ProjectInheritanceTest.java?view=diff&rev=496730&r1=496729&r2=496730
==============================================================================
--- maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t09/ProjectInheritanceTest.java (original)
+++ maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t09/ProjectInheritanceTest.java Tue Jan 16 07:31:17 2007
@@ -131,136 +131,3 @@
assertTrue( "maven-test-d is not in the project", map.containsKey( "maven-test:maven-test-d" ) );
}
}
-package org.apache.maven.project.inheritance.t09;
-
-/*
- * 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 java.io.File;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Iterator;
-
-import org.apache.maven.model.Build;
-import org.apache.maven.model.MailingList;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.PluginExecution;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase;
-import org.apache.maven.artifact.Artifact;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.codehaus.plexus.logging.LoggerManager;
-import org.codehaus.plexus.logging.Logger;
-
-/**
- * Verifies exclusions listed in dependencyManagement are valid for
- * transitive dependencies.
- *
- * @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
- * @version $Id$
- */
-public class ProjectInheritanceTest
- extends AbstractProjectInheritanceTestCase
-{
- // ----------------------------------------------------------------------
- //
- // p1 inherits from p0
- // p0 inhertis from super model
- //
- // or we can show it graphically as:
- //
- // p1 ---> p0 --> super model
- //
- // ----------------------------------------------------------------------
-
- /**
- * How the test project is set up:
- *
- * 1. dependencyManagement lists dependencies on a & b,
- * with an exclusion on c in b.
- * 2. the child project lists a dependency on project a only
- * 3. a depends on b (which is transitive to the child project),
- * and b depends on c.
- *
- * We should see that the resulting size of collected artifacts is two:
- * a & b only.
- */
- public void testDependencyManagementExclusionsExcludeTransitively()
- throws Exception
- {
- File localRepo = getLocalRepositoryPath();
-
- File pom0 = new File( localRepo, "p0/pom.xml" );
- File pom0Basedir = pom0.getParentFile();
- File pom1 = new File( pom0Basedir, "p1/pom.xml" );
-
- // load the child project, which inherits from p0...
- MavenProject project0 = getProjectWithDependencies( pom0 );
- MavenProject project1 = getProjectWithDependencies( pom1 );
-
- assertEquals( pom0Basedir, project1.getParent().getBasedir() );
- System.out.println("Project " + project1.getId() + " " + project1);
- Map map = project1.getArtifactMap();
-
- assertNotNull("No artifacts", map);
- assertTrue("No Artifacts", map.size() > 0);
- assertTrue("Set size should be 2, is " + map.size(), map.size() == 2);
-
- assertTrue("maven-test-a is not in the project", map.containsKey( "maven-test:maven-test-a" ));
- assertTrue("maven-test-b is not in the project", map.containsKey( "maven-test:maven-test-b" ));
-
- }
-
- /**
- * Setup exactly the same as the above test, except that the child project
- * now depends upon d, which has a transitive dependency on c. Even though
- * we did list an exclusion on c, it was only from within the context of
- * project b. We will pick up project c in this case because no
- * restrictions were placed on d. This demonstrates that a, b, c, & d will
- * all be collected.
- *
- * @throws Exception
- */
- public void testDependencyManagementExclusionDoesNotOverrideGloballyForTransitives()
- throws Exception
- {
- File localRepo = getLocalRepositoryPath();
-
- File pom0 = new File( localRepo, "p0/pom.xml" );
- File pom0Basedir = pom0.getParentFile();
- File pom2 = new File( pom0Basedir, "p2/pom.xml" );
-
- // load the child project, which inherits from p0...
- MavenProject project0 = getProjectWithDependencies( pom0 );
- MavenProject project2 = getProjectWithDependencies( pom2 );
-
- assertEquals( pom0Basedir, project2.getParent().getBasedir() );
- System.out.println( "Project " + project2.getId() + " " + project2 );
- Map map = project2.getArtifactMap();
- assertNotNull( "No artifacts", map );
- assertTrue( "No Artifacts", map.size() > 0 );
- assertTrue( "Set size should be 4, is " + map.size(), map.size() == 4 );
-
- assertTrue( "maven-test-a is not in the project", map.containsKey( "maven-test:maven-test-a" ) );
- assertTrue( "maven-test-b is not in the project", map.containsKey( "maven-test:maven-test-b" ) );
- assertTrue( "maven-test-c is not in the project", map.containsKey( "maven-test:maven-test-c" ) );
- assertTrue( "maven-test-d is not in the project", map.containsKey( "maven-test:maven-test-d" ) );
- }
-}
Modified: maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t10/ProjectInheritanceTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t10/ProjectInheritanceTest.java?view=diff&rev=496730&r1=496729&r2=496730
==============================================================================
--- maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t10/ProjectInheritanceTest.java (original)
+++ maven/sandbox/maven/patches/MNG-1577/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t10/ProjectInheritanceTest.java Tue Jan 16 07:31:17 2007
@@ -99,104 +99,3 @@
}
}
-package org.apache.maven.project.inheritance.t10;
-
-/*
- * 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 java.io.File;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Iterator;
-
-import org.apache.maven.model.Build;
-import org.apache.maven.model.MailingList;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.PluginExecution;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase;
-import org.apache.maven.artifact.Artifact;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.codehaus.plexus.logging.LoggerManager;
-import org.codehaus.plexus.logging.Logger;
-
-/**
- * Verifies scope inheritence of direct and transitive dependencies.
- *
- * Should show three behaviors:
- *
- * 1. dependencyManagement should override the scope of transitive dependencies.
- * 2. Direct dependencies should override the scope of dependencyManagement.
- * 3. Direct dependencies should inherit scope from dependencyManagement when
- * they do not explicitly state a scope.
- *
- * @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
- * @version $Id$
- */
-public class ProjectInheritanceTest
- extends AbstractProjectInheritanceTestCase
-{
- // ----------------------------------------------------------------------
- //
- // p1 inherits from p0
- // p0 inhertis from super model
- //
- // or we can show it graphically as:
- //
- // p1 ---> p0 --> super model
- //
- // ----------------------------------------------------------------------
-
- public void testDependencyManagementOverridesTransitiveDependencyVersion()
- throws Exception
- {
- File localRepo = getLocalRepositoryPath();
-
- File pom0 = new File( localRepo, "p0/pom.xml" );
- File pom0Basedir = pom0.getParentFile();
- File pom1 = new File( pom0Basedir, "p1/pom.xml" );
-
- // load the child project, which inherits from p0...
- MavenProject project0 = getProjectWithDependencies( pom0 );
- MavenProject project1 = getProjectWithDependencies( pom1 );
-
- assertEquals( pom0Basedir, project1.getParent().getBasedir() );
- System.out.println("Project " + project1.getId() + " " + project1);
- Map map = project1.getArtifactMap();
- assertNotNull("No artifacts", map);
- assertTrue("No Artifacts", map.size() > 0);
- assertTrue("Set size should be 3, is " + map.size(), map.size() == 3);
-
- Artifact a = (Artifact) map.get("maven-test:maven-test-a");
- Artifact b = (Artifact) map.get("maven-test:maven-test-b");
- Artifact c = (Artifact) map.get("maven-test:maven-test-c");
-
- // inherited from depMgmt
- assertTrue("Incorrect scope for " + a.getDependencyConflictId(), a.getScope().equals("test"));
-
- // transitive dep, overridden b depMgmt
- assertTrue("Incorrect scope for " + b.getDependencyConflictId(), b.getScope().equals("runtime"));
-
- // direct dep, overrides depMgmt
- assertTrue("Incorrect scope for " + c.getDependencyConflictId(), c.getScope().equals("runtime"));
-
- }
-}