jvanzyl 2003/12/09 07:57:54
Modified: maven-project/src/test/org/apache/maven/project
DefaultProjectBuilderTest.java
maven-project/src/test-input project.properties
Log:
o created a test which displays failing property inheritance. now time to
fix it.
Revision Changes Path
1.11 +14 -12
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.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- DefaultProjectBuilderTest.java 9 Dec 2003 15:34:40 -0000 1.10
+++ DefaultProjectBuilderTest.java 9 Dec 2003 15:57:54 -0000 1.11
@@ -39,8 +39,6 @@
{
File f = new File( basedir, "src/test/org/apache/maven/project/project.xml"
);
- assertTrue( "Test file project.xml file doesn't exist!", f.exists() );
-
Project project = projectBuilder.build( f );
ModelTestHelper.testModelMapping( project.getModel() );
@@ -48,10 +46,6 @@
assertEquals( "foo", project.getProperty( "maven.final.name" ) );
assertNotNull( project.getModelSource() );
-
- project.setModelVersion( "4" );
-
- assertEquals( "4", project.getModelVersion() );
}
public void testModelInheritanceWhereChildInheritsEverything()
@@ -59,8 +53,6 @@
{
File f = new File( basedir, "src/test/org/apache/maven/project/child.xml" );
- assertTrue( "Test file child.xml file doesn't exist!", f.exists() );
-
Project project = projectBuilder.build( f );
assertNotNull( "Test project can't be null!", project );
@@ -77,8 +69,6 @@
{
File f = new File( basedir,
"src/test/org/apache/maven/project/fully-populated-child.xml" );
- assertTrue( "Test file fully-populated-child.xml file doesn't exist!",
f.exists() );
-
Project project = projectBuilder.build( f );
assertNotNull( "Test project can't be null!", project );
@@ -93,8 +83,6 @@
{
File f = new File( basedir,
"src/test/org/apache/maven/project/child-with-bogus-parent.xml" );
- assertTrue( "Test file child-with-bogus-parent.xml file doesn't exist!",
f.exists() );
-
try
{
projectBuilder.build( f );
@@ -124,5 +112,19 @@
{
// do nothing.
}
+ }
+
+ public void testRecursiveInheritance()
+ throws Exception
+ {
+ File f = new File( basedir, "src/test-input/a/project.xml" );
+
+ Project project = projectBuilder.build( f );
+
+ assertNotNull( "Test project cannot be null.", project );
+
+ assertEquals( "a", project.getProperty( "name" ) );
+
+ assertEquals( "canada", project.getProperty( "country" ) );
}
}
1.2 +1 -0 maven-components/maven-project/src/test-input/project.properties
Index: project.properties
===================================================================
RCS file:
/home/cvs/maven-components/maven-project/src/test-input/project.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- project.properties 9 Dec 2003 15:41:23 -0000 1.1
+++ project.properties 9 Dec 2003 15:57:54 -0000 1.2
@@ -1 +1,2 @@
name = parent
+country = canada
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]