ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craeg K. Strong" <cstr...@arielpartners.com>
Subject Testing Framework: How to test properties of child projects?
Date Wed, 26 Sep 2001 22:10:51 GMT
I recently coded up and submitted a patch to the <ant> task that affects
how properties are passed to a child project.

I did test the patch, but it would be nice to include such tests in the 
automated
test suite that Nico Seessle and others have worked on.

The problem is this:  once I create a subproject by calling <ant>, how 
on earth
can I get my hands on it in the testing framework?

I want to do something like this (simplified example):

// inheritAll = true, parent property should be inherited
public void test7() {
  executeTarget("test7");
  assertEquals("parent-wins", newProject.getProperty("test");
}

// inheritAll = false, parent property should NOT be inherited
public void test8() {
  executeTarget("test8");
  assertEquals("child-wins", newProject.getProperty("test");
}

Where parent buildfile =

<target name="test7">
  <property name="test" value="parent-wins"/>
  <ant
   antfile = "child.xml"
   inheritAll = "true"/>
</target>

<target name="test8">
  <property name="test" value="parent-wins"/>
   <ant
   antfile = "child.xml"
  inheritAll = "false"/>
</target>

and Child buildfile =

<target name="default">
  <property name="test" value="child-wins"/>
 </target>

Does anyone have any ideas on how to do this?    Thanks in advance!!!

--Craeg


Mime
View raw message