brett 2004/03/02 03:16:53
Modified: src/java/org/apache/maven/project Tag: MAVEN-1_0-BRANCH
Project.java
src/test/java/org/apache/maven/project Tag: MAVEN-1_0-BRANCH
ProjectTest.java
Added: src/test/test-data/pom Tag: MAVEN-1_0-BRANCH
test-group-id-and-artifact-id.xml
test-group-id-and-id-as-artifact-id.xml
test-id-only.xml
src/test/java/org/apache/maven/project Tag: MAVEN-1_0-BRANCH
LegacyIdTest.java
Log:
PR: MAVEN-1123
<artifactId> should work in POM
Revision Changes Path
No revision
No revision
1.91.4.12 +10 -11 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.11
retrieving revision 1.91.4.12
diff -u -r1.91.4.11 -r1.91.4.12
--- Project.java 1 Mar 2004 22:36:38 -0000 1.91.4.11
+++ Project.java 2 Mar 2004 11:16:52 -0000 1.91.4.12
@@ -244,16 +244,7 @@
return id;
}
- // We want the artifact id to be the stated <id/>. Internally
- // the id consists of the groupId and stated <id/>.
- setArtifactId( id );
-
- if ( isValid( getGroupId() ) )
- {
- return getGroupId() + ":" + id;
- }
-
- return id + ":" + id;
+ return getGroupId() + ":" + getArtifactId();
}
/**
@@ -274,6 +265,10 @@
*/
public String getArtifactId()
{
+ if ( !isValid( artifactId ) )
+ {
+ this.artifactId = id;
+ }
return artifactId;
}
@@ -304,6 +299,10 @@
*/
public String getGroupId()
{
+ if ( groupId == null )
+ {
+ groupId = getArtifactId();
+ }
return groupId;
}
No revision
No revision
1.1.2.1 +6 -0
maven/src/test/test-data/pom/Attic/test-group-id-and-artifact-id.xml
1.1.2.1 +6 -0
maven/src/test/test-data/pom/Attic/test-group-id-and-id-as-artifact-id.xml
1.1.2.1 +5 -0 maven/src/test/test-data/pom/Attic/test-id-only.xml
No revision
No revision
1.5.4.2 +0 -24 maven/src/test/java/org/apache/maven/project/ProjectTest.java
Index: ProjectTest.java
===================================================================
RCS file: /home/cvs/maven/src/test/java/org/apache/maven/project/ProjectTest.java,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -u -r1.5.4.1 -r1.5.4.2
--- ProjectTest.java 2 Mar 2004 05:38:55 -0000 1.5.4.1
+++ ProjectTest.java 2 Mar 2004 11:16:53 -0000 1.5.4.2
@@ -484,30 +484,6 @@
// JUnitDoclet end method createDocument
}
-
- /**
- * Test for legacyToStandardId
- */
- public void testLegacyToStandardId()
- {
- // test 'ant' -> 'ant:ant'
- String legacyId = "ant";
- String standardId = "ant:ant";
- assertEquals("Single id conversion failed", standardId,
- Project.legacyToStandardId(legacyId));
-
- // test 'ant:ant' unchanged
- legacyId = "ant:ant";
- assertEquals("Standard id conversion failed", standardId,
- Project.legacyToStandardId(legacyId));
-
- // test 'ant+optional' -> ant:ant-optional
- legacyId = "ant+optional";
- standardId = "ant:ant-optional";
- assertEquals("Plus format id conversion failed", standardId,
- Project.legacyToStandardId(legacyId));
- }
-
/**
* JUnitDoclet moves marker to this method, if there is not match
* for them in the regenerated code and if the marker is not empty.
No revision
Index: ProjectTest.java
===================================================================
RCS file: /home/cvs/maven/src/test/java/org/apache/maven/project/ProjectTest.java,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -u -r1.5.4.1 -r1.5.4.2
--- ProjectTest.java 2 Mar 2004 05:38:55 -0000 1.5.4.1
+++ ProjectTest.java 2 Mar 2004 11:16:53 -0000 1.5.4.2
@@ -484,30 +484,6 @@
// JUnitDoclet end method createDocument
}
-
- /**
- * Test for legacyToStandardId
- */
- public void testLegacyToStandardId()
- {
- // test 'ant' -> 'ant:ant'
- String legacyId = "ant";
- String standardId = "ant:ant";
- assertEquals("Single id conversion failed", standardId,
- Project.legacyToStandardId(legacyId));
-
- // test 'ant:ant' unchanged
- legacyId = "ant:ant";
- assertEquals("Standard id conversion failed", standardId,
- Project.legacyToStandardId(legacyId));
-
- // test 'ant+optional' -> ant:ant-optional
- legacyId = "ant+optional";
- standardId = "ant:ant-optional";
- assertEquals("Plus format id conversion failed", standardId,
- Project.legacyToStandardId(legacyId));
- }
-
/**
* JUnitDoclet moves marker to this method, if there is not match
* for them in the regenerated code and if the marker is not empty.
No revision
Index: ProjectTest.java
===================================================================
RCS file: /home/cvs/maven/src/test/java/org/apache/maven/project/ProjectTest.java,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -u -r1.5.4.1 -r1.5.4.2
--- ProjectTest.java 2 Mar 2004 05:38:55 -0000 1.5.4.1
+++ ProjectTest.java 2 Mar 2004 11:16:53 -0000 1.5.4.2
@@ -484,30 +484,6 @@
// JUnitDoclet end method createDocument
}
-
- /**
- * Test for legacyToStandardId
- */
- public void testLegacyToStandardId()
- {
- // test 'ant' -> 'ant:ant'
- String legacyId = "ant";
- String standardId = "ant:ant";
- assertEquals("Single id conversion failed", standardId,
- Project.legacyToStandardId(legacyId));
-
- // test 'ant:ant' unchanged
- legacyId = "ant:ant";
- assertEquals("Standard id conversion failed", standardId,
- Project.legacyToStandardId(legacyId));
-
- // test 'ant+optional' -> ant:ant-optional
- legacyId = "ant+optional";
- standardId = "ant:ant-optional";
- assertEquals("Plus format id conversion failed", standardId,
- Project.legacyToStandardId(legacyId));
- }
-
/**
* JUnitDoclet moves marker to this method, if there is not match
* for them in the regenerated code and if the marker is not empty.
1.1.2.1 +96 -0
maven/src/test/java/org/apache/maven/project/Attic/LegacyIdTest.java
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]