Fix unit tests.

The order of the tests is important since the same groupId/artifactId/version
combinations are used in different local repositories in the tests, containing
different poms. The DefaultMavenProjectBuilder caches models with g🅰️v,
so it can serve a model from another local repo.

Solved this by changing groupId's in the poms and repositories so they don't
conflict.


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@513720 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kenney Westerhof 2007-03-02 12:05:15 +00:00
parent 7ddabf5a2d
commit cd8c1d61a2
15 changed files with 47 additions and 42 deletions

View File

@ -39,7 +39,12 @@ public abstract class AbstractProjectInheritanceTestCase
protected File projectFile( String name )
{
return new File( getLocalRepositoryPath(), "/maven/poms/" + name + "-1.0.pom" );
return projectFile( "maven", name );
}
protected File projectFile( String groupId, String artifactId )
{
return new File( getLocalRepositoryPath(), "/" + groupId + "/poms/" + artifactId + "-1.0.pom" );
}
// ----------------------------------------------------------------------

View File

@ -54,7 +54,7 @@ public class ProjectInheritanceTest
// Check p0 value for org name
// ----------------------------------------------------------------------
MavenProject p0 = getProject( projectFile( "p0" ) );
MavenProject p0 = getProject( projectFile( "maven.t01", "p0" ) );
assertEquals( "p0-org", p0.getOrganization().getName() );
@ -62,7 +62,7 @@ public class ProjectInheritanceTest
// Check p1 value for org name
// ----------------------------------------------------------------------
MavenProject p1 = getProject( projectFile( "p1" ) );
MavenProject p1 = getProject( projectFile( "maven.t01", "p1" ) );
assertEquals( "p1-org", p1.getOrganization().getName() );
@ -70,7 +70,7 @@ public class ProjectInheritanceTest
// Check p2 value for org name
// ----------------------------------------------------------------------
MavenProject p2 = getProject( projectFile( "p2" ) );
MavenProject p2 = getProject( projectFile( "maven.t01", "p2" ) );
assertEquals( "p2-org", p2.getOrganization().getName() );
@ -78,7 +78,7 @@ public class ProjectInheritanceTest
// Check p2 value for org name
// ----------------------------------------------------------------------
MavenProject p3 = getProject( projectFile( "p3" ) );
MavenProject p3 = getProject( projectFile( "maven.t01", "p3" ) );
assertEquals( "p3-org", p3.getOrganization().getName() );
@ -86,7 +86,7 @@ public class ProjectInheritanceTest
// Check p4 value for org name
// ----------------------------------------------------------------------
MavenProject p4 = getProject( projectFile( "p4" ) );
MavenProject p4 = getProject( projectFile( "maven.t01", "p4" ) );
assertEquals( "p4-org", p4.getOrganization().getName() );
}

View File

@ -1,6 +1,6 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t01</groupId>
<artifactId>p0</artifactId>
<packaging>pom</packaging>
<name>p0</name>

View File

@ -1,11 +1,11 @@
<project>
<parent>
<artifactId>p0</artifactId>
<groupId>maven</groupId>
<groupId>maven.t01</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t01</groupId>
<artifactId>p1</artifactId>
<packaging>pom</packaging>
<name>p1</name>

View File

@ -1,11 +1,11 @@
<project>
<parent>
<artifactId>p1</artifactId>
<groupId>maven</groupId>
<groupId>maven.t01</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t01</groupId>
<artifactId>p2</artifactId>
<packaging>pom</packaging>
<name>p2</name>

View File

@ -1,11 +1,11 @@
<project>
<parent>
<artifactId>p2</artifactId>
<groupId>maven</groupId>
<groupId>maven.t01</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t01</groupId>
<artifactId>p3</artifactId>
<packaging>pom</packaging>
<name>p3</name>

View File

@ -1,11 +1,11 @@
<project>
<parent>
<artifactId>p3</artifactId>
<groupId>maven</groupId>
<groupId>maven.t01</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t01</groupId>
<artifactId>p4</artifactId>
<packaging>jar</packaging>
<name>p4</name>

View File

@ -20,11 +20,11 @@ under the License.
<project>
<parent>
<artifactId>p4</artifactId>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<artifactId>p5</artifactId>
<packaging>jar</packaging>
<name>p5</name>

View File

@ -20,11 +20,11 @@ under the License.
<project>
<parent>
<artifactId>p3</artifactId>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<artifactId>p4</artifactId>
<packaging>jar</packaging>
<name>p4</name>

View File

@ -20,11 +20,11 @@ under the License.
<project>
<parent>
<artifactId>p2</artifactId>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<artifactId>p3</artifactId>
<packaging>pom</packaging>
<name>p3</name>

View File

@ -20,11 +20,11 @@ under the License.
<project>
<parent>
<artifactId>p1</artifactId>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<artifactId>p2</artifactId>
<packaging>pom</packaging>
<name>p2</name>

View File

@ -20,11 +20,11 @@ under the License.
<project>
<parent>
<artifactId>p0</artifactId>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<artifactId>p1</artifactId>
<packaging>pom</packaging>
<name>p1</name>

View File

@ -19,7 +19,7 @@ under the License.
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t02</groupId>
<artifactId>p0</artifactId>
<packaging>pom</packaging>
<name>p0</name>

View File

@ -20,11 +20,11 @@ under the License.
<project>
<parent>
<artifactId>p0</artifactId>
<groupId>maven</groupId>
<groupId>maven.t03</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t03</groupId>
<artifactId>p1</artifactId>
<packaging>pom</packaging>
<name>p1</name>

View File

@ -19,7 +19,7 @@ under the License.
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<groupId>maven.t03</groupId>
<artifactId>p0</artifactId>
<packaging>pom</packaging>
<name>p0</name>