brett 2004/03/03 02:34:02 Modified: src/test/java/org/apache/maven/project Tag: MAVEN-1_0-BRANCH LegacyIdTest.java src/java/org/apache/maven/project Tag: MAVEN-1_0-BRANCH Project.java Added: src/test/test-data/pom/extend Tag: MAVEN-1_0-BRANCH base.xml test-group-id-and-artifact-id.xml test-group-id-and-id-as-artifact-id.xml test-id-only.xml test-none.xml Log: id fixes for extended POMs Revision Changes Path No revision No revision 1.1.2.1 +5 -0 maven/src/test/test-data/pom/extend/Attic/base.xml 1.1.2.1 +6 -0 maven/src/test/test-data/pom/extend/Attic/test-group-id-and-artifact-id.xml 1.1.2.1 +6 -0 maven/src/test/test-data/pom/extend/Attic/test-group-id-and-id-as-artifact-id.xml 1.1.2.1 +5 -0 maven/src/test/test-data/pom/extend/Attic/test-id-only.xml 1.1.2.1 +4 -0 maven/src/test/test-data/pom/extend/Attic/test-none.xml No revision No revision 1.1.2.2 +38 -1 maven/src/test/java/org/apache/maven/project/Attic/LegacyIdTest.java Index: LegacyIdTest.java =================================================================== RCS file: /home/cvs/maven/src/test/java/org/apache/maven/project/Attic/LegacyIdTest.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- LegacyIdTest.java 2 Mar 2004 11:16:53 -0000 1.1.2.1 +++ LegacyIdTest.java 3 Mar 2004 10:34:02 -0000 1.1.2.2 @@ -85,6 +85,43 @@ assertEquals( "check id", "groupId:artifactId", p.getId() ); } + public void testExtendNone() throws Exception + { + Project p = MavenUtils.getProject( new File( System.getProperty( "basedir" ), + "src/test/test-data/pom/extend/test-none.xml" ) ); + assertEquals( "check group id", "base-groupId", p.getGroupId() ); + } + + public void testExtendIdOnly() throws Exception + { + Project p = MavenUtils.getProject( new File( System.getProperty( "basedir" ), + "src/test/test-data/pom/extend/test-id-only.xml" ) ); + assertEquals( "check id", "base-groupId:extend-artifactId", p.getId() ); + assertEquals( "check artifact id", "extend-artifactId", p.getArtifactId() ); + assertEquals( "check group id", "base-groupId", p.getGroupId() ); + assertEquals( "check id", "base-groupId:extend-artifactId", p.getId() ); + } + + public void testExtendGroupIdAndArtifactId() throws Exception + { + Project p = MavenUtils.getProject( new File( System.getProperty( "basedir" ), + "src/test/test-data/pom/extend/test-group-id-and-artifact-id.xml" ) ); + assertEquals( "check id", "extend-groupId:extend-artifactId", p.getId() ); + assertEquals( "check artifact id", "extend-artifactId", p.getArtifactId() ); + assertEquals( "check group id", "extend-groupId", p.getGroupId() ); + assertEquals( "check id", "extend-groupId:extend-artifactId", p.getId() ); + } + + public void testExtendGroupIdAndIdAsArtifactId() throws Exception + { + Project p = MavenUtils.getProject( new File( System.getProperty( "basedir" ), + "src/test/test-data/pom/extend/test-group-id-and-id-as-artifact-id.xml" ) ); + assertEquals( "check id", "extend-groupId:extend-artifactId", p.getId() ); + assertEquals( "check artifact id", "extend-artifactId", p.getArtifactId() ); + assertEquals( "check group id", "extend-groupId", p.getGroupId() ); + assertEquals( "check id", "extend-groupId:extend-artifactId", p.getId() ); + } + /** * Generate the test suite. * @return the test suite No revision No revision 1.91.4.13 +2 -4 maven/src/java/org/apache/maven/project/Project.java Index: Project.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/project/Project.java,v retrieving revision 1.91.4.12 retrieving revision 1.91.4.13 diff -u -r1.91.4.12 -r1.91.4.13 --- Project.java 2 Mar 2004 11:16:52 -0000 1.91.4.12 +++ Project.java 3 Mar 2004 10:34:02 -0000 1.91.4.13 @@ -243,7 +243,6 @@ { return id; } - return getGroupId() + ":" + getArtifactId(); } @@ -1553,7 +1552,7 @@ if ( groupId == null ) { - groupId = parent.groupId; + groupId = parent.getGroupId(); } if ( build == null ) @@ -1614,5 +1613,4 @@ //addParentVersions( parent.versions ); addParentDependencies( parent.dependencies ); } - }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]