Or you could use a java.util.ResourceBundle loaded from the classpath.

Vlad.


Please respond to [EMAIL PROTECTED]
To:     [EMAIL PROTECTED]
cc: 

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







Reply via email to