ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Rogers" <jason.rog...@tumbleweed.com>
Subject RE: JUNIT & search for properties files
Date Mon, 17 Sep 2001 18:50:52 GMT
You could use a System property:
-Dtests.properties=/tmp/test.properties

-jason

    > -----Original Message-----
    > From: Frot [mailto:frot@earthling.net]
    > Sent: Monday, September 17, 2001 2:36 PM
    > To: ant-user@jakarta.apache.org
    > Subject: JUNIT & search for properties files
    > 
    > 
    > I currently am in search for idea's of solving following problem.
    > 
    > Execution of my JUnit testcases is configured using a 
    > 'test.properties' file.
    > Unfortunatly loading a Input Stream using 
    > 
    > 	prop.load(new inputStream("test.properties")) ;
    > 
    > Does not work : the file is not found !!!
    > 
    > Solution to this might be using absolute paths, but that 
    > results in the familiar
    > problems (multiple users have different paths => BIG mess).
    > 
    > 	prop.load(new inputStream("/tmp/test.properties")) ;
    > 
    > Due to the problems this is not a solution for longer term use.
    > 
    > My question is how to tackle this problem intelligently 
    > !! Any idea's ??
    > 
    > ==============
    > 
    > My tip would be adding (how) a environment variable to 
    > the JUNIT task and use
    > this variable when opening the file like :
    > 
    > 	<JUNIT .......>
    > 		<CLASSPATH>......</CLASSPATH>
    > 		<ABSPATH="c://temp//" />
    >      </JUNIT>
    > 
    > Now I could use this newly created variable 
    > 
    > 	prop.load(new inputStream(System.Env("ABSPATH") + 
    > "test.properties")) ;
    > 
    > 
    > 
    > Thanks for any input,
    > 
    > Fred
    > 
    > 
    > 
    > 
    > 
    > 


Mime
View raw message