Hi Nathan!

Thanks for your help, now i use a separate instance and it works both for
main and test!

Greetings
Greg


-----Ursprüngliche Nachricht-----
Von: Gregor Grambow
Gesendet: Fr 13.03.2009 14:54
An: [email protected]
Betreff: Problems finding templates in junit test
 
Hi everyone!

I am integrating velocity into our project and everything seems to work fine.
now i'm trying to write tests. There i have the problem that i cannot find my
velocity templates.
the project is no web app. it just generates text files.

i use the same process as in the real app:

p.setProperty("file.resource.loader.path", templateDir); 
Velocity.init(p);

in the app it works fine, but in the test the template is not found.
i tried different combinations of strings, relative, absolute, with "/" and
"\".
i checked if the starting path is the same in both cases (in both cases
project root).

then i checked via:

String test = (String) Velocity.getProperty("file.resource.loader.path");

if the property is set. for the real app it returns:
".\src\main\resources\templates"
and for the test it returns:
"."

if i move the templates to project root, it works fine, but that is no option
because there will be many templates.

could anyone tell me what i've done wrong? velocity version is 1.6.
or is it possibly a bug?

thanks in advance!

greetings
greg


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to