ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christoph Krammer">
Subject Accessing Properties from Sub-Projects
Date Tue, 02 Oct 2007 18:32:44 GMT
Hello everybody,

I use Ant together with a Test framework for Web applications (Canoo
WebTest). The main structure of the Ant files is the following:

main build.xml:

<project name="example" default="wt.deployToTest">

	<property name="webtest.home" value="C:\eclipse\webtest-2.5"/>	
	<import file="${webtest.home}/webtest.xml" />
	<property name="wt.testInWork" value="tests/jsfTest.xml"/>

	<target name="wt.deployToTest" depends="wt.full">
		<property file="tests/error.tmp" />
		<echo message="Test failure is: ${test.failure}" />

Excerpt from the webtest.xml:

<target name="wt.testInWork">
	<ant dir="${wt.testInWork.dir}" antfile="${wt.testInWork.file}"


Excerpt from tests/jsfTest.xml:

<project name="demo" default="test">

	<target name="test">

		<webtest name="Check if result contains name">
			test.failure: ${test.failure}

If the test fails, the ${test.failure} property is set within the
project in the jsfTest.xml file. But the problem is that I need the
value of this property in the main build.xml file, since I want to
decide further actions on basis of this value after all tests have been

I know one simple solution: To export the test.failure property to a
file and read it in the build.xml. But this solution has one major
drawback: The final test suite will consist of lots of webtest projects
in different xml files (one per developer). The problem is to ensure
that the test.failure value is exported in all files, in each single
test's xml. If any one developer omits the export, a failure of his
tests will not be taken into account for further decisions (like
deployment to a productive system). Obviously, this is not perfect.

Is there any simpler solution to this problem where no entry is needed
in the test's xml files?

Thanks for any help.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message