You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2003/12/10 16:53:16 UTC
cvs commit: maven-components/maven-project/src/test-input/b/bb/bbb project.xml
jvanzyl 2003/12/10 07:53:16
Modified: maven-project/src/test/org/apache/maven/project
DefaultProjectBuilderTest.java
maven-project/src/test-input/b project.xml
maven-project/src/test-input/b/bb project.xml
maven-project/src/test-input/b/bb/bbb project.xml
Log:
o adding test for 3 levels of inheritance. all is well so far.
Revision Changes Path
1.18 +30 -0 maven-components/maven-project/src/test/org/apache/maven/project/DefaultProjectBuilderTest.java
Index: DefaultProjectBuilderTest.java
===================================================================
RCS file: /home/cvs/maven-components/maven-project/src/test/org/apache/maven/project/DefaultProjectBuilderTest.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- DefaultProjectBuilderTest.java 10 Dec 2003 05:37:36 -0000 1.17
+++ DefaultProjectBuilderTest.java 10 Dec 2003 15:53:15 -0000 1.18
@@ -180,4 +180,34 @@
// Get the inception year from the grand parent.
assertEquals( "2001", project.getInceptionYear() );
}
+
+ public void testModelInheritanceWithThreeLevelsOfInheritance()
+ throws Exception
+ {
+ File f = new File( basedir, "src/test-input/b/bb/bbb/project.xml" );
+
+ Project project = projectBuilder.build( f );
+
+ assertNotNull( "Test project cannot be null.", project );
+
+ assertNotNull( project.getParent().getParent() );
+
+ // Get version which is set in both the parent and the grand parent. So
+ // we should get "2.0" which is definted in this project.
+ assertEquals( "3.0", project.getVersion() );
+
+ // Get project url from parent.
+ assertEquals( "bb-url", project.getUrl() );
+
+ // There are no dependencies specified in this project but there are
+ // dependencies specified in the grand parent.
+ Dependency d0 = (Dependency) project.getDependencies().get( 0 );
+
+ assertNotNull( "Dependency which has been specified in the parent cannot be null", d0 );
+
+ assertEquals( "c", d0.getGroupId() );
+
+ // Get the inception year from the great grand parent.
+ assertEquals( "2001", project.getInceptionYear() );
+ }
}
1.2 +3 -3 maven-components/maven-project/src/test-input/b/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven-components/maven-project/src/test-input/b/project.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- project.xml 9 Dec 2003 13:56:25 -0000 1.1
+++ project.xml 10 Dec 2003 15:53:15 -0000 1.2
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<extend>${basedir}/../project.xml</extend>
- <groupId>b</groupId>
- <artifactId>b</artifactId>
- <name>b</name>
+ <groupId>bb</groupId>
+ <artifactId>bb</artifactId>
+ <name>bb</name>
<currentVersion>1.0</currentVersion>
<dependencies>
1.2 +1 -0 maven-components/maven-project/src/test-input/b/bb/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven-components/maven-project/src/test-input/b/bb/project.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- project.xml 10 Dec 2003 14:44:08 -0000 1.1
+++ project.xml 10 Dec 2003 15:53:16 -0000 1.2
@@ -5,5 +5,6 @@
<artifactId>bb</artifactId>
<name>bb</name>
<version>2.0</version>
+ <url>bb-url</url>
</project>
1.2 +1 -1 maven-components/maven-project/src/test-input/b/bb/bbb/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven-components/maven-project/src/test-input/b/bb/bbb/project.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- project.xml 10 Dec 2003 14:44:08 -0000 1.1
+++ project.xml 10 Dec 2003 15:53:16 -0000 1.2
@@ -4,6 +4,6 @@
<groupId>bbb</groupId>
<artifactId>bbb</artifactId>
<name>bbb</name>
- <version>2.0</version>
+ <version>3.0</version>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org