ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Herscu <bmf1...@fastmail.fm>
Subject [ant-testutil] setUp() an ANT test case
Date Fri, 10 Mar 2006 00:54:48 GMT
Hi all,

I am following the ANT tutorials, and now I am trying to see how I can
run tests under Maven.

I have put the HelloWorld and HelloWorldTest classes into a package
(let's say mypck). The test build file is also found in that package. So
when compiled the file system looks like this:

basedir
	+-target
		+-classes
			+-mypck
				HelloWorld.class
		+-test-classes
			+-mypck
				HelloWorldTest.class
				test-helloworld.build.xml

Now, if I am calling configureProject() with just the test build file
name then ANT tries to retrieve it from basedir (which results in a
FileNotFoundException).

I am trying to solve this without hardcoding the full pathname in the
HelloWorldTest::setUp method by calling:

getResource("test-helloworld.build.xml").getFile()

which returns an absolute path to the test build file.

The problem is that the BuildFileTest::configureProject does not know
how to handle absolute pathnames and a FileNotFoundExecption is thrown.

Any idea how to solve that?
Adrian.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message