On Sep 11, 2008, at 7:00 PM, Stefan Groschupf wrote:
This definitly does not smell from my point of view, since it is
very common for tests to read and write into project relative paths.
Actually if you deal with files relative is the only way....
There are other, better ways to deal with this.
You can put your test files in the resources folder and say:
File testFile = new File(getClass().getResource
("someresource").getPath());
If for some reason you also need to execute your tests from a jar
(for example because you use your read only integration tests also
for monitoring) you can extract the test file as a stream and write
it to a file in a temporary folder.
I think this is much better than depending on the value of the
current dir.
- Hans
--
Hans Dockter
Gradle Project lead
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email