P
Petterson Mikael
Hi,
In a class we have a constant pointing out path to store a log file.
public static final String LOG = "<path to log dir>";
The path is valid only in the context of the target environment and when
we are testing that path is not valid. So when we run the test we get:
java.io.FileNotFoundException: <path to log file> (No such file or
directory) at java.io.FileOutputStream.open
Log dir is created in a "static initializer".
Any ideas how I can change the path depending if it is a test or class
is running in target environment.
What do you think about checking if the path exists and if not change it
to a test directory.
All hints appreciated,
cheers,
//mikael
In a class we have a constant pointing out path to store a log file.
public static final String LOG = "<path to log dir>";
The path is valid only in the context of the target environment and when
we are testing that path is not valid. So when we run the test we get:
java.io.FileNotFoundException: <path to log file> (No such file or
directory) at java.io.FileOutputStream.open
Log dir is created in a "static initializer".
Any ideas how I can change the path depending if it is a test or class
is running in target environment.
What do you think about checking if the path exists and if not change it
to a test directory.
All hints appreciated,
cheers,
//mikael