Print Files From JUNit to the "results" Directory

R

Reporter

I want to have some of my JUNit tests write additional files to the
"results" directory. I know I could easily hack my code to write to
that directory, but is there some elegant way that I can tap into the
JUnit "todir" attribute from within the context of the TestCase class.
 
P

Philip.Lourandos

I want to have some of my JUNit tests write additional files to the
"results" directory. I know I could easily hack my code to write to
that directory, but is there some elegant way that I can tap into the
JUnit "todir" attribute from within the context of the TestCase class.

I'm not too sure about retrieving the toDir from junit. But you could
always set a system property in ant(assuming you are using ant). With
spring I have a test application context I have all directories and
other test beans configured in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top